@whop/sdk 0.0.3 → 0.0.5
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 +64 -0
- package/client.d.mts +14 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -8
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +8 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-tokens.d.mts +58 -0
- package/resources/access-tokens.d.mts.map +1 -0
- package/resources/access-tokens.d.ts +58 -0
- package/resources/access-tokens.d.ts.map +1 -0
- package/resources/access-tokens.js +25 -0
- package/resources/access-tokens.js.map +1 -0
- package/resources/access-tokens.mjs +21 -0
- package/resources/access-tokens.mjs.map +1 -0
- 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 +221 -183
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +221 -183
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +4 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +4 -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-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 +184 -24
- package/resources/course-lessons.d.mts.map +1 -1
- package/resources/course-lessons.d.ts +184 -24
- package/resources/course-lessons.d.ts.map +1 -1
- 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 +85 -21
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +85 -21
- package/resources/courses.d.ts.map +1 -1
- package/resources/entries.d.mts +2 -2
- package/resources/entries.d.ts +2 -2
- package/resources/experiences.d.mts +15 -10
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +15 -10
- package/resources/experiences.d.ts.map +1 -1
- package/resources/forum-posts.d.mts +29 -19
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +29 -19
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +539 -167
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +539 -167
- 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.ts +1 -1
- package/resources/ledger-accounts.js +1 -1
- package/resources/ledger-accounts.mjs +1 -1
- package/resources/members.d.mts +11 -11
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +11 -11
- package/resources/members.d.ts.map +1 -1
- package/resources/memberships.d.mts +4 -4
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +4 -4
- package/resources/memberships.d.ts.map +1 -1
- package/resources/messages.d.mts +29 -19
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +29 -19
- package/resources/messages.d.ts.map +1 -1
- package/resources/payments.d.mts +10 -3
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +10 -3
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +118 -20
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +118 -20
- 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 +20 -15
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +20 -15
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +4 -4
- package/resources/promo-codes.d.ts +4 -4
- package/resources/shared.d.mts +69 -20
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +69 -20
- 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/resources/users.d.mts +3 -0
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +3 -0
- package/resources/users.d.ts.map +1 -1
- package/src/client.ts +45 -10
- package/src/resources/access-tokens.ts +72 -0
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +245 -199
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +223 -24
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +104 -22
- package/src/resources/entries.ts +2 -2
- package/src/resources/experiences.ts +19 -11
- package/src/resources/forum-posts.ts +35 -21
- package/src/resources/index.ts +17 -2
- package/src/resources/invoices.ts +630 -171
- package/src/resources/ledger-accounts.ts +1 -1
- package/src/resources/members.ts +12 -12
- package/src/resources/memberships.ts +5 -5
- package/src/resources/messages.ts +35 -21
- package/src/resources/payments.ts +10 -3
- package/src/resources/plans.ts +130 -20
- package/src/resources/products.ts +24 -16
- package/src/resources/promo-codes.ts +4 -4
- package/src/resources/shared.ts +70 -20
- package/src/resources/transfers.ts +10 -0
- package/src/resources/users.ts +3 -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';
|
|
@@ -21,11 +22,13 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
21
22
|
* @example
|
|
22
23
|
* ```ts
|
|
23
24
|
* const checkoutConfiguration =
|
|
24
|
-
* await client.checkoutConfigurations.create(
|
|
25
|
+
* await client.checkoutConfigurations.create({
|
|
26
|
+
* plan_id: 'plan_xxxxxxxxxxxxx',
|
|
27
|
+
* });
|
|
25
28
|
* ```
|
|
26
29
|
*/
|
|
27
30
|
create(
|
|
28
|
-
body: CheckoutConfigurationCreateParams
|
|
31
|
+
body: CheckoutConfigurationCreateParams,
|
|
29
32
|
options?: RequestOptions,
|
|
30
33
|
): APIPromise<Shared.CheckoutConfiguration> {
|
|
31
34
|
return this._client.post('/checkout_configurations', { body, ...options });
|
|
@@ -37,14 +40,6 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
37
40
|
* Required permissions:
|
|
38
41
|
*
|
|
39
42
|
* - `checkout_configuration:basic:read`
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const checkoutConfiguration =
|
|
44
|
-
* await client.checkoutConfigurations.retrieve(
|
|
45
|
-
* 'ch_xxxxxxxxxxxxxxx',
|
|
46
|
-
* );
|
|
47
|
-
* ```
|
|
48
43
|
*/
|
|
49
44
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CheckoutConfiguration> {
|
|
50
45
|
return this._client.get(path`/checkout_configurations/${id}`, options);
|
|
@@ -56,16 +51,6 @@ export class CheckoutConfigurations extends APIResource {
|
|
|
56
51
|
* Required permissions:
|
|
57
52
|
*
|
|
58
53
|
* - `checkout_configuration:basic:read`
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* // Automatically fetches more pages as needed.
|
|
63
|
-
* for await (const checkoutConfigurationListResponse of client.checkoutConfigurations.list(
|
|
64
|
-
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
65
|
-
* )) {
|
|
66
|
-
* // ...
|
|
67
|
-
* }
|
|
68
|
-
* ```
|
|
69
54
|
*/
|
|
70
55
|
list(
|
|
71
56
|
query: CheckoutConfigurationListParams,
|
|
@@ -182,269 +167,330 @@ export namespace CheckoutConfigurationListResponse {
|
|
|
182
167
|
}
|
|
183
168
|
}
|
|
184
169
|
|
|
185
|
-
export
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
*/
|
|
189
|
-
affiliate_code?: string | null;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* The metadata to use for the checkout configuration
|
|
193
|
-
*/
|
|
194
|
-
metadata?: { [key: string]: unknown } | null;
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Pass this object to create a new plan for this checkout configuration
|
|
198
|
-
*/
|
|
199
|
-
plan?: CheckoutConfigurationCreateParams.Plan | null;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The ID of the plan to use for the checkout configuration
|
|
203
|
-
*/
|
|
204
|
-
plan_id?: string | null;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* The URL to redirect the user to after the checkout configuration is created
|
|
208
|
-
*/
|
|
209
|
-
redirect_url?: string | null;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export namespace CheckoutConfigurationCreateParams {
|
|
213
|
-
/**
|
|
214
|
-
* Pass this object to create a new plan for this checkout configuration
|
|
215
|
-
*/
|
|
216
|
-
export interface Plan {
|
|
217
|
-
/**
|
|
218
|
-
* The company the plan should be created for.
|
|
219
|
-
*/
|
|
220
|
-
company_id: string;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* The interval at which the plan charges (renewal plans).
|
|
224
|
-
*/
|
|
225
|
-
billing_period?: number | null;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* The available currencies on the platform
|
|
229
|
-
*/
|
|
230
|
-
currency?: Shared.Currency | null;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* An array of custom field objects.
|
|
234
|
-
*/
|
|
235
|
-
custom_fields?: Array<Plan.CustomField> | null;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* The description of the plan.
|
|
239
|
-
*/
|
|
240
|
-
description?: string | null;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* The interval at which the plan charges (expiration plans).
|
|
244
|
-
*/
|
|
245
|
-
expiration_days?: number | null;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Whether to force the creation of a new plan even if one with the same attributes
|
|
249
|
-
* already exists.
|
|
250
|
-
*/
|
|
251
|
-
force_create_new_plan?: boolean | null;
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* An image for the plan. This will be visible on the product page to customers.
|
|
255
|
-
*/
|
|
256
|
-
image?: Plan.Image | null;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* An additional amount charged upon first purchase.
|
|
260
|
-
*/
|
|
261
|
-
initial_price?: number | null;
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* A personal description or notes section for the business.
|
|
265
|
-
*/
|
|
266
|
-
internal_notes?: string | null;
|
|
170
|
+
export type CheckoutConfigurationCreateParams =
|
|
171
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlan
|
|
172
|
+
| CheckoutConfigurationCreateParams.CreateCheckoutSessionInputWithPlanID;
|
|
267
173
|
|
|
174
|
+
export declare namespace CheckoutConfigurationCreateParams {
|
|
175
|
+
export interface CreateCheckoutSessionInputWithPlan {
|
|
268
176
|
/**
|
|
269
|
-
*
|
|
270
|
-
* up)
|
|
177
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
271
178
|
*/
|
|
272
|
-
|
|
179
|
+
plan: CreateCheckoutSessionInputWithPlan.Plan;
|
|
273
180
|
|
|
274
181
|
/**
|
|
275
|
-
* The
|
|
182
|
+
* The affiliate code to use for the checkout configuration
|
|
276
183
|
*/
|
|
277
|
-
|
|
184
|
+
affiliate_code?: string | null;
|
|
278
185
|
|
|
279
186
|
/**
|
|
280
|
-
*
|
|
281
|
-
* external identifier to find or create an existing product.
|
|
187
|
+
* The metadata to use for the checkout configuration
|
|
282
188
|
*/
|
|
283
|
-
|
|
189
|
+
metadata?: { [key: string]: unknown } | null;
|
|
284
190
|
|
|
285
191
|
/**
|
|
286
|
-
* The
|
|
192
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
287
193
|
*/
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* The methods of how a plan can be released.
|
|
292
|
-
*/
|
|
293
|
-
release_method?: Shared.ReleaseMethod | null;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* The amount the customer is charged every billing period.
|
|
297
|
-
*/
|
|
298
|
-
renewal_price?: number | null;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* The title of the plan. This will be visible on the product page to customers.
|
|
302
|
-
*/
|
|
303
|
-
title?: string | null;
|
|
194
|
+
redirect_url?: string | null;
|
|
195
|
+
}
|
|
304
196
|
|
|
197
|
+
export namespace CreateCheckoutSessionInputWithPlan {
|
|
305
198
|
/**
|
|
306
|
-
*
|
|
199
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
307
200
|
*/
|
|
308
|
-
|
|
201
|
+
export interface Plan {
|
|
202
|
+
/**
|
|
203
|
+
* The company the plan should be created for.
|
|
204
|
+
*/
|
|
205
|
+
company_id: string;
|
|
309
206
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
207
|
+
/**
|
|
208
|
+
* The interval at which the plan charges (renewal plans).
|
|
209
|
+
*/
|
|
210
|
+
billing_period?: number | null;
|
|
315
211
|
|
|
316
|
-
export namespace Plan {
|
|
317
|
-
export interface CustomField {
|
|
318
212
|
/**
|
|
319
|
-
* The
|
|
213
|
+
* The available currencies on the platform
|
|
320
214
|
*/
|
|
321
|
-
|
|
215
|
+
currency?: Shared.Currency | null;
|
|
322
216
|
|
|
323
217
|
/**
|
|
324
|
-
*
|
|
218
|
+
* An array of custom field objects.
|
|
325
219
|
*/
|
|
326
|
-
|
|
220
|
+
custom_fields?: Array<Plan.CustomField> | null;
|
|
327
221
|
|
|
328
222
|
/**
|
|
329
|
-
* The
|
|
223
|
+
* The description of the plan.
|
|
330
224
|
*/
|
|
331
|
-
|
|
225
|
+
description?: string | null;
|
|
332
226
|
|
|
333
227
|
/**
|
|
334
|
-
* The
|
|
228
|
+
* The interval at which the plan charges (expiration plans).
|
|
335
229
|
*/
|
|
336
|
-
|
|
230
|
+
expiration_days?: number | null;
|
|
337
231
|
|
|
338
232
|
/**
|
|
339
|
-
*
|
|
233
|
+
* Whether to force the creation of a new plan even if one with the same attributes
|
|
234
|
+
* already exists.
|
|
340
235
|
*/
|
|
341
|
-
|
|
236
|
+
force_create_new_plan?: boolean | null;
|
|
342
237
|
|
|
343
238
|
/**
|
|
344
|
-
*
|
|
239
|
+
* An image for the plan. This will be visible on the product page to customers.
|
|
345
240
|
*/
|
|
346
|
-
|
|
347
|
-
}
|
|
241
|
+
image?: Plan.AttachmentInputWithDirectUploadID | Plan.AttachmentInputWithID | null;
|
|
348
242
|
|
|
349
|
-
/**
|
|
350
|
-
* An image for the plan. This will be visible on the product page to customers.
|
|
351
|
-
*/
|
|
352
|
-
export interface Image {
|
|
353
243
|
/**
|
|
354
|
-
*
|
|
355
|
-
* keeping a subset of the attachments. Don't use this unless you know what you're
|
|
356
|
-
* doing.
|
|
244
|
+
* An additional amount charged upon first purchase.
|
|
357
245
|
*/
|
|
358
|
-
|
|
246
|
+
initial_price?: number | null;
|
|
359
247
|
|
|
360
248
|
/**
|
|
361
|
-
*
|
|
362
|
-
* the direct upload that was created when uploading the file to S3 via the
|
|
363
|
-
* mediaDirectUpload mutation.
|
|
249
|
+
* A personal description or notes section for the business.
|
|
364
250
|
*/
|
|
365
|
-
|
|
366
|
-
}
|
|
251
|
+
internal_notes?: string | null;
|
|
367
252
|
|
|
368
|
-
/**
|
|
369
|
-
* Pass this object to create a new product for this plan. We will use the product
|
|
370
|
-
* external identifier to find or create an existing product.
|
|
371
|
-
*/
|
|
372
|
-
export interface Product {
|
|
373
253
|
/**
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* will be updated; otherwise, a new product will be created.
|
|
254
|
+
* Whether or not the tax is included in a plan's price (or if it hasn't been set
|
|
255
|
+
* up)
|
|
377
256
|
*/
|
|
378
|
-
|
|
257
|
+
override_tax_type?: Shared.TaxType | null;
|
|
379
258
|
|
|
380
259
|
/**
|
|
381
|
-
* The
|
|
260
|
+
* The explicit payment method configuration for the plan. If not provided, the
|
|
261
|
+
* platform or company's defaults will apply.
|
|
382
262
|
*/
|
|
383
|
-
|
|
263
|
+
payment_method_configuration?: Plan.PaymentMethodConfiguration | null;
|
|
384
264
|
|
|
385
265
|
/**
|
|
386
|
-
* The
|
|
266
|
+
* The type of plan that can be attached to a product
|
|
387
267
|
*/
|
|
388
|
-
|
|
268
|
+
plan_type?: Shared.PlanType | null;
|
|
389
269
|
|
|
390
270
|
/**
|
|
391
|
-
*
|
|
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.
|
|
392
273
|
*/
|
|
393
|
-
|
|
274
|
+
product?: Plan.Product | null;
|
|
394
275
|
|
|
395
276
|
/**
|
|
396
|
-
* The
|
|
397
|
-
* between 5 and 22 characters, contain at least one letter, and not contain any of
|
|
398
|
-
* the following characters: <, >, \, ', "
|
|
277
|
+
* The product the plan is related to. Either this or product is required.
|
|
399
278
|
*/
|
|
400
|
-
|
|
279
|
+
product_id?: string | null;
|
|
401
280
|
|
|
402
281
|
/**
|
|
403
|
-
*
|
|
282
|
+
* The methods of how a plan can be released.
|
|
404
283
|
*/
|
|
405
|
-
|
|
284
|
+
release_method?: Shared.ReleaseMethod | null;
|
|
406
285
|
|
|
407
286
|
/**
|
|
408
|
-
* The
|
|
287
|
+
* The amount the customer is charged every billing period.
|
|
409
288
|
*/
|
|
410
|
-
|
|
289
|
+
renewal_price?: number | null;
|
|
411
290
|
|
|
412
291
|
/**
|
|
413
|
-
* The
|
|
292
|
+
* The title of the plan. This will be visible on the product page to customers.
|
|
414
293
|
*/
|
|
415
|
-
|
|
294
|
+
title?: string | null;
|
|
416
295
|
|
|
417
296
|
/**
|
|
418
|
-
* The
|
|
297
|
+
* The number of free trial days added before a renewal plan.
|
|
419
298
|
*/
|
|
420
|
-
|
|
299
|
+
trial_period_days?: number | null;
|
|
421
300
|
|
|
422
301
|
/**
|
|
423
|
-
*
|
|
302
|
+
* Visibility of a resource
|
|
424
303
|
*/
|
|
425
|
-
|
|
304
|
+
visibility?: Shared.Visibility | null;
|
|
305
|
+
}
|
|
306
|
+
|
|
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
|
+
}
|
|
426
339
|
|
|
427
340
|
/**
|
|
428
|
-
*
|
|
341
|
+
* Input for an attachment
|
|
429
342
|
*/
|
|
430
|
-
|
|
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
|
+
}
|
|
431
351
|
|
|
432
352
|
/**
|
|
433
|
-
*
|
|
353
|
+
* Input for an attachment
|
|
434
354
|
*/
|
|
435
|
-
|
|
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
|
+
}
|
|
436
363
|
|
|
437
364
|
/**
|
|
438
|
-
* The
|
|
365
|
+
* The explicit payment method configuration for the plan. If not provided, the
|
|
366
|
+
* platform or company's defaults will apply.
|
|
439
367
|
*/
|
|
440
|
-
|
|
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
|
+
}
|
|
441
390
|
|
|
442
391
|
/**
|
|
443
|
-
*
|
|
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.
|
|
444
394
|
*/
|
|
445
|
-
|
|
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 a product.
|
|
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
|
+
}
|
|
446
470
|
}
|
|
447
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
|
+
}
|
|
448
494
|
}
|
|
449
495
|
|
|
450
496
|
export interface CheckoutConfigurationListParams extends CursorPageParams {
|