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