@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.
Files changed (165) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/client.d.mts +14 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/access-tokens.d.mts +58 -0
  12. package/resources/access-tokens.d.mts.map +1 -0
  13. package/resources/access-tokens.d.ts +58 -0
  14. package/resources/access-tokens.d.ts.map +1 -0
  15. package/resources/access-tokens.js +25 -0
  16. package/resources/access-tokens.js.map +1 -0
  17. package/resources/access-tokens.mjs +21 -0
  18. package/resources/access-tokens.mjs.map +1 -0
  19. package/resources/app-builds.d.mts +16 -13
  20. package/resources/app-builds.d.mts.map +1 -1
  21. package/resources/app-builds.d.ts +16 -13
  22. package/resources/app-builds.d.ts.map +1 -1
  23. package/resources/app-builds.js +1 -1
  24. package/resources/app-builds.mjs +1 -1
  25. package/resources/apps.d.mts +15 -10
  26. package/resources/apps.d.mts.map +1 -1
  27. package/resources/apps.d.ts +15 -10
  28. package/resources/apps.d.ts.map +1 -1
  29. package/resources/checkout-configurations.d.mts +221 -183
  30. package/resources/checkout-configurations.d.mts.map +1 -1
  31. package/resources/checkout-configurations.d.ts +221 -183
  32. package/resources/checkout-configurations.d.ts.map +1 -1
  33. package/resources/checkout-configurations.js +4 -20
  34. package/resources/checkout-configurations.js.map +1 -1
  35. package/resources/checkout-configurations.mjs +4 -20
  36. package/resources/checkout-configurations.mjs.map +1 -1
  37. package/resources/companies.d.mts +157 -0
  38. package/resources/companies.d.mts.map +1 -1
  39. package/resources/companies.d.ts +157 -0
  40. package/resources/companies.d.ts.map +1 -1
  41. package/resources/companies.js +22 -0
  42. package/resources/companies.js.map +1 -1
  43. package/resources/companies.mjs +22 -0
  44. package/resources/companies.mjs.map +1 -1
  45. package/resources/course-lesson-interactions.d.mts +2 -2
  46. package/resources/course-lesson-interactions.d.ts +2 -2
  47. package/resources/course-lesson-interactions.js +2 -2
  48. package/resources/course-lesson-interactions.mjs +2 -2
  49. package/resources/course-lessons.d.mts +184 -24
  50. package/resources/course-lessons.d.mts.map +1 -1
  51. package/resources/course-lessons.d.ts +184 -24
  52. package/resources/course-lessons.d.ts.map +1 -1
  53. package/resources/course-students.d.mts +187 -0
  54. package/resources/course-students.d.mts.map +1 -0
  55. package/resources/course-students.d.ts +187 -0
  56. package/resources/course-students.d.ts.map +1 -0
  57. package/resources/course-students.js +36 -0
  58. package/resources/course-students.js.map +1 -0
  59. package/resources/course-students.mjs +32 -0
  60. package/resources/course-students.mjs.map +1 -0
  61. package/resources/courses.d.mts +85 -21
  62. package/resources/courses.d.mts.map +1 -1
  63. package/resources/courses.d.ts +85 -21
  64. package/resources/courses.d.ts.map +1 -1
  65. package/resources/entries.d.mts +2 -2
  66. package/resources/entries.d.ts +2 -2
  67. package/resources/experiences.d.mts +15 -10
  68. package/resources/experiences.d.mts.map +1 -1
  69. package/resources/experiences.d.ts +15 -10
  70. package/resources/experiences.d.ts.map +1 -1
  71. package/resources/forum-posts.d.mts +29 -19
  72. package/resources/forum-posts.d.mts.map +1 -1
  73. package/resources/forum-posts.d.ts +29 -19
  74. package/resources/forum-posts.d.ts.map +1 -1
  75. package/resources/index.d.mts +6 -4
  76. package/resources/index.d.mts.map +1 -1
  77. package/resources/index.d.ts +6 -4
  78. package/resources/index.d.ts.map +1 -1
  79. package/resources/index.js +5 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs +3 -1
  82. package/resources/index.mjs.map +1 -1
  83. package/resources/invoices.d.mts +539 -167
  84. package/resources/invoices.d.mts.map +1 -1
  85. package/resources/invoices.d.ts +539 -167
  86. package/resources/invoices.d.ts.map +1 -1
  87. package/resources/invoices.js +2 -24
  88. package/resources/invoices.js.map +1 -1
  89. package/resources/invoices.mjs +2 -24
  90. package/resources/invoices.mjs.map +1 -1
  91. package/resources/ledger-accounts.d.mts +1 -1
  92. package/resources/ledger-accounts.d.ts +1 -1
  93. package/resources/ledger-accounts.js +1 -1
  94. package/resources/ledger-accounts.mjs +1 -1
  95. package/resources/members.d.mts +11 -11
  96. package/resources/members.d.mts.map +1 -1
  97. package/resources/members.d.ts +11 -11
  98. package/resources/members.d.ts.map +1 -1
  99. package/resources/memberships.d.mts +4 -4
  100. package/resources/memberships.d.mts.map +1 -1
  101. package/resources/memberships.d.ts +4 -4
  102. package/resources/memberships.d.ts.map +1 -1
  103. package/resources/messages.d.mts +29 -19
  104. package/resources/messages.d.mts.map +1 -1
  105. package/resources/messages.d.ts +29 -19
  106. package/resources/messages.d.ts.map +1 -1
  107. package/resources/payments.d.mts +10 -3
  108. package/resources/payments.d.mts.map +1 -1
  109. package/resources/payments.d.ts +10 -3
  110. package/resources/payments.d.ts.map +1 -1
  111. package/resources/plans.d.mts +118 -20
  112. package/resources/plans.d.mts.map +1 -1
  113. package/resources/plans.d.ts +118 -20
  114. package/resources/plans.d.ts.map +1 -1
  115. package/resources/plans.js.map +1 -1
  116. package/resources/plans.mjs.map +1 -1
  117. package/resources/products.d.mts +20 -15
  118. package/resources/products.d.mts.map +1 -1
  119. package/resources/products.d.ts +20 -15
  120. package/resources/products.d.ts.map +1 -1
  121. package/resources/promo-codes.d.mts +4 -4
  122. package/resources/promo-codes.d.ts +4 -4
  123. package/resources/shared.d.mts +69 -20
  124. package/resources/shared.d.mts.map +1 -1
  125. package/resources/shared.d.ts +69 -20
  126. package/resources/shared.d.ts.map +1 -1
  127. package/resources/transfers.d.mts +12 -0
  128. package/resources/transfers.d.mts.map +1 -1
  129. package/resources/transfers.d.ts +12 -0
  130. package/resources/transfers.d.ts.map +1 -1
  131. package/resources/users.d.mts +3 -0
  132. package/resources/users.d.mts.map +1 -1
  133. package/resources/users.d.ts +3 -0
  134. package/resources/users.d.ts.map +1 -1
  135. package/src/client.ts +45 -10
  136. package/src/resources/access-tokens.ts +72 -0
  137. package/src/resources/app-builds.ts +19 -14
  138. package/src/resources/apps.ts +16 -11
  139. package/src/resources/checkout-configurations.ts +245 -199
  140. package/src/resources/companies.ts +196 -0
  141. package/src/resources/course-lesson-interactions.ts +2 -2
  142. package/src/resources/course-lessons.ts +223 -24
  143. package/src/resources/course-students.ts +238 -0
  144. package/src/resources/courses.ts +104 -22
  145. package/src/resources/entries.ts +2 -2
  146. package/src/resources/experiences.ts +19 -11
  147. package/src/resources/forum-posts.ts +35 -21
  148. package/src/resources/index.ts +17 -2
  149. package/src/resources/invoices.ts +630 -171
  150. package/src/resources/ledger-accounts.ts +1 -1
  151. package/src/resources/members.ts +12 -12
  152. package/src/resources/memberships.ts +5 -5
  153. package/src/resources/messages.ts +35 -21
  154. package/src/resources/payments.ts +10 -3
  155. package/src/resources/plans.ts +130 -20
  156. package/src/resources/products.ts +24 -16
  157. package/src/resources/promo-codes.ts +4 -4
  158. package/src/resources/shared.ts +70 -20
  159. package/src/resources/transfers.ts +10 -0
  160. package/src/resources/users.ts +3 -0
  161. package/src/version.ts +1 -1
  162. package/version.d.mts +1 -1
  163. package/version.d.ts +1 -1
  164. package/version.js +1 -1
  165. 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 a product
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
+ }
248
+
249
+ /**
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.
252
+ */
253
+ export interface Product {
254
+ /**
255
+ * The title of the product.
256
+ */
257
+ title: string;
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 {
267
+ /**
268
+ * The method of collection for this invoice. If using charge_automatically, you
269
+ * must provide a payment_token.
270
+ */
271
+ collection_method: Shared.CollectionMethod;
272
+
273
+ /**
274
+ * The company ID to create this invoice for.
275
+ */
276
+ company_id: string;
277
+
278
+ /**
279
+ * The date the invoice is due, if applicable.
280
+ */
281
+ due_date: string;
282
+
283
+ /**
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.
286
+ */
287
+ email_address: string;
288
+
289
+ /**
290
+ * The properties of the plan to create for this invoice.
291
+ */
292
+ plan: CreateInvoiceInputWithProductAndEmailAddress.Plan;
293
+
294
+ /**
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.
297
+ */
298
+ product: CreateInvoiceInputWithProductAndEmailAddress.Product;
182
299
 
183
- export namespace InvoiceCreateParams {
184
- /**
185
- * The properties of the plan to create for this invoice.
186
- */
187
- export interface Plan {
188
300
  /**
189
- * The interval at which the plan charges (renewal plans).
301
+ * Whether or not to charge the customer a buyer fee.
190
302
  */
191
- billing_period?: number | null;
303
+ charge_buyer_fee?: boolean | null;
304
+
305
+ /**
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.
309
+ */
310
+ customer_name?: string | null;
311
+
312
+ /**
313
+ * The payment token ID to use for this invoice. If using charge_automatically, you
314
+ * must provide a payment_token.
315
+ */
316
+ payment_token_id?: string | null;
317
+ }
318
+
319
+ export namespace CreateInvoiceInputWithProductAndEmailAddress {
320
+ /**
321
+ * The properties of the plan to create for this invoice.
322
+ */
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 a product
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
+ }
192
426
 
193
427
  /**
194
- * An array of custom field objects.
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.
195
430
  */
196
- custom_fields?: Array<Plan.CustomField> | null;
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
+ }
197
443
 
444
+ export interface CreateInvoiceInputWithProductIDAndMemberID {
198
445
  /**
199
- * The description of the plan.
446
+ * The method of collection for this invoice. If using charge_automatically, you
447
+ * must provide a payment_token.
200
448
  */
201
- description?: string | null;
449
+ collection_method: Shared.CollectionMethod;
202
450
 
203
451
  /**
204
- * The interval at which the plan charges (expiration plans).
452
+ * The company ID to create this invoice for.
205
453
  */
206
- expiration_days?: number | null;
454
+ company_id: string;
207
455
 
208
456
  /**
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
457
+ * The date the invoice is due, if applicable.
212
458
  */
213
- initial_price?: number | null;
459
+ due_date: string;
214
460
 
215
461
  /**
216
- * A personal description or notes section for the business.
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.
217
465
  */
218
- internal_notes?: string | null;
466
+ member_id: string;
219
467
 
220
468
  /**
221
- * The type of plan that can be attached to an access pass
469
+ * The properties of the plan to create for this invoice.
222
470
  */
223
- plan_type?: Shared.PlanType | null;
471
+ plan: CreateInvoiceInputWithProductIDAndMemberID.Plan;
224
472
 
225
473
  /**
226
- * The methods of how a plan can be released.
474
+ * The product ID to create this invoice for. Include this if you want to create an
475
+ * invoice for an existing product.
227
476
  */
228
- release_method?: Shared.ReleaseMethod | null;
477
+ product_id: string;
229
478
 
230
479
  /**
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
480
+ * Whether or not to charge the customer a buyer fee.
233
481
  */
234
- renewal_price?: number | null;
482
+ charge_buyer_fee?: boolean | null;
235
483
 
236
484
  /**
237
- * The number of free trial days added before a renewal plan.
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.
238
488
  */
239
- trial_period_days?: number | null;
489
+ customer_name?: string | null;
240
490
 
241
491
  /**
242
- * Visibility of a resource
492
+ * The payment token ID to use for this invoice. If using charge_automatically, you
493
+ * must provide a payment_token.
243
494
  */
244
- visibility?: Shared.Visibility | null;
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 a product
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
+
630
+ /**
631
+ * The properties of the plan to create for this invoice.
632
+ */
633
+ plan: CreateInvoiceInputWithProductIDAndEmailAddress.Plan;
634
+
635
+ /**
636
+ * The product ID to create this invoice for. Include this if you want to create an
637
+ * invoice for an existing product.
638
+ */
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
+
286
653
  /**
287
- * The title of the product.
654
+ * The payment token ID to use for this invoice. If using charge_automatically, you
655
+ * must provide a payment_token.
288
656
  */
289
- title: string;
657
+ payment_token_id?: string | null;
658
+ }
290
659
 
660
+ export namespace CreateInvoiceInputWithProductIDAndEmailAddress {
291
661
  /**
292
- * The ID of the product tax code to apply to this product.
662
+ * The properties of the plan to create for this invoice.
293
663
  */
294
- product_tax_code_id?: string | null;
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 a product
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
 
@@ -307,14 +779,14 @@ export interface InvoiceListParams extends CursorPageParams {
307
779
  before?: string | null;
308
780
 
309
781
  /**
310
- * The direction of the sort.
782
+ * Filter invoices by their collection method
311
783
  */
312
- direction?: Shared.Direction | null;
784
+ collection_methods?: Array<Shared.CollectionMethod> | null;
313
785
 
314
786
  /**
315
- * The filters to apply to the invoices
787
+ * The direction of the sort.
316
788
  */
317
- filters?: InvoiceListParams.Filters | null;
789
+ direction?: Shared.Direction | null;
318
790
 
319
791
  /**
320
792
  * Returns the first _n_ elements from the list.
@@ -330,33 +802,20 @@ export interface InvoiceListParams extends CursorPageParams {
330
802
  * Which columns can be used to sort.
331
803
  */
332
804
  order?: 'id' | 'created_at' | 'due_date' | null;
333
- }
334
805
 
335
- export namespace InvoiceListParams {
336
806
  /**
337
- * The filters to apply to the invoices
807
+ * Return only invoices created for these specific product ids
338
808
  */
339
- export interface Filters {
340
- /**
341
- * The access pass IDs to filter the invoices by
342
- */
343
- access_pass_ids?: Array<string> | null;
809
+ product_ids?: Array<string> | null;
344
810
 
345
- /**
346
- * The collection methods to filter the invoices by
347
- */
348
- collection_methods?: Array<Shared.CollectionMethod> | null;
349
-
350
- /**
351
- * The statuses to filter the invoices by
352
- */
353
- statuses?: Array<Shared.InvoiceStatus> | null;
354
- }
811
+ /**
812
+ * The statuses to filter the invoices by
813
+ */
814
+ statuses?: Array<Shared.InvoiceStatus> | null;
355
815
  }
356
816
 
357
817
  export declare namespace Invoices {
358
818
  export {
359
- type InvoiceCreateResponse as InvoiceCreateResponse,
360
819
  type InvoiceVoidResponse as InvoiceVoidResponse,
361
820
  type InvoiceCreateParams as InvoiceCreateParams,
362
821
  type InvoiceListParams as InvoiceListParams,