@whop/sdk 0.0.2 → 0.0.4
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.
- package/CHANGELOG.md +55 -0
- package/client.d.mts +30 -12
- package/client.d.mts.map +1 -1
- package/client.d.ts +30 -12
- package/client.d.ts.map +1 -1
- package/client.js +19 -1
- package/client.js.map +1 -1
- package/client.mjs +21 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app-builds.d.mts +16 -13
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +16 -13
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +1 -1
- package/resources/app-builds.mjs +1 -1
- package/resources/apps.d.mts +15 -10
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +15 -10
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +252 -140
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +252 -140
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +6 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +6 -20
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +157 -0
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +157 -0
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +22 -0
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +22 -0
- package/resources/companies.mjs.map +1 -1
- package/resources/course-chapters.d.mts +185 -0
- package/resources/course-chapters.d.mts.map +1 -0
- package/resources/course-chapters.d.ts +185 -0
- package/resources/course-chapters.d.ts.map +1 -0
- package/resources/course-chapters.js +103 -0
- package/resources/course-chapters.js.map +1 -0
- package/resources/course-chapters.mjs +99 -0
- package/resources/course-chapters.mjs.map +1 -0
- package/resources/course-lesson-interactions.d.mts +2 -2
- package/resources/course-lesson-interactions.d.ts +2 -2
- package/resources/course-lesson-interactions.js +2 -2
- package/resources/course-lesson-interactions.mjs +2 -2
- package/resources/course-lessons.d.mts +563 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +563 -0
- package/resources/course-lessons.d.ts.map +1 -0
- package/resources/course-lessons.js +101 -0
- package/resources/course-lessons.js.map +1 -0
- package/resources/course-lessons.mjs +97 -0
- package/resources/course-lessons.mjs.map +1 -0
- package/resources/course-students.d.mts +187 -0
- package/resources/course-students.d.mts.map +1 -0
- package/resources/course-students.d.ts +187 -0
- package/resources/course-students.d.ts.map +1 -0
- package/resources/course-students.js +36 -0
- package/resources/course-students.js.map +1 -0
- package/resources/course-students.mjs +32 -0
- package/resources/course-students.mjs.map +1 -0
- package/resources/courses.d.mts +485 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +485 -0
- package/resources/courses.d.ts.map +1 -0
- package/resources/courses.js +98 -0
- package/resources/courses.js.map +1 -0
- package/resources/courses.mjs +94 -0
- package/resources/courses.mjs.map +1 -0
- package/resources/experiences.d.mts +42 -11
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +42 -11
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +22 -0
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +22 -0
- package/resources/experiences.mjs.map +1 -1
- package/resources/forum-posts.d.mts +75 -10
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +75 -10
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +11 -0
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +11 -0
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/index.d.mts +12 -6
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +529 -146
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +529 -146
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +2 -24
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +2 -24
- package/resources/invoices.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/members.d.mts +4 -0
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +4 -0
- package/resources/members.d.ts.map +1 -1
- package/resources/memberships.d.mts +26 -5
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +26 -5
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +1 -1
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +1 -1
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +57 -10
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +57 -10
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +6 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +6 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/payments.d.mts +35 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +35 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +161 -17
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +161 -17
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +30 -33
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +30 -33
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +394 -0
- package/resources/promo-codes.d.mts.map +1 -0
- package/resources/promo-codes.d.ts +394 -0
- package/resources/promo-codes.d.ts.map +1 -0
- package/resources/promo-codes.js +91 -0
- package/resources/promo-codes.js.map +1 -0
- package/resources/promo-codes.mjs +87 -0
- package/resources/promo-codes.mjs.map +1 -0
- package/resources/reviews.d.mts +277 -0
- package/resources/reviews.d.mts.map +1 -0
- package/resources/reviews.d.ts +277 -0
- package/resources/reviews.d.ts.map +1 -0
- package/resources/reviews.js +23 -0
- package/resources/reviews.js.map +1 -0
- package/resources/reviews.mjs +19 -0
- package/resources/reviews.mjs.map +1 -0
- package/resources/shared.d.mts +117 -14
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +117 -14
- package/resources/shared.d.ts.map +1 -1
- package/resources/transfers.d.mts +12 -0
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +12 -0
- package/resources/transfers.d.ts.map +1 -1
- package/src/client.ts +166 -11
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +278 -143
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +699 -0
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +622 -0
- package/src/resources/experiences.ts +54 -11
- package/src/resources/forum-posts.ts +95 -10
- package/src/resources/index.ts +73 -2
- package/src/resources/invoices.ts +620 -149
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +5 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +74 -10
- package/src/resources/payments.ts +146 -19
- package/src/resources/plans.ts +184 -17
- package/src/resources/products.ts +36 -37
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +128 -14
- package/src/resources/transfers.ts +10 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as PaymentsAPI from './payments';
|
|
4
5
|
import * as Shared from './shared';
|
|
5
6
|
import { APIPromise } from '../core/api-promise';
|
|
6
7
|
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
@@ -15,15 +16,19 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
15
16
|
*
|
|
16
17
|
* - `checkout_configuration:create`
|
|
17
18
|
* - `plan:create`
|
|
19
|
+
* - `access_pass:create`
|
|
20
|
+
* - `access_pass:update`
|
|
18
21
|
*
|
|
19
22
|
* @example
|
|
20
23
|
* ```ts
|
|
21
24
|
* const checkoutConfiguration =
|
|
22
|
-
* await client.checkoutConfigurations.create(
|
|
25
|
+
* await client.checkoutConfigurations.create({
|
|
26
|
+
* plan_id: 'plan_xxxxxxxxxxxxx',
|
|
27
|
+
* });
|
|
23
28
|
* ```
|
|
24
29
|
*/
|
|
25
30
|
create(
|
|
26
|
-
body: CheckoutConfigurationCreateParams
|
|
31
|
+
body: CheckoutConfigurationCreateParams,
|
|
27
32
|
options?: RequestOptions,
|
|
28
33
|
): APIPromise<Shared.CheckoutConfiguration> {
|
|
29
34
|
return this._client.post('/checkout_configurations', { body, ...options });
|
|
@@ -35,14 +40,6 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
35
40
|
* Required permissions:
|
|
36
41
|
*
|
|
37
42
|
* - `checkout_configuration:basic:read`
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const checkoutConfiguration =
|
|
42
|
-
* await client.checkoutConfigurations.retrieve(
|
|
43
|
-
* 'ch_xxxxxxxxxxxxxxx',
|
|
44
|
-
* );
|
|
45
|
-
* ```
|
|
46
43
|
*/
|
|
47
44
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CheckoutConfiguration> {
|
|
48
45
|
return this._client.get(path`/checkout_configurations/${id}`, options);
|
|
@@ -54,16 +51,6 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
54
51
|
* Required permissions:
|
|
55
52
|
*
|
|
56
53
|
* - `checkout_configuration:basic:read`
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```ts
|
|
60
|
-
* // Automatically fetches more pages as needed.
|
|
61
|
-
* for await (const checkoutConfigurationListResponse of client.checkoutConfigurations.list(
|
|
62
|
-
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
63
|
-
* )) {
|
|
64
|
-
* // ...
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
54
|
*/
|
|
68
55
|
list(
|
|
69
56
|
query: CheckoutConfigurationListParams,
|
|
@@ -112,7 +99,8 @@ export interface CheckoutConfigurationListResponse {
|
|
|
112
99
|
plan: CheckoutConfigurationListResponse.Plan;
|
|
113
100
|
|
|
114
101
|
/**
|
|
115
|
-
*
|
|
102
|
+
* A URL you can send to customers to complete a checkout. It looks like
|
|
103
|
+
* `/checkout/plan_xxxx?session={id}`
|
|
116
104
|
*/
|
|
117
105
|
purchase_url: string;
|
|
118
106
|
|
|
@@ -179,183 +167,330 @@ export namespace CheckoutConfigurationListResponse {
|
|
|
179
167
|
}
|
|
180
168
|
}
|
|
181
169
|
|
|
182
|
-
export
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
*/
|
|
186
|
-
affiliate_code?: string | null;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* The metadata to use for the checkout configuration
|
|
190
|
-
*/
|
|
191
|
-
metadata?: { [key: string]: unknown } | null;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Pass this object to create a new plan for this checkout configuration
|
|
195
|
-
*/
|
|
196
|
-
plan?: CheckoutConfigurationCreateParams.Plan | null;
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* The ID of the plan to use for the checkout configuration
|
|
200
|
-
*/
|
|
201
|
-
plan_id?: string | null;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* The URL to redirect the user to after the checkout configuration is created
|
|
205
|
-
*/
|
|
206
|
-
redirect_url?: string | null;
|
|
207
|
-
}
|
|
170
|
+
export type CheckoutConfigurationCreateParams =
|
|
171
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlan
|
|
172
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlanID;
|
|
208
173
|
|
|
209
|
-
export namespace CheckoutConfigurationCreateParams {
|
|
210
|
-
|
|
211
|
-
* Pass this object to create a new plan for this checkout configuration
|
|
212
|
-
*/
|
|
213
|
-
export interface Plan {
|
|
174
|
+
export declare namespace CheckoutConfigurationCreateParams {
|
|
175
|
+
export interface CreateCheckoutSessionInputWithPlan {
|
|
214
176
|
/**
|
|
215
|
-
*
|
|
177
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
216
178
|
*/
|
|
217
|
-
|
|
179
|
+
plan: CreateCheckoutSessionInputWithPlan.Plan;
|
|
218
180
|
|
|
219
181
|
/**
|
|
220
|
-
* The
|
|
182
|
+
* The affiliate code to use for the checkout configuration
|
|
221
183
|
*/
|
|
222
|
-
|
|
184
|
+
affiliate_code?: string | null;
|
|
223
185
|
|
|
224
186
|
/**
|
|
225
|
-
* The
|
|
187
|
+
* The metadata to use for the checkout configuration
|
|
226
188
|
*/
|
|
227
|
-
|
|
189
|
+
metadata?: { [key: string]: unknown } | null;
|
|
228
190
|
|
|
229
191
|
/**
|
|
230
|
-
*
|
|
192
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
231
193
|
*/
|
|
232
|
-
|
|
194
|
+
redirect_url?: string | null;
|
|
195
|
+
}
|
|
233
196
|
|
|
197
|
+
export namespace CreateCheckoutSessionInputWithPlan {
|
|
234
198
|
/**
|
|
235
|
-
*
|
|
199
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
236
200
|
*/
|
|
237
|
-
|
|
201
|
+
export interface Plan {
|
|
202
|
+
/**
|
|
203
|
+
* The company the plan should be created for.
|
|
204
|
+
*/
|
|
205
|
+
company_id: string;
|
|
238
206
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
207
|
+
/**
|
|
208
|
+
* The interval at which the plan charges (renewal plans).
|
|
209
|
+
*/
|
|
210
|
+
billing_period?: number | null;
|
|
243
211
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
force_create_new_plan?: boolean | null;
|
|
212
|
+
/**
|
|
213
|
+
* The available currencies on the platform
|
|
214
|
+
*/
|
|
215
|
+
currency?: Shared.Currency | null;
|
|
249
216
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
217
|
+
/**
|
|
218
|
+
* An array of custom field objects.
|
|
219
|
+
*/
|
|
220
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
254
221
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
222
|
+
/**
|
|
223
|
+
* The description of the plan.
|
|
224
|
+
*/
|
|
225
|
+
description?: string | null;
|
|
259
226
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The interval at which the plan charges (expiration plans).
|
|
229
|
+
*/
|
|
230
|
+
expiration_days?: number | null;
|
|
264
231
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Whether to force the creation of a new plan even if one with the same attributes
|
|
234
|
+
* already exists.
|
|
235
|
+
*/
|
|
236
|
+
force_create_new_plan?: boolean | null;
|
|
270
237
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
238
|
+
/**
|
|
239
|
+
* An image for the plan. This will be visible on the product page to customers.
|
|
240
|
+
*/
|
|
241
|
+
image?: Plan.AttachmentInputWithDirectUploadID | Plan.AttachmentInputWithID | null;
|
|
275
242
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
243
|
+
/**
|
|
244
|
+
* An additional amount charged upon first purchase.
|
|
245
|
+
*/
|
|
246
|
+
initial_price?: number | null;
|
|
280
247
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
248
|
+
/**
|
|
249
|
+
* A personal description or notes section for the business.
|
|
250
|
+
*/
|
|
251
|
+
internal_notes?: string | null;
|
|
285
252
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Whether or not the tax is included in a plan's price (or if it hasn't been set
|
|
255
|
+
* up)
|
|
256
|
+
*/
|
|
257
|
+
override_tax_type?: Shared.TaxType | null;
|
|
290
258
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
259
|
+
/**
|
|
260
|
+
* The explicit payment method configuration for the plan. If not provided, the
|
|
261
|
+
* platform or company's defaults will apply.
|
|
262
|
+
*/
|
|
263
|
+
payment_method_configuration?: Plan.PaymentMethodConfiguration | null;
|
|
295
264
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
265
|
+
/**
|
|
266
|
+
* The type of plan that can be attached to an access pass
|
|
267
|
+
*/
|
|
268
|
+
plan_type?: Shared.PlanType | null;
|
|
300
269
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
270
|
+
/**
|
|
271
|
+
* Pass this object to create a new product for this plan. We will use the product
|
|
272
|
+
* external identifier to find or create an existing product.
|
|
273
|
+
*/
|
|
274
|
+
product?: Plan.Product | null;
|
|
306
275
|
|
|
307
|
-
export namespace Plan {
|
|
308
|
-
export interface CustomField {
|
|
309
276
|
/**
|
|
310
|
-
* The
|
|
277
|
+
* The product the plan is related to. Either this or product is required.
|
|
311
278
|
*/
|
|
312
|
-
|
|
279
|
+
product_id?: string | null;
|
|
313
280
|
|
|
314
281
|
/**
|
|
315
|
-
* The
|
|
282
|
+
* The methods of how a plan can be released.
|
|
316
283
|
*/
|
|
317
|
-
|
|
284
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
318
285
|
|
|
319
286
|
/**
|
|
320
|
-
* The
|
|
287
|
+
* The amount the customer is charged every billing period.
|
|
321
288
|
*/
|
|
322
|
-
|
|
289
|
+
renewal_price?: number | null;
|
|
323
290
|
|
|
324
291
|
/**
|
|
325
|
-
* The
|
|
292
|
+
* The title of the plan. This will be visible on the product page to customers.
|
|
326
293
|
*/
|
|
327
|
-
|
|
294
|
+
title?: string | null;
|
|
328
295
|
|
|
329
296
|
/**
|
|
330
|
-
* The
|
|
297
|
+
* The number of free trial days added before a renewal plan.
|
|
331
298
|
*/
|
|
332
|
-
|
|
299
|
+
trial_period_days?: number | null;
|
|
333
300
|
|
|
334
301
|
/**
|
|
335
|
-
*
|
|
302
|
+
* Visibility of a resource
|
|
336
303
|
*/
|
|
337
|
-
|
|
304
|
+
visibility?: Shared.Visibility | null;
|
|
338
305
|
}
|
|
339
306
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
307
|
+
export namespace Plan {
|
|
308
|
+
export interface CustomField {
|
|
309
|
+
/**
|
|
310
|
+
* The type of the custom field.
|
|
311
|
+
*/
|
|
312
|
+
field_type: 'text';
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* The name of the custom field.
|
|
316
|
+
*/
|
|
317
|
+
name: string;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The ID of the custom field (if being updated)
|
|
321
|
+
*/
|
|
322
|
+
id?: string | null;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* The order of the field.
|
|
326
|
+
*/
|
|
327
|
+
order?: number | null;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* The placeholder value of the field.
|
|
331
|
+
*/
|
|
332
|
+
placeholder?: string | null;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Whether or not the field is required.
|
|
336
|
+
*/
|
|
337
|
+
required?: boolean | null;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Input for an attachment
|
|
342
|
+
*/
|
|
343
|
+
export interface AttachmentInputWithDirectUploadID {
|
|
344
|
+
/**
|
|
345
|
+
* This ID should be used the first time you upload an attachment. It is the ID of
|
|
346
|
+
* the direct upload that was created when uploading the file to S3 via the
|
|
347
|
+
* mediaDirectUpload mutation.
|
|
348
|
+
*/
|
|
349
|
+
direct_upload_id: string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Input for an attachment
|
|
354
|
+
*/
|
|
355
|
+
export interface AttachmentInputWithID {
|
|
356
|
+
/**
|
|
357
|
+
* The ID of an existing attachment object. Use this when updating a resource and
|
|
358
|
+
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
359
|
+
* doing.
|
|
360
|
+
*/
|
|
361
|
+
id: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
344
364
|
/**
|
|
345
|
-
* The
|
|
346
|
-
*
|
|
347
|
-
* doing.
|
|
365
|
+
* The explicit payment method configuration for the plan. If not provided, the
|
|
366
|
+
* platform or company's defaults will apply.
|
|
348
367
|
*/
|
|
349
|
-
|
|
368
|
+
export interface PaymentMethodConfiguration {
|
|
369
|
+
/**
|
|
370
|
+
* An array of payment method identifiers that are explicitly disabled. Only
|
|
371
|
+
* applies if the include_platform_defaults is true.
|
|
372
|
+
*/
|
|
373
|
+
disabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* An array of payment method identifiers that are explicitly enabled. This means
|
|
377
|
+
* these payment methods will be shown on checkout. Example use case is to only
|
|
378
|
+
* enable a specific payment method like cashapp, or extending the platform
|
|
379
|
+
* defaults with additional methods.
|
|
380
|
+
*/
|
|
381
|
+
enabled: Array<PaymentsAPI.PaymentMethodTypes>;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Whether Whop's platform default payment method enablement settings are included
|
|
385
|
+
* in this configuration. The full list of default payment methods can be found in
|
|
386
|
+
* the documentation at docs.whop.com/payments.
|
|
387
|
+
*/
|
|
388
|
+
include_platform_defaults: boolean;
|
|
389
|
+
}
|
|
350
390
|
|
|
351
391
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* mediaDirectUpload mutation.
|
|
392
|
+
* Pass this object to create a new product for this plan. We will use the product
|
|
393
|
+
* external identifier to find or create an existing product.
|
|
355
394
|
*/
|
|
356
|
-
|
|
395
|
+
export interface Product {
|
|
396
|
+
/**
|
|
397
|
+
* A unique ID used to find or create a product. When provided during creation, we
|
|
398
|
+
* will look for an existing product with this external identifier — if found, it
|
|
399
|
+
* will be updated; otherwise, a new product will be created.
|
|
400
|
+
*/
|
|
401
|
+
external_identifier: string;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* The title of the product.
|
|
405
|
+
*/
|
|
406
|
+
title: string;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* The different business types a company can be.
|
|
410
|
+
*/
|
|
411
|
+
business_type?: Shared.BusinessTypes | null;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Whether or not to collect shipping information at checkout from the customer.
|
|
415
|
+
*/
|
|
416
|
+
collect_shipping_address?: boolean | null;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
|
|
420
|
+
* between 5 and 22 characters, contain at least one letter, and not contain any of
|
|
421
|
+
* the following characters: <, >, \, ', "
|
|
422
|
+
*/
|
|
423
|
+
custom_statement_descriptor?: string | null;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* A written description of the product.
|
|
427
|
+
*/
|
|
428
|
+
description?: string | null;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* The percentage of the revenue that goes to the global affiliate program.
|
|
432
|
+
*/
|
|
433
|
+
global_affiliate_percentage?: number | null;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* The different statuses of the global affiliate program for an access pass.
|
|
437
|
+
*/
|
|
438
|
+
global_affiliate_status?: Shared.GlobalAffiliateStatus | null;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* The headline of the product.
|
|
442
|
+
*/
|
|
443
|
+
headline?: string | null;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* The different industry types a company can be in.
|
|
447
|
+
*/
|
|
448
|
+
industry_type?: Shared.IndustryTypes | null;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* The ID of the product tax code to apply to this product.
|
|
452
|
+
*/
|
|
453
|
+
product_tax_code_id?: string | null;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* The URL to redirect the customer to after a purchase.
|
|
457
|
+
*/
|
|
458
|
+
redirect_purchase_url?: string | null;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* The route of the product.
|
|
462
|
+
*/
|
|
463
|
+
route?: string | null;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Visibility of a resource
|
|
467
|
+
*/
|
|
468
|
+
visibility?: Shared.Visibility | null;
|
|
469
|
+
}
|
|
357
470
|
}
|
|
358
471
|
}
|
|
472
|
+
|
|
473
|
+
export interface CreateCheckoutSessionInputWithPlanID {
|
|
474
|
+
/**
|
|
475
|
+
* The ID of the plan to use for the checkout configuration
|
|
476
|
+
*/
|
|
477
|
+
plan_id: string;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* The affiliate code to use for the checkout configuration
|
|
481
|
+
*/
|
|
482
|
+
affiliate_code?: string | null;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The metadata to use for the checkout configuration
|
|
486
|
+
*/
|
|
487
|
+
metadata?: { [key: string]: unknown } | null;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
491
|
+
*/
|
|
492
|
+
redirect_url?: string | null;
|
|
493
|
+
}
|
|
359
494
|
}
|
|
360
495
|
|
|
361
496
|
export interface CheckoutConfigurationListParams extends CursorPageParams {
|