@whop/sdk 0.0.3 → 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.
Files changed (130) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +5 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +16 -13
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +16 -13
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/app-builds.js +1 -1
  16. package/resources/app-builds.mjs +1 -1
  17. package/resources/apps.d.mts +15 -10
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +15 -10
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +221 -183
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +221 -183
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +4 -20
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +4 -20
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/companies.d.mts +157 -0
  30. package/resources/companies.d.mts.map +1 -1
  31. package/resources/companies.d.ts +157 -0
  32. package/resources/companies.d.ts.map +1 -1
  33. package/resources/companies.js +22 -0
  34. package/resources/companies.js.map +1 -1
  35. package/resources/companies.mjs +22 -0
  36. package/resources/companies.mjs.map +1 -1
  37. package/resources/course-lesson-interactions.d.mts +2 -2
  38. package/resources/course-lesson-interactions.d.ts +2 -2
  39. package/resources/course-lesson-interactions.js +2 -2
  40. package/resources/course-lesson-interactions.mjs +2 -2
  41. package/resources/course-lessons.d.mts +68 -28
  42. package/resources/course-lessons.d.mts.map +1 -1
  43. package/resources/course-lessons.d.ts +68 -28
  44. package/resources/course-lessons.d.ts.map +1 -1
  45. package/resources/course-students.d.mts +187 -0
  46. package/resources/course-students.d.mts.map +1 -0
  47. package/resources/course-students.d.ts +187 -0
  48. package/resources/course-students.d.ts.map +1 -0
  49. package/resources/course-students.js +36 -0
  50. package/resources/course-students.js.map +1 -0
  51. package/resources/course-students.mjs +32 -0
  52. package/resources/course-students.mjs.map +1 -0
  53. package/resources/courses.d.mts +40 -20
  54. package/resources/courses.d.mts.map +1 -1
  55. package/resources/courses.d.ts +40 -20
  56. package/resources/courses.d.ts.map +1 -1
  57. package/resources/experiences.d.mts +15 -10
  58. package/resources/experiences.d.mts.map +1 -1
  59. package/resources/experiences.d.ts +15 -10
  60. package/resources/experiences.d.ts.map +1 -1
  61. package/resources/forum-posts.d.mts +28 -18
  62. package/resources/forum-posts.d.mts.map +1 -1
  63. package/resources/forum-posts.d.ts +28 -18
  64. package/resources/forum-posts.d.ts.map +1 -1
  65. package/resources/index.d.mts +3 -2
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +3 -2
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js +3 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +2 -1
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/invoices.d.mts +529 -146
  74. package/resources/invoices.d.mts.map +1 -1
  75. package/resources/invoices.d.ts +529 -146
  76. package/resources/invoices.d.ts.map +1 -1
  77. package/resources/invoices.js +2 -24
  78. package/resources/invoices.js.map +1 -1
  79. package/resources/invoices.mjs +2 -24
  80. package/resources/invoices.mjs.map +1 -1
  81. package/resources/messages.d.mts +28 -18
  82. package/resources/messages.d.mts.map +1 -1
  83. package/resources/messages.d.ts +28 -18
  84. package/resources/messages.d.ts.map +1 -1
  85. package/resources/payments.d.mts +8 -1
  86. package/resources/payments.d.mts.map +1 -1
  87. package/resources/payments.d.ts +8 -1
  88. package/resources/payments.d.ts.map +1 -1
  89. package/resources/plans.d.mts +112 -16
  90. package/resources/plans.d.mts.map +1 -1
  91. package/resources/plans.d.ts +112 -16
  92. package/resources/plans.d.ts.map +1 -1
  93. package/resources/plans.js.map +1 -1
  94. package/resources/plans.mjs.map +1 -1
  95. package/resources/products.d.mts +15 -10
  96. package/resources/products.d.mts.map +1 -1
  97. package/resources/products.d.ts +15 -10
  98. package/resources/products.d.ts.map +1 -1
  99. package/resources/shared.d.mts +47 -0
  100. package/resources/shared.d.mts.map +1 -1
  101. package/resources/shared.d.ts +47 -0
  102. package/resources/shared.d.ts.map +1 -1
  103. package/resources/transfers.d.mts +12 -0
  104. package/resources/transfers.d.mts.map +1 -1
  105. package/resources/transfers.d.ts +12 -0
  106. package/resources/transfers.d.ts.map +1 -1
  107. package/src/client.ts +32 -10
  108. package/src/resources/app-builds.ts +19 -14
  109. package/src/resources/apps.ts +16 -11
  110. package/src/resources/checkout-configurations.ts +245 -199
  111. package/src/resources/companies.ts +196 -0
  112. package/src/resources/course-lesson-interactions.ts +2 -2
  113. package/src/resources/course-lessons.ts +83 -30
  114. package/src/resources/course-students.ts +238 -0
  115. package/src/resources/courses.ts +50 -22
  116. package/src/resources/experiences.ts +19 -11
  117. package/src/resources/forum-posts.ts +34 -20
  118. package/src/resources/index.ts +14 -2
  119. package/src/resources/invoices.ts +620 -149
  120. package/src/resources/messages.ts +34 -20
  121. package/src/resources/payments.ts +8 -1
  122. package/src/resources/plans.ts +124 -16
  123. package/src/resources/products.ts +19 -11
  124. package/src/resources/shared.ts +48 -0
  125. package/src/resources/transfers.ts +10 -0
  126. package/src/version.ts +1 -1
  127. package/version.d.mts +1 -1
  128. package/version.d.ts +1 -1
  129. package/version.js +1 -1
  130. package/version.mjs +1 -1
@@ -23,11 +23,13 @@ export class Invoices extends APIResource {
23
23
  * collection_method: 'send_invoice',
24
24
  * company_id: 'biz_xxxxxxxxxxxxxx',
25
25
  * due_date: '2023-12-01T05:00:00.401Z',
26
+ * member_id: 'mber_xxxxxxxxxxxxx',
26
27
  * plan: {},
28
+ * product: { title: 'title' },
27
29
  * });
28
30
  * ```
29
31
  */
30
- create(body: InvoiceCreateParams, options?: RequestOptions): APIPromise<InvoiceCreateResponse> {
32
+ create(body: InvoiceCreateParams, options?: RequestOptions): APIPromise<Shared.Invoice> {
31
33
  return this._client.post('/invoices', { body, ...options });
32
34
  }
33
35
 
@@ -38,13 +40,6 @@ export class Invoices extends APIResource {
38
40
  *
39
41
  * - `invoice:basic:read`
40
42
  * - `plan:basic:read`
41
- *
42
- * @example
43
- * ```ts
44
- * const invoice = await client.invoices.retrieve(
45
- * 'inv_xxxxxxxxxxxxxx',
46
- * );
47
- * ```
48
43
  */
49
44
  retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
50
45
  return this._client.get(path`/invoices/${id}`, options);
@@ -57,16 +52,6 @@ export class Invoices extends APIResource {
57
52
  *
58
53
  * - `invoice:basic:read`
59
54
  * - `plan:basic:read`
60
- *
61
- * @example
62
- * ```ts
63
- * // Automatically fetches more pages as needed.
64
- * for await (const invoiceListItem of client.invoices.list({
65
- * company_id: 'biz_xxxxxxxxxxxxxx',
66
- * })) {
67
- * // ...
68
- * }
69
- * ```
70
55
  */
71
56
  list(
72
57
  query: InvoiceListParams,
@@ -81,217 +66,704 @@ export class Invoices extends APIResource {
81
66
  * Required permissions:
82
67
  *
83
68
  * - `invoice:update`
84
- *
85
- * @example
86
- * ```ts
87
- * const response = await client.invoices.void(
88
- * 'inv_xxxxxxxxxxxxxx',
89
- * );
90
- * ```
91
69
  */
92
70
  void(id: string, options?: RequestOptions): APIPromise<InvoiceVoidResponse> {
93
71
  return this._client.post(path`/invoices/${id}/void`, options);
94
72
  }
95
73
  }
96
74
 
97
- /**
98
- * Autogenerated return type of CreateInvoice.
99
- */
100
- export interface InvoiceCreateResponse {
101
- /**
102
- * The ID of the checkout job that was created for this invoice.
103
- */
104
- checkout_job_id: string | null;
105
-
106
- /**
107
- * The invoice that was created for this invoice.
108
- */
109
- invoice: Shared.Invoice;
110
- }
111
-
112
75
  /**
113
76
  * Represents `true` or `false` values.
114
77
  */
115
78
  export type InvoiceVoidResponse = boolean;
116
79
 
117
- export interface InvoiceCreateParams {
118
- /**
119
- * The method of collection for this invoice. If using charge_automatically, you
120
- * must provide a payment_token.
121
- */
122
- collection_method: Shared.CollectionMethod;
80
+ export type InvoiceCreateParams =
81
+ | InvoiceCreateParams.CreateInvoiceInputWithProductAndMemberID
82
+ | InvoiceCreateParams.CreateInvoiceInputWithProductAndEmailAddress
83
+ | InvoiceCreateParams.CreateInvoiceInputWithProductIDAndMemberID
84
+ | InvoiceCreateParams.CreateInvoiceInputWithProductIDAndEmailAddress;
123
85
 
124
- /**
125
- * The company ID to create this invoice for.
126
- */
127
- company_id: string;
86
+ export declare namespace InvoiceCreateParams {
87
+ export interface CreateInvoiceInputWithProductAndMemberID {
88
+ /**
89
+ * The method of collection for this invoice. If using charge_automatically, you
90
+ * must provide a payment_token.
91
+ */
92
+ collection_method: Shared.CollectionMethod;
128
93
 
129
- /**
130
- * The date the invoice is due, if applicable.
131
- */
132
- due_date: string;
94
+ /**
95
+ * The company ID to create this invoice for.
96
+ */
97
+ company_id: string;
133
98
 
134
- /**
135
- * The properties of the plan to create for this invoice.
136
- */
137
- plan: InvoiceCreateParams.Plan;
99
+ /**
100
+ * The date the invoice is due, if applicable.
101
+ */
102
+ due_date: string;
138
103
 
139
- /**
140
- * Whether or not to charge the customer a buyer fee.
141
- */
142
- charge_buyer_fee?: boolean | null;
104
+ /**
105
+ * The member ID to create this invoice for. Include this if you want to create an
106
+ * invoice for an existing member. If you do not have a member ID, you must provide
107
+ * an email_address and customer_name.
108
+ */
109
+ member_id: string;
143
110
 
144
- /**
145
- * The name of the customer to create this invoice for. This is required if you
146
- * want to create an invoice for a customer who does not have a member of your
147
- * company yet.
148
- */
149
- customer_name?: string | null;
111
+ /**
112
+ * The properties of the plan to create for this invoice.
113
+ */
114
+ plan: CreateInvoiceInputWithProductAndMemberID.Plan;
150
115
 
151
- /**
152
- * The email address to create this invoice for. This is required if you want to
153
- * create an invoice for a user who does not have a member of your company yet.
154
- */
155
- email_address?: string | null;
116
+ /**
117
+ * The properties of the product to create for this invoice. Include this if you
118
+ * want to create an invoice for a new product.
119
+ */
120
+ product: CreateInvoiceInputWithProductAndMemberID.Product;
156
121
 
157
- /**
158
- * The member ID to create this invoice for. Include this if you want to create an
159
- * invoice for an existing member. If you do not have a member ID, you must provide
160
- * an email_address and customer_name.
161
- */
162
- member_id?: string | null;
122
+ /**
123
+ * Whether or not to charge the customer a buyer fee.
124
+ */
125
+ charge_buyer_fee?: boolean | null;
163
126
 
164
- /**
165
- * The payment token ID to use for this invoice. If using charge_automatically, you
166
- * must provide a payment_token.
167
- */
168
- payment_token_id?: string | null;
127
+ /**
128
+ * The name of the customer to create this invoice for. This is required if you
129
+ * want to create an invoice for a customer who does not have a member of your
130
+ * company yet.
131
+ */
132
+ customer_name?: string | null;
169
133
 
170
- /**
171
- * The properties of the product to create for this invoice. Include this if you
172
- * want to create an invoice for a new product.
173
- */
174
- product?: InvoiceCreateParams.Product | null;
134
+ /**
135
+ * The payment token ID to use for this invoice. If using charge_automatically, you
136
+ * must provide a payment_token.
137
+ */
138
+ payment_token_id?: string | null;
139
+ }
175
140
 
176
- /**
177
- * The product ID to create this invoice for. Include this if you want to create an
178
- * invoice for an existing product.
179
- */
180
- product_id?: string | null;
181
- }
141
+ export namespace CreateInvoiceInputWithProductAndMemberID {
142
+ /**
143
+ * The properties of the plan to create for this invoice.
144
+ */
145
+ export interface Plan {
146
+ /**
147
+ * The interval at which the plan charges (renewal plans).
148
+ */
149
+ billing_period?: number | null;
150
+
151
+ /**
152
+ * An array of custom field objects.
153
+ */
154
+ custom_fields?: Array<Plan.CustomField> | null;
155
+
156
+ /**
157
+ * The description of the plan.
158
+ */
159
+ description?: string | null;
160
+
161
+ /**
162
+ * The interval at which the plan charges (expiration plans).
163
+ */
164
+ expiration_days?: number | null;
165
+
166
+ /**
167
+ * An additional amount charged upon first purchase. Use only if a one time payment
168
+ * OR you want to charge an additional amount on top of the renewal price. Provided
169
+ * as a number in dollars. Eg: 10.43 for $10.43
170
+ */
171
+ initial_price?: number | null;
172
+
173
+ /**
174
+ * A personal description or notes section for the business.
175
+ */
176
+ internal_notes?: string | null;
177
+
178
+ /**
179
+ * The type of plan that can be attached to an access pass
180
+ */
181
+ plan_type?: Shared.PlanType | null;
182
+
183
+ /**
184
+ * The methods of how a plan can be released.
185
+ */
186
+ release_method?: Shared.ReleaseMethod | null;
187
+
188
+ /**
189
+ * The amount the customer is charged every billing period. Use only if a recurring
190
+ * payment. Provided as a number in dollars. Eg: 10.43 for $10.43
191
+ */
192
+ renewal_price?: number | null;
193
+
194
+ /**
195
+ * The number of units available for purchase.
196
+ */
197
+ stock?: number | null;
198
+
199
+ /**
200
+ * The number of free trial days added before a renewal plan.
201
+ */
202
+ trial_period_days?: number | null;
203
+
204
+ /**
205
+ * Limits/doesn't limit the number of units available for purchase.
206
+ */
207
+ unlimited_stock?: boolean | null;
208
+
209
+ /**
210
+ * Visibility of a resource
211
+ */
212
+ visibility?: Shared.Visibility | null;
213
+ }
214
+
215
+ export namespace Plan {
216
+ export interface CustomField {
217
+ /**
218
+ * The type of the custom field.
219
+ */
220
+ field_type: 'text';
221
+
222
+ /**
223
+ * The name of the custom field.
224
+ */
225
+ name: string;
226
+
227
+ /**
228
+ * The ID of the custom field (if being updated)
229
+ */
230
+ id?: string | null;
231
+
232
+ /**
233
+ * The order of the field.
234
+ */
235
+ order?: number | null;
236
+
237
+ /**
238
+ * The placeholder value of the field.
239
+ */
240
+ placeholder?: string | null;
241
+
242
+ /**
243
+ * Whether or not the field is required.
244
+ */
245
+ required?: boolean | null;
246
+ }
247
+ }
182
248
 
183
- export namespace InvoiceCreateParams {
184
- /**
185
- * The properties of the plan to create for this invoice.
186
- */
187
- export interface Plan {
188
249
  /**
189
- * The interval at which the plan charges (renewal plans).
250
+ * The properties of the product to create for this invoice. Include this if you
251
+ * want to create an invoice for a new product.
190
252
  */
191
- billing_period?: number | null;
253
+ export interface Product {
254
+ /**
255
+ * The title of the product.
256
+ */
257
+ title: string;
192
258
 
259
+ /**
260
+ * The ID of the product tax code to apply to this product.
261
+ */
262
+ product_tax_code_id?: string | null;
263
+ }
264
+ }
265
+
266
+ export interface CreateInvoiceInputWithProductAndEmailAddress {
193
267
  /**
194
- * An array of custom field objects.
268
+ * The method of collection for this invoice. If using charge_automatically, you
269
+ * must provide a payment_token.
195
270
  */
196
- custom_fields?: Array<Plan.CustomField> | null;
271
+ collection_method: Shared.CollectionMethod;
197
272
 
198
273
  /**
199
- * The description of the plan.
274
+ * The company ID to create this invoice for.
200
275
  */
201
- description?: string | null;
276
+ company_id: string;
202
277
 
203
278
  /**
204
- * The interval at which the plan charges (expiration plans).
279
+ * The date the invoice is due, if applicable.
205
280
  */
206
- expiration_days?: number | null;
281
+ due_date: string;
207
282
 
208
283
  /**
209
- * An additional amount charged upon first purchase. Use only if a one time payment
210
- * OR you want to charge an additional amount on top of the renewal price. Provided
211
- * as a number in dollars. Eg: 10.43 for $10.43
284
+ * The email address to create this invoice for. This is required if you want to
285
+ * create an invoice for a user who does not have a member of your company yet.
212
286
  */
213
- initial_price?: number | null;
287
+ email_address: string;
214
288
 
215
289
  /**
216
- * A personal description or notes section for the business.
290
+ * The properties of the plan to create for this invoice.
217
291
  */
218
- internal_notes?: string | null;
292
+ plan: CreateInvoiceInputWithProductAndEmailAddress.Plan;
219
293
 
220
294
  /**
221
- * The type of plan that can be attached to an access pass
295
+ * The properties of the product to create for this invoice. Include this if you
296
+ * want to create an invoice for a new product.
222
297
  */
223
- plan_type?: Shared.PlanType | null;
298
+ product: CreateInvoiceInputWithProductAndEmailAddress.Product;
224
299
 
225
300
  /**
226
- * The methods of how a plan can be released.
301
+ * Whether or not to charge the customer a buyer fee.
227
302
  */
228
- release_method?: Shared.ReleaseMethod | null;
303
+ charge_buyer_fee?: boolean | null;
229
304
 
230
305
  /**
231
- * The amount the customer is charged every billing period. Use only if a recurring
232
- * payment. Provided as a number in dollars. Eg: 10.43 for $10.43
306
+ * The name of the customer to create this invoice for. This is required if you
307
+ * want to create an invoice for a customer who does not have a member of your
308
+ * company yet.
233
309
  */
234
- renewal_price?: number | null;
310
+ customer_name?: string | null;
235
311
 
236
312
  /**
237
- * The number of free trial days added before a renewal plan.
313
+ * The payment token ID to use for this invoice. If using charge_automatically, you
314
+ * must provide a payment_token.
238
315
  */
239
- trial_period_days?: number | null;
316
+ payment_token_id?: string | null;
317
+ }
240
318
 
319
+ export namespace CreateInvoiceInputWithProductAndEmailAddress {
241
320
  /**
242
- * Visibility of a resource
321
+ * The properties of the plan to create for this invoice.
243
322
  */
244
- visibility?: Shared.Visibility | null;
323
+ export interface Plan {
324
+ /**
325
+ * The interval at which the plan charges (renewal plans).
326
+ */
327
+ billing_period?: number | null;
328
+
329
+ /**
330
+ * An array of custom field objects.
331
+ */
332
+ custom_fields?: Array<Plan.CustomField> | null;
333
+
334
+ /**
335
+ * The description of the plan.
336
+ */
337
+ description?: string | null;
338
+
339
+ /**
340
+ * The interval at which the plan charges (expiration plans).
341
+ */
342
+ expiration_days?: number | null;
343
+
344
+ /**
345
+ * An additional amount charged upon first purchase. Use only if a one time payment
346
+ * OR you want to charge an additional amount on top of the renewal price. Provided
347
+ * as a number in dollars. Eg: 10.43 for $10.43
348
+ */
349
+ initial_price?: number | null;
350
+
351
+ /**
352
+ * A personal description or notes section for the business.
353
+ */
354
+ internal_notes?: string | null;
355
+
356
+ /**
357
+ * The type of plan that can be attached to an access pass
358
+ */
359
+ plan_type?: Shared.PlanType | null;
360
+
361
+ /**
362
+ * The methods of how a plan can be released.
363
+ */
364
+ release_method?: Shared.ReleaseMethod | null;
365
+
366
+ /**
367
+ * The amount the customer is charged every billing period. Use only if a recurring
368
+ * payment. Provided as a number in dollars. Eg: 10.43 for $10.43
369
+ */
370
+ renewal_price?: number | null;
371
+
372
+ /**
373
+ * The number of units available for purchase.
374
+ */
375
+ stock?: number | null;
376
+
377
+ /**
378
+ * The number of free trial days added before a renewal plan.
379
+ */
380
+ trial_period_days?: number | null;
381
+
382
+ /**
383
+ * Limits/doesn't limit the number of units available for purchase.
384
+ */
385
+ unlimited_stock?: boolean | null;
386
+
387
+ /**
388
+ * Visibility of a resource
389
+ */
390
+ visibility?: Shared.Visibility | null;
391
+ }
392
+
393
+ export namespace Plan {
394
+ export interface CustomField {
395
+ /**
396
+ * The type of the custom field.
397
+ */
398
+ field_type: 'text';
399
+
400
+ /**
401
+ * The name of the custom field.
402
+ */
403
+ name: string;
404
+
405
+ /**
406
+ * The ID of the custom field (if being updated)
407
+ */
408
+ id?: string | null;
409
+
410
+ /**
411
+ * The order of the field.
412
+ */
413
+ order?: number | null;
414
+
415
+ /**
416
+ * The placeholder value of the field.
417
+ */
418
+ placeholder?: string | null;
419
+
420
+ /**
421
+ * Whether or not the field is required.
422
+ */
423
+ required?: boolean | null;
424
+ }
425
+ }
426
+
427
+ /**
428
+ * The properties of the product to create for this invoice. Include this if you
429
+ * want to create an invoice for a new product.
430
+ */
431
+ export interface Product {
432
+ /**
433
+ * The title of the product.
434
+ */
435
+ title: string;
436
+
437
+ /**
438
+ * The ID of the product tax code to apply to this product.
439
+ */
440
+ product_tax_code_id?: string | null;
441
+ }
442
+ }
443
+
444
+ export interface CreateInvoiceInputWithProductIDAndMemberID {
445
+ /**
446
+ * The method of collection for this invoice. If using charge_automatically, you
447
+ * must provide a payment_token.
448
+ */
449
+ collection_method: Shared.CollectionMethod;
450
+
451
+ /**
452
+ * The company ID to create this invoice for.
453
+ */
454
+ company_id: string;
455
+
456
+ /**
457
+ * The date the invoice is due, if applicable.
458
+ */
459
+ due_date: string;
460
+
461
+ /**
462
+ * The member ID to create this invoice for. Include this if you want to create an
463
+ * invoice for an existing member. If you do not have a member ID, you must provide
464
+ * an email_address and customer_name.
465
+ */
466
+ member_id: string;
467
+
468
+ /**
469
+ * The properties of the plan to create for this invoice.
470
+ */
471
+ plan: CreateInvoiceInputWithProductIDAndMemberID.Plan;
472
+
473
+ /**
474
+ * The product ID to create this invoice for. Include this if you want to create an
475
+ * invoice for an existing product.
476
+ */
477
+ product_id: string;
478
+
479
+ /**
480
+ * Whether or not to charge the customer a buyer fee.
481
+ */
482
+ charge_buyer_fee?: boolean | null;
483
+
484
+ /**
485
+ * The name of the customer to create this invoice for. This is required if you
486
+ * want to create an invoice for a customer who does not have a member of your
487
+ * company yet.
488
+ */
489
+ customer_name?: string | null;
490
+
491
+ /**
492
+ * The payment token ID to use for this invoice. If using charge_automatically, you
493
+ * must provide a payment_token.
494
+ */
495
+ payment_token_id?: string | null;
245
496
  }
246
497
 
247
- export namespace Plan {
248
- export interface CustomField {
498
+ export namespace CreateInvoiceInputWithProductIDAndMemberID {
499
+ /**
500
+ * The properties of the plan to create for this invoice.
501
+ */
502
+ export interface Plan {
503
+ /**
504
+ * The interval at which the plan charges (renewal plans).
505
+ */
506
+ billing_period?: number | null;
507
+
508
+ /**
509
+ * An array of custom field objects.
510
+ */
511
+ custom_fields?: Array<Plan.CustomField> | null;
512
+
513
+ /**
514
+ * The description of the plan.
515
+ */
516
+ description?: string | null;
517
+
518
+ /**
519
+ * The interval at which the plan charges (expiration plans).
520
+ */
521
+ expiration_days?: number | null;
522
+
523
+ /**
524
+ * An additional amount charged upon first purchase. Use only if a one time payment
525
+ * OR you want to charge an additional amount on top of the renewal price. Provided
526
+ * as a number in dollars. Eg: 10.43 for $10.43
527
+ */
528
+ initial_price?: number | null;
529
+
530
+ /**
531
+ * A personal description or notes section for the business.
532
+ */
533
+ internal_notes?: string | null;
534
+
535
+ /**
536
+ * The type of plan that can be attached to an access pass
537
+ */
538
+ plan_type?: Shared.PlanType | null;
539
+
249
540
  /**
250
- * The type of the custom field.
541
+ * The methods of how a plan can be released.
251
542
  */
252
- field_type: 'text';
543
+ release_method?: Shared.ReleaseMethod | null;
253
544
 
254
545
  /**
255
- * The name of the custom field.
546
+ * The amount the customer is charged every billing period. Use only if a recurring
547
+ * payment. Provided as a number in dollars. Eg: 10.43 for $10.43
256
548
  */
257
- name: string;
549
+ renewal_price?: number | null;
258
550
 
259
551
  /**
260
- * The ID of the custom field (if being updated)
552
+ * The number of units available for purchase.
261
553
  */
262
- id?: string | null;
554
+ stock?: number | null;
263
555
 
264
556
  /**
265
- * The order of the field.
557
+ * The number of free trial days added before a renewal plan.
266
558
  */
267
- order?: number | null;
559
+ trial_period_days?: number | null;
268
560
 
269
561
  /**
270
- * The placeholder value of the field.
562
+ * Limits/doesn't limit the number of units available for purchase.
271
563
  */
272
- placeholder?: string | null;
564
+ unlimited_stock?: boolean | null;
273
565
 
274
566
  /**
275
- * Whether or not the field is required.
567
+ * Visibility of a resource
276
568
  */
277
- required?: boolean | null;
569
+ visibility?: Shared.Visibility | null;
570
+ }
571
+
572
+ export namespace Plan {
573
+ export interface CustomField {
574
+ /**
575
+ * The type of the custom field.
576
+ */
577
+ field_type: 'text';
578
+
579
+ /**
580
+ * The name of the custom field.
581
+ */
582
+ name: string;
583
+
584
+ /**
585
+ * The ID of the custom field (if being updated)
586
+ */
587
+ id?: string | null;
588
+
589
+ /**
590
+ * The order of the field.
591
+ */
592
+ order?: number | null;
593
+
594
+ /**
595
+ * The placeholder value of the field.
596
+ */
597
+ placeholder?: string | null;
598
+
599
+ /**
600
+ * Whether or not the field is required.
601
+ */
602
+ required?: boolean | null;
603
+ }
278
604
  }
279
605
  }
280
606
 
281
- /**
282
- * The properties of the product to create for this invoice. Include this if you
283
- * want to create an invoice for a new product.
284
- */
285
- export interface Product {
607
+ export interface CreateInvoiceInputWithProductIDAndEmailAddress {
608
+ /**
609
+ * The method of collection for this invoice. If using charge_automatically, you
610
+ * must provide a payment_token.
611
+ */
612
+ collection_method: Shared.CollectionMethod;
613
+
614
+ /**
615
+ * The company ID to create this invoice for.
616
+ */
617
+ company_id: string;
618
+
619
+ /**
620
+ * The date the invoice is due, if applicable.
621
+ */
622
+ due_date: string;
623
+
624
+ /**
625
+ * The email address to create this invoice for. This is required if you want to
626
+ * create an invoice for a user who does not have a member of your company yet.
627
+ */
628
+ email_address: string;
629
+
286
630
  /**
287
- * The title of the product.
631
+ * The properties of the plan to create for this invoice.
288
632
  */
289
- title: string;
633
+ plan: CreateInvoiceInputWithProductIDAndEmailAddress.Plan;
290
634
 
291
635
  /**
292
- * The ID of the product tax code to apply to this product.
636
+ * The product ID to create this invoice for. Include this if you want to create an
637
+ * invoice for an existing product.
293
638
  */
294
- product_tax_code_id?: string | null;
639
+ product_id: string;
640
+
641
+ /**
642
+ * Whether or not to charge the customer a buyer fee.
643
+ */
644
+ charge_buyer_fee?: boolean | null;
645
+
646
+ /**
647
+ * The name of the customer to create this invoice for. This is required if you
648
+ * want to create an invoice for a customer who does not have a member of your
649
+ * company yet.
650
+ */
651
+ customer_name?: string | null;
652
+
653
+ /**
654
+ * The payment token ID to use for this invoice. If using charge_automatically, you
655
+ * must provide a payment_token.
656
+ */
657
+ payment_token_id?: string | null;
658
+ }
659
+
660
+ export namespace CreateInvoiceInputWithProductIDAndEmailAddress {
661
+ /**
662
+ * The properties of the plan to create for this invoice.
663
+ */
664
+ export interface Plan {
665
+ /**
666
+ * The interval at which the plan charges (renewal plans).
667
+ */
668
+ billing_period?: number | null;
669
+
670
+ /**
671
+ * An array of custom field objects.
672
+ */
673
+ custom_fields?: Array<Plan.CustomField> | null;
674
+
675
+ /**
676
+ * The description of the plan.
677
+ */
678
+ description?: string | null;
679
+
680
+ /**
681
+ * The interval at which the plan charges (expiration plans).
682
+ */
683
+ expiration_days?: number | null;
684
+
685
+ /**
686
+ * An additional amount charged upon first purchase. Use only if a one time payment
687
+ * OR you want to charge an additional amount on top of the renewal price. Provided
688
+ * as a number in dollars. Eg: 10.43 for $10.43
689
+ */
690
+ initial_price?: number | null;
691
+
692
+ /**
693
+ * A personal description or notes section for the business.
694
+ */
695
+ internal_notes?: string | null;
696
+
697
+ /**
698
+ * The type of plan that can be attached to an access pass
699
+ */
700
+ plan_type?: Shared.PlanType | null;
701
+
702
+ /**
703
+ * The methods of how a plan can be released.
704
+ */
705
+ release_method?: Shared.ReleaseMethod | null;
706
+
707
+ /**
708
+ * The amount the customer is charged every billing period. Use only if a recurring
709
+ * payment. Provided as a number in dollars. Eg: 10.43 for $10.43
710
+ */
711
+ renewal_price?: number | null;
712
+
713
+ /**
714
+ * The number of units available for purchase.
715
+ */
716
+ stock?: number | null;
717
+
718
+ /**
719
+ * The number of free trial days added before a renewal plan.
720
+ */
721
+ trial_period_days?: number | null;
722
+
723
+ /**
724
+ * Limits/doesn't limit the number of units available for purchase.
725
+ */
726
+ unlimited_stock?: boolean | null;
727
+
728
+ /**
729
+ * Visibility of a resource
730
+ */
731
+ visibility?: Shared.Visibility | null;
732
+ }
733
+
734
+ export namespace Plan {
735
+ export interface CustomField {
736
+ /**
737
+ * The type of the custom field.
738
+ */
739
+ field_type: 'text';
740
+
741
+ /**
742
+ * The name of the custom field.
743
+ */
744
+ name: string;
745
+
746
+ /**
747
+ * The ID of the custom field (if being updated)
748
+ */
749
+ id?: string | null;
750
+
751
+ /**
752
+ * The order of the field.
753
+ */
754
+ order?: number | null;
755
+
756
+ /**
757
+ * The placeholder value of the field.
758
+ */
759
+ placeholder?: string | null;
760
+
761
+ /**
762
+ * Whether or not the field is required.
763
+ */
764
+ required?: boolean | null;
765
+ }
766
+ }
295
767
  }
296
768
  }
297
769
 
@@ -356,7 +828,6 @@ export namespace InvoiceListParams {
356
828
 
357
829
  export declare namespace Invoices {
358
830
  export {
359
- type InvoiceCreateResponse as InvoiceCreateResponse,
360
831
  type InvoiceVoidResponse as InvoiceVoidResponse,
361
832
  type InvoiceCreateParams as InvoiceCreateParams,
362
833
  type InvoiceListParams as InvoiceListParams,