@whop/sdk 0.0.6 → 0.0.8

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 (119) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/client.d.mts +19 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +19 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/access-tokens.d.mts +48 -26
  12. package/resources/access-tokens.d.mts.map +1 -1
  13. package/resources/access-tokens.d.ts +48 -26
  14. package/resources/access-tokens.d.ts.map +1 -1
  15. package/resources/access-tokens.js +5 -5
  16. package/resources/access-tokens.mjs +5 -5
  17. package/resources/apps.d.mts +17 -1
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +17 -1
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +169 -12
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +169 -12
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +1 -0
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +1 -0
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/course-lessons.d.mts +199 -1
  30. package/resources/course-lessons.d.mts.map +1 -1
  31. package/resources/course-lessons.d.ts +199 -1
  32. package/resources/course-lessons.d.ts.map +1 -1
  33. package/resources/course-lessons.js +40 -0
  34. package/resources/course-lessons.js.map +1 -1
  35. package/resources/course-lessons.mjs +40 -0
  36. package/resources/course-lessons.mjs.map +1 -1
  37. package/resources/courses.d.mts +8 -0
  38. package/resources/courses.d.mts.map +1 -1
  39. package/resources/courses.d.ts +8 -0
  40. package/resources/courses.d.ts.map +1 -1
  41. package/resources/disputes.d.mts +704 -0
  42. package/resources/disputes.d.mts.map +1 -0
  43. package/resources/disputes.d.ts +704 -0
  44. package/resources/disputes.d.ts.map +1 -0
  45. package/resources/disputes.js +77 -0
  46. package/resources/disputes.js.map +1 -0
  47. package/resources/disputes.mjs +73 -0
  48. package/resources/disputes.mjs.map +1 -0
  49. package/resources/forum-posts.d.mts +13 -1
  50. package/resources/forum-posts.d.mts.map +1 -1
  51. package/resources/forum-posts.d.ts +13 -1
  52. package/resources/forum-posts.d.ts.map +1 -1
  53. package/resources/index.d.mts +8 -5
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +8 -5
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +7 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +3 -0
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/ledger-accounts.d.mts +1 -1
  62. package/resources/ledger-accounts.d.mts.map +1 -1
  63. package/resources/ledger-accounts.d.ts +1 -1
  64. package/resources/ledger-accounts.d.ts.map +1 -1
  65. package/resources/payments.d.mts +1 -1
  66. package/resources/payments.d.mts.map +1 -1
  67. package/resources/payments.d.ts +1 -1
  68. package/resources/payments.d.ts.map +1 -1
  69. package/resources/refunds.d.mts +295 -0
  70. package/resources/refunds.d.mts.map +1 -0
  71. package/resources/refunds.d.ts +295 -0
  72. package/resources/refunds.d.ts.map +1 -0
  73. package/resources/refunds.js +34 -0
  74. package/resources/refunds.js.map +1 -0
  75. package/resources/refunds.mjs +30 -0
  76. package/resources/refunds.mjs.map +1 -0
  77. package/resources/shared.d.mts +46 -5
  78. package/resources/shared.d.mts.map +1 -1
  79. package/resources/shared.d.ts +46 -5
  80. package/resources/shared.d.ts.map +1 -1
  81. package/resources/shipments.d.mts +1 -1
  82. package/resources/shipments.d.mts.map +1 -1
  83. package/resources/shipments.d.ts +1 -1
  84. package/resources/shipments.d.ts.map +1 -1
  85. package/resources/webhooks.d.mts +427 -2
  86. package/resources/webhooks.d.mts.map +1 -1
  87. package/resources/webhooks.d.ts +427 -2
  88. package/resources/webhooks.d.ts.map +1 -1
  89. package/resources/webhooks.js.map +1 -1
  90. package/resources/webhooks.mjs.map +1 -1
  91. package/resources/withdrawals.d.mts +233 -0
  92. package/resources/withdrawals.d.mts.map +1 -0
  93. package/resources/withdrawals.d.ts +233 -0
  94. package/resources/withdrawals.d.ts.map +1 -0
  95. package/resources/withdrawals.js +31 -0
  96. package/resources/withdrawals.js.map +1 -0
  97. package/resources/withdrawals.mjs +27 -0
  98. package/resources/withdrawals.mjs.map +1 -0
  99. package/src/client.ts +93 -0
  100. package/src/resources/access-tokens.ts +53 -26
  101. package/src/resources/apps.ts +21 -0
  102. package/src/resources/checkout-configurations.ts +193 -12
  103. package/src/resources/course-lessons.ts +250 -0
  104. package/src/resources/courses.ts +10 -0
  105. package/src/resources/disputes.ts +873 -0
  106. package/src/resources/forum-posts.ts +16 -0
  107. package/src/resources/index.ts +42 -0
  108. package/src/resources/ledger-accounts.ts +1 -0
  109. package/src/resources/payments.ts +1 -0
  110. package/src/resources/refunds.ts +383 -0
  111. package/src/resources/shared.ts +62 -5
  112. package/src/resources/shipments.ts +1 -1
  113. package/src/resources/webhooks.ts +522 -1
  114. package/src/resources/withdrawals.ts +361 -0
  115. package/src/version.ts +1 -1
  116. package/version.d.mts +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
  119. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -32,6 +32,7 @@ import {
32
32
  AppListParams,
33
33
  AppListResponse,
34
34
  AppListResponsesCursorPage,
35
+ AppType,
35
36
  AppUpdateParams,
36
37
  Apps,
37
38
  } from './resources/apps';
@@ -55,6 +56,7 @@ import {
55
56
  CheckoutConfigurationListResponse,
56
57
  CheckoutConfigurationListResponsesCursorPage,
57
58
  CheckoutConfigurations,
59
+ CheckoutModes,
58
60
  } from './resources/checkout-configurations';
59
61
  import {
60
62
  Companies,
@@ -84,6 +86,10 @@ import {
84
86
  CourseLessonListParams,
85
87
  CourseLessonListResponse,
86
88
  CourseLessonListResponsesCursorPage,
89
+ CourseLessonMarkAsCompletedResponse,
90
+ CourseLessonStartResponse,
91
+ CourseLessonSubmitAssessmentParams,
92
+ CourseLessonSubmitAssessmentResponse,
87
93
  CourseLessonUpdateParams,
88
94
  CourseLessons,
89
95
  EmbedType,
@@ -110,6 +116,15 @@ import {
110
116
  Courses,
111
117
  Languages,
112
118
  } from './resources/courses';
119
+ import {
120
+ Dispute,
121
+ DisputeListParams,
122
+ DisputeListResponse,
123
+ DisputeListResponsesCursorPage,
124
+ DisputeStatuses,
125
+ DisputeUpdateEvidenceParams,
126
+ Disputes,
127
+ } from './resources/disputes';
113
128
  import {
114
129
  Entries,
115
130
  EntryApproveResponse,
@@ -135,6 +150,7 @@ import {
135
150
  ForumPostListResponse,
136
151
  ForumPostListResponsesCursorPage,
137
152
  ForumPostUpdateParams,
153
+ ForumPostVisibilityType,
138
154
  ForumPosts,
139
155
  } from './resources/forum-posts';
140
156
  import {
@@ -219,6 +235,17 @@ import {
219
235
  ReactionListResponsesCursorPage,
220
236
  Reactions,
221
237
  } from './resources/reactions';
238
+ import {
239
+ PaymentProvider,
240
+ RefundListParams,
241
+ RefundListResponse,
242
+ RefundListResponsesCursorPage,
243
+ RefundReferenceStatus,
244
+ RefundReferenceType,
245
+ RefundRetrieveResponse,
246
+ RefundStatus,
247
+ Refunds,
248
+ } from './resources/refunds';
222
249
  import {
223
250
  ReviewListParams,
224
251
  ReviewListResponse,
@@ -256,6 +283,8 @@ import {
256
283
  } from './resources/users';
257
284
  import {
258
285
  CourseLessonInteractionCompletedWebhookEvent,
286
+ DisputeCreatedWebhookEvent,
287
+ DisputeUpdatedWebhookEvent,
259
288
  EntryApprovedWebhookEvent,
260
289
  EntryCreatedWebhookEvent,
261
290
  EntryDeletedWebhookEvent,
@@ -269,9 +298,22 @@ import {
269
298
  PaymentFailedWebhookEvent,
270
299
  PaymentPendingWebhookEvent,
271
300
  PaymentSucceededWebhookEvent,
301
+ RefundCreatedWebhookEvent,
302
+ RefundUpdatedWebhookEvent,
272
303
  UnwrapWebhookEvent,
273
304
  Webhooks,
274
305
  } from './resources/webhooks';
306
+ import {
307
+ WithdrawalFeeTypes,
308
+ WithdrawalListParams,
309
+ WithdrawalListResponse,
310
+ WithdrawalListResponsesCursorPage,
311
+ WithdrawalRetrieveResponse,
312
+ WithdrawalSpeeds,
313
+ WithdrawalStatus,
314
+ WithdrawalTypes,
315
+ Withdrawals,
316
+ } from './resources/withdrawals';
275
317
  import { type Fetch } from './internal/builtin-types';
276
318
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
277
319
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -1031,6 +1073,9 @@ export class Whop {
1031
1073
  courseStudents: API.CourseStudents = new API.CourseStudents(this);
1032
1074
  accessTokens: API.AccessTokens = new API.AccessTokens(this);
1033
1075
  notifications: API.Notifications = new API.Notifications(this);
1076
+ disputes: API.Disputes = new API.Disputes(this);
1077
+ refunds: API.Refunds = new API.Refunds(this);
1078
+ withdrawals: API.Withdrawals = new API.Withdrawals(this);
1034
1079
  }
1035
1080
 
1036
1081
  Whop.Apps = Apps;
@@ -1066,6 +1111,9 @@ Whop.Reviews = Reviews;
1066
1111
  Whop.CourseStudents = CourseStudents;
1067
1112
  Whop.AccessTokens = AccessTokens;
1068
1113
  Whop.Notifications = Notifications;
1114
+ Whop.Disputes = Disputes;
1115
+ Whop.Refunds = Refunds;
1116
+ Whop.Withdrawals = Withdrawals;
1069
1117
 
1070
1118
  export declare namespace Whop {
1071
1119
  export type RequestOptions = Opts.RequestOptions;
@@ -1075,6 +1123,7 @@ export declare namespace Whop {
1075
1123
 
1076
1124
  export {
1077
1125
  Apps as Apps,
1126
+ type AppType as AppType,
1078
1127
  type AppListResponse as AppListResponse,
1079
1128
  type AppListResponsesCursorPage as AppListResponsesCursorPage,
1080
1129
  type AppCreateParams as AppCreateParams,
@@ -1126,6 +1175,10 @@ export declare namespace Whop {
1126
1175
  type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent,
1127
1176
  type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent,
1128
1177
  type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent,
1178
+ type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent,
1179
+ type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent,
1180
+ type RefundCreatedWebhookEvent as RefundCreatedWebhookEvent,
1181
+ type RefundUpdatedWebhookEvent as RefundUpdatedWebhookEvent,
1129
1182
  type UnwrapWebhookEvent as UnwrapWebhookEvent,
1130
1183
  };
1131
1184
 
@@ -1149,6 +1202,7 @@ export declare namespace Whop {
1149
1202
 
1150
1203
  export {
1151
1204
  ForumPosts as ForumPosts,
1205
+ type ForumPostVisibilityType as ForumPostVisibilityType,
1152
1206
  type ForumPostListResponse as ForumPostListResponse,
1153
1207
  type ForumPostListResponsesCursorPage as ForumPostListResponsesCursorPage,
1154
1208
  type ForumPostCreateParams as ForumPostCreateParams,
@@ -1205,6 +1259,7 @@ export declare namespace Whop {
1205
1259
 
1206
1260
  export {
1207
1261
  CheckoutConfigurations as CheckoutConfigurations,
1262
+ type CheckoutModes as CheckoutModes,
1208
1263
  type CheckoutConfigurationListResponse as CheckoutConfigurationListResponse,
1209
1264
  type CheckoutConfigurationListResponsesCursorPage as CheckoutConfigurationListResponsesCursorPage,
1210
1265
  type CheckoutConfigurationCreateParams as CheckoutConfigurationCreateParams,
@@ -1336,10 +1391,14 @@ export declare namespace Whop {
1336
1391
  type LessonVisibilities as LessonVisibilities,
1337
1392
  type CourseLessonListResponse as CourseLessonListResponse,
1338
1393
  type CourseLessonDeleteResponse as CourseLessonDeleteResponse,
1394
+ type CourseLessonMarkAsCompletedResponse as CourseLessonMarkAsCompletedResponse,
1395
+ type CourseLessonStartResponse as CourseLessonStartResponse,
1396
+ type CourseLessonSubmitAssessmentResponse as CourseLessonSubmitAssessmentResponse,
1339
1397
  type CourseLessonListResponsesCursorPage as CourseLessonListResponsesCursorPage,
1340
1398
  type CourseLessonCreateParams as CourseLessonCreateParams,
1341
1399
  type CourseLessonUpdateParams as CourseLessonUpdateParams,
1342
1400
  type CourseLessonListParams as CourseLessonListParams,
1401
+ type CourseLessonSubmitAssessmentParams as CourseLessonSubmitAssessmentParams,
1343
1402
  };
1344
1403
 
1345
1404
  export {
@@ -1371,6 +1430,40 @@ export declare namespace Whop {
1371
1430
  type NotificationCreateParams as NotificationCreateParams,
1372
1431
  };
1373
1432
 
1433
+ export {
1434
+ Disputes as Disputes,
1435
+ type Dispute as Dispute,
1436
+ type DisputeStatuses as DisputeStatuses,
1437
+ type DisputeListResponse as DisputeListResponse,
1438
+ type DisputeListResponsesCursorPage as DisputeListResponsesCursorPage,
1439
+ type DisputeListParams as DisputeListParams,
1440
+ type DisputeUpdateEvidenceParams as DisputeUpdateEvidenceParams,
1441
+ };
1442
+
1443
+ export {
1444
+ Refunds as Refunds,
1445
+ type PaymentProvider as PaymentProvider,
1446
+ type RefundReferenceStatus as RefundReferenceStatus,
1447
+ type RefundReferenceType as RefundReferenceType,
1448
+ type RefundStatus as RefundStatus,
1449
+ type RefundRetrieveResponse as RefundRetrieveResponse,
1450
+ type RefundListResponse as RefundListResponse,
1451
+ type RefundListResponsesCursorPage as RefundListResponsesCursorPage,
1452
+ type RefundListParams as RefundListParams,
1453
+ };
1454
+
1455
+ export {
1456
+ Withdrawals as Withdrawals,
1457
+ type WithdrawalFeeTypes as WithdrawalFeeTypes,
1458
+ type WithdrawalSpeeds as WithdrawalSpeeds,
1459
+ type WithdrawalStatus as WithdrawalStatus,
1460
+ type WithdrawalTypes as WithdrawalTypes,
1461
+ type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
1462
+ type WithdrawalListResponse as WithdrawalListResponse,
1463
+ type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
1464
+ type WithdrawalListParams as WithdrawalListParams,
1465
+ };
1466
+
1374
1467
  export type AccessLevel = API.AccessLevel;
1375
1468
  export type AccessPassType = API.AccessPassType;
1376
1469
  export type App = API.App;
@@ -6,15 +6,15 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class AccessTokens extends APIResource {
8
8
  /**
9
- * Creates an access token for a user to access a specific resource. These access
10
- * tokens are designed to be used with Whop's embedded components.
9
+ * Create a short-lived access token to authenticate API requests on behalf of a
10
+ * Company or User. This token should be used with Whop's web and mobile embedded
11
+ * components. You must provide either a company_id or a user_id argument, but not
12
+ * both.
11
13
  *
12
14
  * @example
13
15
  * ```ts
14
16
  * const accessToken = await client.accessTokens.create({
15
- * scoped_actions: ['string'],
16
- * target_resource_id: 'target_resource_id',
17
- * target_resource_type: 'company',
17
+ * company_id: 'biz_xxxxxxxxxxxxxx',
18
18
  * });
19
19
  * ```
20
20
  */
@@ -38,30 +38,57 @@ export interface AccessTokenCreateResponse {
38
38
  expires_at: string;
39
39
  }
40
40
 
41
- export interface AccessTokenCreateParams {
42
- /**
43
- * Array of desired scoped actions for the access token. This list must be a subset
44
- * of the API keys's existing permissions. Otherwise, an error will be raised.
45
- */
46
- scoped_actions: Array<string>;
41
+ export type AccessTokenCreateParams =
42
+ | AccessTokenCreateParams.CreateAccessTokenInputWithCompanyID
43
+ | AccessTokenCreateParams.CreateAccessTokenInputWithUserID;
47
44
 
48
- /**
49
- * The ID of the target resource (Company, User, etc.) for which the access token
50
- * is being created.
51
- */
52
- target_resource_id: string;
45
+ export declare namespace AccessTokenCreateParams {
46
+ export interface CreateAccessTokenInputWithCompanyID {
47
+ /**
48
+ * The ID of the Company to generate the token for. The API key must have
49
+ * permission to access this Company, such as the being the company the API key
50
+ * belongs to or a sub-merchant of it
51
+ */
52
+ company_id: string;
53
53
 
54
- /**
55
- * The type of the target resource (company, user, product, experience, etc.).
56
- */
57
- target_resource_type: 'company' | 'product' | 'experience' | 'app' | 'user';
54
+ /**
55
+ * The expiration timestamp for the access token. If not provided, a default
56
+ * expiration time of 1 hour will be used. The expiration can be set to a maximum
57
+ * of 3 hours from the current time.
58
+ */
59
+ expires_at?: string | null;
58
60
 
59
- /**
60
- * The expiration timestamp for the access token. If not provided, a default
61
- * expiration time of 1 hour will be used. The expiration can be set to a maximum
62
- * of 3 hours from the current time.
63
- */
64
- expires_at?: string | null;
61
+ /**
62
+ * Array of desired scoped actions for the access token. If sent as an empty array
63
+ * or not provided, all permissions from the API key making the request will be
64
+ * available on the token. If sending an explicit list, they must be a subset of
65
+ * the API keys's existing permissions. Otherwise, an error will be raised.
66
+ */
67
+ scoped_actions?: Array<string> | null;
68
+ }
69
+
70
+ export interface CreateAccessTokenInputWithUserID {
71
+ /**
72
+ * The ID of the User to generate the token for. The API key must have permission
73
+ * to access this User.
74
+ */
75
+ user_id: string;
76
+
77
+ /**
78
+ * The expiration timestamp for the access token. If not provided, a default
79
+ * expiration time of 1 hour will be used. The expiration can be set to a maximum
80
+ * of 3 hours from the current time.
81
+ */
82
+ expires_at?: string | null;
83
+
84
+ /**
85
+ * Array of desired scoped actions for the access token. If sent as an empty array
86
+ * or not provided, all permissions from the API key making the request will be
87
+ * available on the token. If sending an explicit list, they must be a subset of
88
+ * the API keys's existing permissions. Otherwise, an error will be raised.
89
+ */
90
+ scoped_actions?: Array<string> | null;
91
+ }
65
92
  }
66
93
 
67
94
  export declare namespace AccessTokens {
@@ -88,6 +88,11 @@ export class Apps extends APIResource {
88
88
 
89
89
  export type AppListResponsesCursorPage = CursorPage<AppListResponse>;
90
90
 
91
+ /**
92
+ * The type of end-user an app is built for
93
+ */
94
+ export type AppType = 'b2b_app' | 'b2c_app' | 'company_app' | 'component';
95
+
91
96
  /**
92
97
  * An object representing an app
93
98
  */
@@ -97,6 +102,11 @@ export interface AppListResponse {
97
102
  */
98
103
  id: string;
99
104
 
105
+ /**
106
+ * The type of end-user an app is built for
107
+ */
108
+ app_type: AppType;
109
+
100
110
  /**
101
111
  * The base url of the app
102
112
  */
@@ -241,6 +251,11 @@ export interface AppUpdateParams {
241
251
  */
242
252
  app_store_description?: string | null;
243
253
 
254
+ /**
255
+ * The type of end-user an app is built for
256
+ */
257
+ app_type?: AppType | null;
258
+
244
259
  /**
245
260
  * The base production url of the app
246
261
  */
@@ -314,6 +329,11 @@ export namespace AppUpdateParams {
314
329
  }
315
330
 
316
331
  export interface AppListParams extends CursorPageParams {
332
+ /**
333
+ * The type of end-user an app is built for
334
+ */
335
+ app_type?: AppType | null;
336
+
317
337
  /**
318
338
  * Returns the elements in the list that come before the specified cursor.
319
339
  */
@@ -369,6 +389,7 @@ export interface AppListParams extends CursorPageParams {
369
389
 
370
390
  export declare namespace Apps {
371
391
  export {
392
+ type AppType as AppType,
372
393
  type AppListResponse as AppListResponse,
373
394
  type AppListResponsesCursorPage as AppListResponsesCursorPage,
374
395
  type AppCreateParams as AppCreateParams,
@@ -18,6 +18,7 @@ export class CheckoutConfigurations extends APIResource {
18
18
  * - `plan:create`
19
19
  * - `access_pass:create`
20
20
  * - `access_pass:update`
21
+ * - `checkout_configuration:basic:read`
21
22
  *
22
23
  * @example
23
24
  * ```ts
@@ -66,6 +67,11 @@ export class CheckoutConfigurations extends APIResource {
66
67
 
67
68
  export type CheckoutConfigurationListResponsesCursorPage = CursorPage<CheckoutConfigurationListResponse>;
68
69
 
70
+ /**
71
+ * The different modes a checkout can be set to.
72
+ */
73
+ export type CheckoutModes = 'payment' | 'setup';
74
+
69
75
  /**
70
76
  * A checkout configuration object.
71
77
  * Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
@@ -91,12 +97,24 @@ export interface CheckoutConfigurationListResponse {
91
97
  /**
92
98
  * The metadata to use for the checkout configuration
93
99
  */
94
- metadata: { [key: string]: unknown };
100
+ metadata: { [key: string]: unknown } | null;
101
+
102
+ /**
103
+ * The mode of the checkout session.
104
+ */
105
+ mode: CheckoutModes;
106
+
107
+ /**
108
+ * The explicit payment method configuration for the session, if any. This
109
+ * currently only works in 'setup' mode. Use the plan's
110
+ * payment_method_configuration for payment method.
111
+ */
112
+ payment_method_configuration: CheckoutConfigurationListResponse.PaymentMethodConfiguration | null;
95
113
 
96
114
  /**
97
115
  * The plan to use for the checkout configuration
98
116
  */
99
- plan: CheckoutConfigurationListResponse.Plan;
117
+ plan: CheckoutConfigurationListResponse.Plan | null;
100
118
 
101
119
  /**
102
120
  * A URL you can send to customers to complete a checkout. It looks like
@@ -111,6 +129,34 @@ export interface CheckoutConfigurationListResponse {
111
129
  }
112
130
 
113
131
  export namespace CheckoutConfigurationListResponse {
132
+ /**
133
+ * The explicit payment method configuration for the session, if any. This
134
+ * currently only works in 'setup' mode. Use the plan's
135
+ * payment_method_configuration for payment method.
136
+ */
137
+ export interface PaymentMethodConfiguration {
138
+ /**
139
+ * An array of payment method identifiers that are explicitly disabled. Only
140
+ * applies if the include_platform_defaults is true.
141
+ */
142
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
143
+
144
+ /**
145
+ * An array of payment method identifiers that are explicitly enabled. This means
146
+ * these payment methods will be shown on checkout. Example use case is to only
147
+ * enable a specific payment method like cashapp, or extending the platform
148
+ * defaults with additional methods.
149
+ */
150
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
151
+
152
+ /**
153
+ * Whether Whop's platform default payment method enablement settings are included
154
+ * in this configuration. The full list of default payment methods can be found in
155
+ * the documentation at docs.whop.com/payments.
156
+ */
157
+ include_platform_defaults: boolean;
158
+ }
159
+
114
160
  /**
115
161
  * The plan to use for the checkout configuration
116
162
  */
@@ -168,15 +214,16 @@ export namespace CheckoutConfigurationListResponse {
168
214
  }
169
215
 
170
216
  export type CheckoutConfigurationCreateParams =
171
- | CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlan
172
- | CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlanID;
217
+ | CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModePaymentWithPlan
218
+ | CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModePaymentWithPlanID
219
+ | CheckoutConfigurationCreateParams.CreateCheckoutSessionInputModeSetup;
173
220
 
174
221
  export declare namespace CheckoutConfigurationCreateParams {
175
- export interface CreateCheckoutSessionInputWithPlan {
222
+ export interface CreateCheckoutSessionInputModePaymentWithPlan {
176
223
  /**
177
224
  * Pass this object to create a new plan for this checkout configuration
178
225
  */
179
- plan: CreateCheckoutSessionInputWithPlan.Plan;
226
+ plan: CreateCheckoutSessionInputModePaymentWithPlan.Plan;
180
227
 
181
228
  /**
182
229
  * The affiliate code to use for the checkout configuration
@@ -188,13 +235,22 @@ export declare namespace CheckoutConfigurationCreateParams {
188
235
  */
189
236
  metadata?: { [key: string]: unknown } | null;
190
237
 
238
+ mode?: 'payment';
239
+
240
+ /**
241
+ * This currently only works for configurations made in 'setup' mode. The explicit
242
+ * payment method configuration for the checkout session. If not provided, the
243
+ * platform or company's defaults will apply.
244
+ */
245
+ payment_method_configuration?: CreateCheckoutSessionInputModePaymentWithPlan.PaymentMethodConfiguration | null;
246
+
191
247
  /**
192
248
  * The URL to redirect the user to after the checkout configuration is created
193
249
  */
194
250
  redirect_url?: string | null;
195
251
  }
196
252
 
197
- export namespace CreateCheckoutSessionInputWithPlan {
253
+ export namespace CreateCheckoutSessionInputModePaymentWithPlan {
198
254
  /**
199
255
  * Pass this object to create a new plan for this checkout configuration
200
256
  */
@@ -205,14 +261,14 @@ export declare namespace CheckoutConfigurationCreateParams {
205
261
  company_id: string;
206
262
 
207
263
  /**
208
- * The interval at which the plan charges (renewal plans).
264
+ * The respective currency identifier for the plan.
209
265
  */
210
- billing_period?: number | null;
266
+ currency: Shared.Currency;
211
267
 
212
268
  /**
213
- * The available currencies on the platform
269
+ * The interval at which the plan charges (renewal plans).
214
270
  */
215
- currency?: Shared.Currency | null;
271
+ billing_period?: number | null;
216
272
 
217
273
  /**
218
274
  * An array of custom field objects.
@@ -468,9 +524,37 @@ export declare namespace CheckoutConfigurationCreateParams {
468
524
  visibility?: Shared.Visibility | null;
469
525
  }
470
526
  }
527
+
528
+ /**
529
+ * This currently only works for configurations made in 'setup' mode. The explicit
530
+ * payment method configuration for the checkout session. If not provided, the
531
+ * platform or company's defaults will apply.
532
+ */
533
+ export interface PaymentMethodConfiguration {
534
+ /**
535
+ * An array of payment method identifiers that are explicitly disabled. Only
536
+ * applies if the include_platform_defaults is true.
537
+ */
538
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
539
+
540
+ /**
541
+ * An array of payment method identifiers that are explicitly enabled. This means
542
+ * these payment methods will be shown on checkout. Example use case is to only
543
+ * enable a specific payment method like cashapp, or extending the platform
544
+ * defaults with additional methods.
545
+ */
546
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
547
+
548
+ /**
549
+ * Whether Whop's platform default payment method enablement settings are included
550
+ * in this configuration. The full list of default payment methods can be found in
551
+ * the documentation at docs.whop.com/payments.
552
+ */
553
+ include_platform_defaults: boolean;
554
+ }
471
555
  }
472
556
 
473
- export interface CreateCheckoutSessionInputWithPlanID {
557
+ export interface CreateCheckoutSessionInputModePaymentWithPlanID {
474
558
  /**
475
559
  * The ID of the plan to use for the checkout configuration
476
560
  */
@@ -486,11 +570,107 @@ export declare namespace CheckoutConfigurationCreateParams {
486
570
  */
487
571
  metadata?: { [key: string]: unknown } | null;
488
572
 
573
+ mode?: 'payment';
574
+
575
+ /**
576
+ * This currently only works for configurations made in 'setup' mode. The explicit
577
+ * payment method configuration for the checkout session. If not provided, the
578
+ * platform or company's defaults will apply.
579
+ */
580
+ payment_method_configuration?: CreateCheckoutSessionInputModePaymentWithPlanID.PaymentMethodConfiguration | null;
581
+
582
+ /**
583
+ * The URL to redirect the user to after the checkout configuration is created
584
+ */
585
+ redirect_url?: string | null;
586
+ }
587
+
588
+ export namespace CreateCheckoutSessionInputModePaymentWithPlanID {
589
+ /**
590
+ * This currently only works for configurations made in 'setup' mode. The explicit
591
+ * payment method configuration for the checkout session. If not provided, the
592
+ * platform or company's defaults will apply.
593
+ */
594
+ export interface PaymentMethodConfiguration {
595
+ /**
596
+ * An array of payment method identifiers that are explicitly disabled. Only
597
+ * applies if the include_platform_defaults is true.
598
+ */
599
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
600
+
601
+ /**
602
+ * An array of payment method identifiers that are explicitly enabled. This means
603
+ * these payment methods will be shown on checkout. Example use case is to only
604
+ * enable a specific payment method like cashapp, or extending the platform
605
+ * defaults with additional methods.
606
+ */
607
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
608
+
609
+ /**
610
+ * Whether Whop's platform default payment method enablement settings are included
611
+ * in this configuration. The full list of default payment methods can be found in
612
+ * the documentation at docs.whop.com/payments.
613
+ */
614
+ include_platform_defaults: boolean;
615
+ }
616
+ }
617
+
618
+ export interface CreateCheckoutSessionInputModeSetup {
619
+ /**
620
+ * The ID of the company for which to generate the checkout configuration. Only
621
+ * required in setup mode.
622
+ */
623
+ company_id: string;
624
+
625
+ mode: 'setup';
626
+
627
+ /**
628
+ * The metadata to use for the checkout configuration
629
+ */
630
+ metadata?: { [key: string]: unknown } | null;
631
+
632
+ /**
633
+ * This currently only works for configurations made in 'setup' mode. The explicit
634
+ * payment method configuration for the checkout session. If not provided, the
635
+ * platform or company's defaults will apply.
636
+ */
637
+ payment_method_configuration?: CreateCheckoutSessionInputModeSetup.PaymentMethodConfiguration | null;
638
+
489
639
  /**
490
640
  * The URL to redirect the user to after the checkout configuration is created
491
641
  */
492
642
  redirect_url?: string | null;
493
643
  }
644
+
645
+ export namespace CreateCheckoutSessionInputModeSetup {
646
+ /**
647
+ * This currently only works for configurations made in 'setup' mode. The explicit
648
+ * payment method configuration for the checkout session. If not provided, the
649
+ * platform or company's defaults will apply.
650
+ */
651
+ export interface PaymentMethodConfiguration {
652
+ /**
653
+ * An array of payment method identifiers that are explicitly disabled. Only
654
+ * applies if the include_platform_defaults is true.
655
+ */
656
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
657
+
658
+ /**
659
+ * An array of payment method identifiers that are explicitly enabled. This means
660
+ * these payment methods will be shown on checkout. Example use case is to only
661
+ * enable a specific payment method like cashapp, or extending the platform
662
+ * defaults with additional methods.
663
+ */
664
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
665
+
666
+ /**
667
+ * Whether Whop's platform default payment method enablement settings are included
668
+ * in this configuration. The full list of default payment methods can be found in
669
+ * the documentation at docs.whop.com/payments.
670
+ */
671
+ include_platform_defaults: boolean;
672
+ }
673
+ }
494
674
  }
495
675
 
496
676
  export interface CheckoutConfigurationListParams extends CursorPageParams {
@@ -527,6 +707,7 @@ export interface CheckoutConfigurationListParams extends CursorPageParams {
527
707
 
528
708
  export declare namespace CheckoutConfigurations {
529
709
  export {
710
+ type CheckoutModes as CheckoutModes,
530
711
  type CheckoutConfigurationListResponse as CheckoutConfigurationListResponse,
531
712
  type CheckoutConfigurationListResponsesCursorPage as CheckoutConfigurationListResponsesCursorPage,
532
713
  type CheckoutConfigurationCreateParams as CheckoutConfigurationCreateParams,