@whop/sdk 0.0.34 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/client.d.mts +12 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/affiliates/affiliates.d.mts +353 -0
  16. package/resources/affiliates/affiliates.d.mts.map +1 -0
  17. package/resources/affiliates/affiliates.d.ts +353 -0
  18. package/resources/affiliates/affiliates.d.ts.map +1 -0
  19. package/resources/affiliates/affiliates.js +112 -0
  20. package/resources/affiliates/affiliates.js.map +1 -0
  21. package/resources/affiliates/affiliates.mjs +107 -0
  22. package/resources/affiliates/affiliates.mjs.map +1 -0
  23. package/resources/affiliates/index.d.mts +3 -0
  24. package/resources/affiliates/index.d.mts.map +1 -0
  25. package/resources/affiliates/index.d.ts +3 -0
  26. package/resources/affiliates/index.d.ts.map +1 -0
  27. package/resources/affiliates/index.js +9 -0
  28. package/resources/affiliates/index.js.map +1 -0
  29. package/resources/affiliates/index.mjs +4 -0
  30. package/resources/affiliates/index.mjs.map +1 -0
  31. package/resources/affiliates/overrides.d.mts +451 -0
  32. package/resources/affiliates/overrides.d.mts.map +1 -0
  33. package/resources/affiliates/overrides.d.ts +451 -0
  34. package/resources/affiliates/overrides.d.ts.map +1 -0
  35. package/resources/affiliates/overrides.js +117 -0
  36. package/resources/affiliates/overrides.js.map +1 -0
  37. package/resources/affiliates/overrides.mjs +113 -0
  38. package/resources/affiliates/overrides.mjs.map +1 -0
  39. package/resources/affiliates.d.mts +2 -0
  40. package/resources/affiliates.d.mts.map +1 -0
  41. package/resources/affiliates.d.ts +2 -0
  42. package/resources/affiliates.d.ts.map +1 -0
  43. package/resources/affiliates.js +6 -0
  44. package/resources/affiliates.js.map +1 -0
  45. package/resources/affiliates.mjs +3 -0
  46. package/resources/affiliates.mjs.map +1 -0
  47. package/resources/ai-chats.d.mts +21 -2
  48. package/resources/ai-chats.d.mts.map +1 -1
  49. package/resources/ai-chats.d.ts +21 -2
  50. package/resources/ai-chats.d.ts.map +1 -1
  51. package/resources/ai-chats.js +2 -1
  52. package/resources/ai-chats.js.map +1 -1
  53. package/resources/ai-chats.mjs +2 -1
  54. package/resources/ai-chats.mjs.map +1 -1
  55. package/resources/apps.d.mts +26 -0
  56. package/resources/apps.d.mts.map +1 -1
  57. package/resources/apps.d.ts +26 -0
  58. package/resources/apps.d.ts.map +1 -1
  59. package/resources/checkout-configurations.d.mts +69 -0
  60. package/resources/checkout-configurations.d.mts.map +1 -1
  61. package/resources/checkout-configurations.d.ts +69 -0
  62. package/resources/checkout-configurations.d.ts.map +1 -1
  63. package/resources/companies.d.mts +19 -0
  64. package/resources/companies.d.mts.map +1 -1
  65. package/resources/companies.d.ts +19 -0
  66. package/resources/companies.d.ts.map +1 -1
  67. package/resources/index.d.mts +4 -3
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +4 -3
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js +4 -2
  72. package/resources/index.js.map +1 -1
  73. package/resources/index.mjs +1 -0
  74. package/resources/index.mjs.map +1 -1
  75. package/resources/invoices.d.mts +179 -345
  76. package/resources/invoices.d.mts.map +1 -1
  77. package/resources/invoices.d.ts +179 -345
  78. package/resources/invoices.d.ts.map +1 -1
  79. package/resources/invoices.js +20 -2
  80. package/resources/invoices.js.map +1 -1
  81. package/resources/invoices.mjs +20 -2
  82. package/resources/invoices.mjs.map +1 -1
  83. package/resources/memberships.d.mts +1 -1
  84. package/resources/memberships.d.mts.map +1 -1
  85. package/resources/memberships.d.ts +1 -1
  86. package/resources/memberships.d.ts.map +1 -1
  87. package/resources/payments.d.mts +21 -2
  88. package/resources/payments.d.mts.map +1 -1
  89. package/resources/payments.d.ts +21 -2
  90. package/resources/payments.d.ts.map +1 -1
  91. package/resources/plans.d.mts +46 -0
  92. package/resources/plans.d.mts.map +1 -1
  93. package/resources/plans.d.ts +46 -0
  94. package/resources/plans.d.ts.map +1 -1
  95. package/resources/products.d.mts +2 -2
  96. package/resources/products.d.ts +2 -2
  97. package/resources/refunds.d.mts +1 -1
  98. package/resources/refunds.d.mts.map +1 -1
  99. package/resources/refunds.d.ts +1 -1
  100. package/resources/refunds.d.ts.map +1 -1
  101. package/resources/setup-intents.d.mts +74 -0
  102. package/resources/setup-intents.d.mts.map +1 -1
  103. package/resources/setup-intents.d.ts +74 -0
  104. package/resources/setup-intents.d.ts.map +1 -1
  105. package/resources/shared.d.mts +54 -5
  106. package/resources/shared.d.mts.map +1 -1
  107. package/resources/shared.d.ts +54 -5
  108. package/resources/shared.d.ts.map +1 -1
  109. package/resources/webhooks.d.mts +653 -3
  110. package/resources/webhooks.d.mts.map +1 -1
  111. package/resources/webhooks.d.ts +653 -3
  112. package/resources/webhooks.d.ts.map +1 -1
  113. package/resources/webhooks.js.map +1 -1
  114. package/resources/webhooks.mjs.map +1 -1
  115. package/src/client.ts +50 -1
  116. package/src/internal/utils/env.ts +2 -2
  117. package/src/resources/affiliates/affiliates.ts +475 -0
  118. package/src/resources/affiliates/index.ts +32 -0
  119. package/src/resources/affiliates/overrides.ts +593 -0
  120. package/src/resources/affiliates.ts +3 -0
  121. package/src/resources/ai-chats.ts +25 -1
  122. package/src/resources/apps.ts +31 -0
  123. package/src/resources/checkout-configurations.ts +81 -0
  124. package/src/resources/companies.ts +23 -0
  125. package/src/resources/index.ts +19 -0
  126. package/src/resources/invoices.ts +316 -397
  127. package/src/resources/memberships.ts +1 -1
  128. package/src/resources/payments.ts +26 -1
  129. package/src/resources/plans.ts +54 -0
  130. package/src/resources/products.ts +2 -2
  131. package/src/resources/refunds.ts +2 -1
  132. package/src/resources/setup-intents.ts +90 -0
  133. package/src/resources/shared.ts +65 -5
  134. package/src/resources/webhooks.ts +818 -0
  135. package/src/version.ts +1 -1
  136. package/version.d.mts +1 -1
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/version.mjs +1 -1
@@ -289,7 +289,7 @@ export interface MembershipListResponse {
289
289
  * Custom key-value pairs for the membership (commonly used for software licensing,
290
290
  * e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value.
291
291
  */
292
- metadata: { [key: string]: unknown };
292
+ metadata: { [key: string]: unknown } | null;
293
293
 
294
294
  /**
295
295
  * Whether recurring payment collection for this membership is temporarily paused
@@ -274,6 +274,8 @@ export type CardBrands =
274
274
  | 'codensa'
275
275
  | 'cabal'
276
276
  | 'hipercard'
277
+ | 'jcblankapay'
278
+ | 'cmi'
277
279
  | 'unknown';
278
280
 
279
281
  /**
@@ -300,7 +302,6 @@ export type PaymentMethodTypes =
300
302
  | 'cashapp'
301
303
  | 'claritypay'
302
304
  | 'coinbase'
303
- | 'coinflow'
304
305
  | 'crypto'
305
306
  | 'custom'
306
307
  | 'customer_balance'
@@ -370,6 +371,7 @@ export type PaymentMethodTypes =
370
371
  | 'vipps'
371
372
  | 'wechat_pay'
372
373
  | 'zip'
374
+ | 'coinflow'
373
375
  | 'unknown';
374
376
 
375
377
  /**
@@ -566,6 +568,11 @@ export interface PaymentListResponse {
566
568
  */
567
569
  total: number | null;
568
570
 
571
+ /**
572
+ * The datetime the payment was last updated.
573
+ */
574
+ updated_at: string;
575
+
569
576
  /**
570
577
  * The total in USD to show to the creator (excluding buyer fees).
571
578
  */
@@ -958,6 +965,14 @@ export declare namespace PaymentCreateParams {
958
965
  */
959
966
  currency: Shared.Currency;
960
967
 
968
+ /**
969
+ * The application fee amount collected by the platform from this connected
970
+ * account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less
971
+ * than the total payment amount. Only valid for connected accounts with a parent
972
+ * company.
973
+ */
974
+ application_fee_amount?: number | null;
975
+
961
976
  /**
962
977
  * The interval in days at which the plan charges (renewal plans). For example, 30
963
978
  * for monthly billing.
@@ -1214,6 +1229,16 @@ export interface PaymentListParams extends CursorPageParams {
1214
1229
  * Filter payments by their current substatus for more granular filtering.
1215
1230
  */
1216
1231
  substatuses?: Array<Shared.FriendlyReceiptStatus> | null;
1232
+
1233
+ /**
1234
+ * Only return payments last updated after this timestamp.
1235
+ */
1236
+ updated_after?: string | null;
1237
+
1238
+ /**
1239
+ * Only return payments last updated before this timestamp.
1240
+ */
1241
+ updated_before?: string | null;
1217
1242
  }
1218
1243
 
1219
1244
  export interface PaymentListFeesParams extends CursorPageParams {
@@ -369,6 +369,12 @@ export interface PlanCreateParams {
369
369
  */
370
370
  billing_period?: number | null;
371
371
 
372
+ /**
373
+ * Checkout styling overrides for this plan. Pass null to inherit from the company
374
+ * default.
375
+ */
376
+ checkout_styling?: PlanCreateParams.CheckoutStyling | null;
377
+
372
378
  /**
373
379
  * The available currencies on the platform
374
380
  */
@@ -474,6 +480,27 @@ export interface PlanCreateParams {
474
480
  }
475
481
 
476
482
  export namespace PlanCreateParams {
483
+ /**
484
+ * Checkout styling overrides for this plan. Pass null to inherit from the company
485
+ * default.
486
+ */
487
+ export interface CheckoutStyling {
488
+ /**
489
+ * The different border-radius styles available for checkout pages.
490
+ */
491
+ border_style?: 'rounded' | 'pill' | 'rectangular' | null;
492
+
493
+ /**
494
+ * A hex color code for the button color (e.g. #FF5733).
495
+ */
496
+ button_color?: string | null;
497
+
498
+ /**
499
+ * The different font families available for checkout pages.
500
+ */
501
+ font_family?: 'system' | 'roboto' | 'open_sans' | null;
502
+ }
503
+
477
504
  export interface CustomField {
478
505
  /**
479
506
  * The type of the custom field.
@@ -551,6 +578,12 @@ export interface PlanUpdateParams {
551
578
  */
552
579
  billing_period?: number | null;
553
580
 
581
+ /**
582
+ * Checkout styling overrides for this plan. Pass null to remove all overrides and
583
+ * inherit from the company default.
584
+ */
585
+ checkout_styling?: PlanUpdateParams.CheckoutStyling | null;
586
+
554
587
  /**
555
588
  * The available currencies on the platform
556
589
  */
@@ -656,6 +689,27 @@ export interface PlanUpdateParams {
656
689
  }
657
690
 
658
691
  export namespace PlanUpdateParams {
692
+ /**
693
+ * Checkout styling overrides for this plan. Pass null to remove all overrides and
694
+ * inherit from the company default.
695
+ */
696
+ export interface CheckoutStyling {
697
+ /**
698
+ * The different border-radius styles available for checkout pages.
699
+ */
700
+ border_style?: 'rounded' | 'pill' | 'rectangular' | null;
701
+
702
+ /**
703
+ * A hex color code for the button color (e.g. #FF5733).
704
+ */
705
+ button_color?: string | null;
706
+
707
+ /**
708
+ * The different font families available for checkout pages.
709
+ */
710
+ font_family?: 'system' | 'roboto' | 'open_sans' | null;
711
+ }
712
+
659
713
  export interface CustomField {
660
714
  /**
661
715
  * The type of the custom field.
@@ -130,7 +130,7 @@ export interface ProductCreateParams {
130
130
  company_id: string;
131
131
 
132
132
  /**
133
- * The display name of the product. Maximum 40 characters.
133
+ * The display name of the product. Maximum 80 characters.
134
134
  */
135
135
  title: string;
136
136
 
@@ -397,7 +397,7 @@ export interface ProductUpdateParams {
397
397
  store_page_config?: ProductUpdateParams.StorePageConfig | null;
398
398
 
399
399
  /**
400
- * The display name of the product. Maximum 40 characters.
400
+ * The display name of the product. Maximum 80 characters.
401
401
  */
402
402
  title?: string | null;
403
403
 
@@ -60,7 +60,8 @@ export type PaymentProvider =
60
60
  | 'claritypay'
61
61
  | 'checkout_dot_com'
62
62
  | 'airwallex'
63
- | 'coinflow';
63
+ | 'coinflow'
64
+ | 'sequra';
64
65
 
65
66
  /**
66
67
  * The status of the refund reference.
@@ -192,6 +192,11 @@ export namespace SetupIntent {
192
192
  */
193
193
  created_at: string;
194
194
 
195
+ /**
196
+ * The mailing address associated with the payment method's user
197
+ */
198
+ mailing_address: PaymentMethod.MailingAddress | null;
199
+
195
200
  /**
196
201
  * The payment method type of the payment method
197
202
  */
@@ -224,6 +229,46 @@ export namespace SetupIntent {
224
229
  */
225
230
  last4: string | null;
226
231
  }
232
+
233
+ /**
234
+ * The mailing address associated with the payment method's user
235
+ */
236
+ export interface MailingAddress {
237
+ /**
238
+ * The city of the address.
239
+ */
240
+ city: string | null;
241
+
242
+ /**
243
+ * The country of the address.
244
+ */
245
+ country: string | null;
246
+
247
+ /**
248
+ * The line 1 of the address.
249
+ */
250
+ line1: string | null;
251
+
252
+ /**
253
+ * The line 2 of the address.
254
+ */
255
+ line2: string | null;
256
+
257
+ /**
258
+ * The name of the customer.
259
+ */
260
+ name: string | null;
261
+
262
+ /**
263
+ * The postal code of the address.
264
+ */
265
+ postal_code: string | null;
266
+
267
+ /**
268
+ * The state of the address.
269
+ */
270
+ state: string | null;
271
+ }
227
272
  }
228
273
  }
229
274
 
@@ -375,6 +420,11 @@ export namespace SetupIntentListResponse {
375
420
  */
376
421
  created_at: string;
377
422
 
423
+ /**
424
+ * The mailing address associated with the payment method's user
425
+ */
426
+ mailing_address: PaymentMethod.MailingAddress | null;
427
+
378
428
  /**
379
429
  * The payment method type of the payment method
380
430
  */
@@ -407,6 +457,46 @@ export namespace SetupIntentListResponse {
407
457
  */
408
458
  last4: string | null;
409
459
  }
460
+
461
+ /**
462
+ * The mailing address associated with the payment method's user
463
+ */
464
+ export interface MailingAddress {
465
+ /**
466
+ * The city of the address.
467
+ */
468
+ city: string | null;
469
+
470
+ /**
471
+ * The country of the address.
472
+ */
473
+ country: string | null;
474
+
475
+ /**
476
+ * The line 1 of the address.
477
+ */
478
+ line1: string | null;
479
+
480
+ /**
481
+ * The line 2 of the address.
482
+ */
483
+ line2: string | null;
484
+
485
+ /**
486
+ * The name of the customer.
487
+ */
488
+ name: string | null;
489
+
490
+ /**
491
+ * The postal code of the address.
492
+ */
493
+ postal_code: string | null;
494
+
495
+ /**
496
+ * The state of the address.
497
+ */
498
+ state: string | null;
499
+ }
410
500
  }
411
501
  }
412
502
 
@@ -104,6 +104,19 @@ export interface App {
104
104
  */
105
105
  name: string;
106
106
 
107
+ /**
108
+ * The URL path template for a specific view of this app, appended to the base
109
+ * domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is
110
+ * not configured.
111
+ */
112
+ openapi_path: string | null;
113
+
114
+ /**
115
+ * The full origin URL for this app's proxied domain (e.g.,
116
+ * 'https://myapp.apps.whop.com'). Null if no proxy domain is configured.
117
+ */
118
+ origin: string | null;
119
+
107
120
  /**
108
121
  * The whitelisted OAuth callback URLs that users are redirected to after
109
122
  * authorizing the app.
@@ -116,6 +129,13 @@ export interface App {
116
129
  */
117
130
  requested_permissions: Array<App.RequestedPermission>;
118
131
 
132
+ /**
133
+ * The URL path template for a specific view of this app, appended to the base
134
+ * domain (e.g., '/experiences/[experienceId]'). Null if the specified view type is
135
+ * not configured.
136
+ */
137
+ skills_path: string | null;
138
+
119
139
  /**
120
140
  * Aggregate usage statistics for this app, including daily, weekly, and monthly
121
141
  * active user counts.
@@ -345,7 +365,7 @@ export type AppStatuses = 'live' | 'unlisted' | 'hidden';
345
365
  /**
346
366
  * The different types of an app view
347
367
  */
348
- export type AppViewType = 'hub' | 'discover' | 'dash' | 'dashboard' | 'analytics';
368
+ export type AppViewType = 'hub' | 'discover' | 'dash' | 'dashboard' | 'analytics' | 'skills' | 'openapi';
349
369
 
350
370
  /**
351
371
  * Possible roles an authorized user can have
@@ -596,6 +616,12 @@ export interface Company {
596
616
  */
597
617
  id: string;
598
618
 
619
+ /**
620
+ * Guidelines and instructions provided to affiliates explaining how to promote
621
+ * this company's products.
622
+ */
623
+ affiliate_instructions: string | null;
624
+
599
625
  /**
600
626
  * The datetime the company was created.
601
627
  */
@@ -607,6 +633,12 @@ export interface Company {
607
633
  */
608
634
  description: string | null;
609
635
 
636
+ /**
637
+ * The product featured for affiliates to promote on this company's affiliate page.
638
+ * Null if none is configured.
639
+ */
640
+ featured_affiliate_product: Company.FeaturedAffiliateProduct | null;
641
+
610
642
  /**
611
643
  * The company's logo.
612
644
  */
@@ -652,6 +684,11 @@ export interface Company {
652
684
  */
653
685
  social_links: Array<Company.SocialLink>;
654
686
 
687
+ /**
688
+ * The target audience for the company. Null if not set.
689
+ */
690
+ target_audience: string | null;
691
+
655
692
  /**
656
693
  * The display name of the company shown to customers.
657
694
  */
@@ -669,6 +706,22 @@ export interface Company {
669
706
  }
670
707
 
671
708
  export namespace Company {
709
+ /**
710
+ * The product featured for affiliates to promote on this company's affiliate page.
711
+ * Null if none is configured.
712
+ */
713
+ export interface FeaturedAffiliateProduct {
714
+ /**
715
+ * The unique identifier for the product.
716
+ */
717
+ id: string;
718
+
719
+ /**
720
+ * The display name of the product shown to customers. Maximum 50 characters.
721
+ */
722
+ name: string;
723
+ }
724
+
672
725
  /**
673
726
  * The company's logo.
674
727
  */
@@ -1753,7 +1806,7 @@ export namespace InvoiceListItem {
1753
1806
  /**
1754
1807
  * The different statuses an invoice can be in
1755
1808
  */
1756
- export type InvoiceStatus = 'draft' | 'open' | 'paid' | 'past_due' | 'void';
1809
+ export type InvoiceStatus = 'draft' | 'open' | 'paid' | 'past_due' | 'uncollectible' | 'void';
1757
1810
 
1758
1811
  /**
1759
1812
  * The different most recent actions a member can have.
@@ -1862,7 +1915,7 @@ export interface Membership {
1862
1915
  * Custom key-value pairs for the membership (commonly used for software licensing,
1863
1916
  * e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value.
1864
1917
  */
1865
- metadata: { [key: string]: unknown };
1918
+ metadata: { [key: string]: unknown } | null;
1866
1919
 
1867
1920
  /**
1868
1921
  * Whether recurring payment collection for this membership is temporarily paused
@@ -2452,6 +2505,11 @@ export interface Payment {
2452
2505
  */
2453
2506
  total: number | null;
2454
2507
 
2508
+ /**
2509
+ * The datetime the payment was last updated.
2510
+ */
2511
+ updated_at: string;
2512
+
2455
2513
  /**
2456
2514
  * The total in USD to show to the creator (excluding buyer fees).
2457
2515
  */
@@ -2647,7 +2705,8 @@ export namespace Payment {
2647
2705
  | 'won'
2648
2706
  | 'rejected'
2649
2707
  | 'lost'
2650
- | 'prevented';
2708
+ | 'prevented'
2709
+ | 'canceled';
2651
2710
 
2652
2711
  /**
2653
2712
  * The type of the payment transaction.
@@ -2657,9 +2716,10 @@ export namespace Payment {
2657
2716
  | 'authorize'
2658
2717
  | 'capture'
2659
2718
  | 'refund'
2660
- | 'cancel'
2719
+ | 'canceled'
2661
2720
  | 'verify'
2662
2721
  | 'chargeback'
2722
+ | 'pre_chargeback'
2663
2723
  | 'three_d_secure'
2664
2724
  | 'fraud_screening'
2665
2725
  | 'authorization'