@whop/sdk 0.0.24 → 0.0.26

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 (181) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +30 -18
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +30 -18
  6. package/client.d.ts.map +1 -1
  7. package/client.js +15 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +17 -4
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/ai-chats.d.mts +169 -0
  19. package/resources/ai-chats.d.mts.map +1 -0
  20. package/resources/ai-chats.d.ts +169 -0
  21. package/resources/ai-chats.d.ts.map +1 -0
  22. package/resources/ai-chats.js +53 -0
  23. package/resources/ai-chats.js.map +1 -0
  24. package/resources/ai-chats.mjs +49 -0
  25. package/resources/ai-chats.mjs.map +1 -0
  26. package/resources/apps.d.mts +1 -1
  27. package/resources/apps.d.mts.map +1 -1
  28. package/resources/apps.d.ts +1 -1
  29. package/resources/apps.d.ts.map +1 -1
  30. package/resources/authorized-users.d.mts +39 -5
  31. package/resources/authorized-users.d.mts.map +1 -1
  32. package/resources/authorized-users.d.ts +39 -5
  33. package/resources/authorized-users.d.ts.map +1 -1
  34. package/resources/authorized-users.js +1 -1
  35. package/resources/authorized-users.js.map +1 -1
  36. package/resources/authorized-users.mjs +1 -1
  37. package/resources/authorized-users.mjs.map +1 -1
  38. package/resources/checkout-configurations.d.mts +12 -0
  39. package/resources/checkout-configurations.d.mts.map +1 -1
  40. package/resources/checkout-configurations.d.ts +12 -0
  41. package/resources/checkout-configurations.d.ts.map +1 -1
  42. package/resources/company-token-transactions.d.mts +339 -0
  43. package/resources/company-token-transactions.d.mts.map +1 -0
  44. package/resources/company-token-transactions.d.ts +339 -0
  45. package/resources/company-token-transactions.d.ts.map +1 -0
  46. package/resources/company-token-transactions.js +59 -0
  47. package/resources/company-token-transactions.js.map +1 -0
  48. package/resources/company-token-transactions.mjs +55 -0
  49. package/resources/company-token-transactions.mjs.map +1 -0
  50. package/resources/dm-channels.d.mts +161 -0
  51. package/resources/dm-channels.d.mts.map +1 -0
  52. package/resources/dm-channels.d.ts +161 -0
  53. package/resources/dm-channels.d.ts.map +1 -0
  54. package/resources/dm-channels.js +87 -0
  55. package/resources/dm-channels.js.map +1 -0
  56. package/resources/dm-channels.mjs +83 -0
  57. package/resources/dm-channels.mjs.map +1 -0
  58. package/resources/dm-members.d.mts +190 -0
  59. package/resources/dm-members.d.mts.map +1 -0
  60. package/resources/dm-members.d.ts +190 -0
  61. package/resources/dm-members.d.ts.map +1 -0
  62. package/resources/dm-members.js +94 -0
  63. package/resources/dm-members.js.map +1 -0
  64. package/resources/dm-members.mjs +90 -0
  65. package/resources/dm-members.mjs.map +1 -0
  66. package/resources/files.d.mts +7 -3
  67. package/resources/files.d.mts.map +1 -1
  68. package/resources/files.d.ts +7 -3
  69. package/resources/files.d.ts.map +1 -1
  70. package/resources/index.d.mts +13 -9
  71. package/resources/index.d.mts.map +1 -1
  72. package/resources/index.d.ts +13 -9
  73. package/resources/index.d.ts.map +1 -1
  74. package/resources/index.js +9 -1
  75. package/resources/index.js.map +1 -1
  76. package/resources/index.mjs +6 -2
  77. package/resources/index.mjs.map +1 -1
  78. package/resources/leads.d.mts +9 -177
  79. package/resources/leads.d.mts.map +1 -1
  80. package/resources/leads.d.ts +9 -177
  81. package/resources/leads.d.ts.map +1 -1
  82. package/resources/ledger-accounts.d.mts +3 -2
  83. package/resources/ledger-accounts.d.mts.map +1 -1
  84. package/resources/ledger-accounts.d.ts +3 -2
  85. package/resources/ledger-accounts.d.ts.map +1 -1
  86. package/resources/ledger-accounts.js.map +1 -1
  87. package/resources/ledger-accounts.mjs.map +1 -1
  88. package/resources/members.d.mts +13 -5
  89. package/resources/members.d.mts.map +1 -1
  90. package/resources/members.d.ts +13 -5
  91. package/resources/members.d.ts.map +1 -1
  92. package/resources/members.js +1 -1
  93. package/resources/members.js.map +1 -1
  94. package/resources/members.mjs +1 -1
  95. package/resources/members.mjs.map +1 -1
  96. package/resources/memberships.d.mts +32 -2
  97. package/resources/memberships.d.mts.map +1 -1
  98. package/resources/memberships.d.ts +32 -2
  99. package/resources/memberships.d.ts.map +1 -1
  100. package/resources/memberships.js +18 -0
  101. package/resources/memberships.js.map +1 -1
  102. package/resources/memberships.mjs +18 -0
  103. package/resources/memberships.mjs.map +1 -1
  104. package/resources/messages.d.mts +17 -1
  105. package/resources/messages.d.mts.map +1 -1
  106. package/resources/messages.d.ts +17 -1
  107. package/resources/messages.d.ts.map +1 -1
  108. package/resources/messages.js +10 -0
  109. package/resources/messages.js.map +1 -1
  110. package/resources/messages.mjs +10 -0
  111. package/resources/messages.mjs.map +1 -1
  112. package/resources/payments.d.mts +42 -1
  113. package/resources/payments.d.mts.map +1 -1
  114. package/resources/payments.d.ts +42 -1
  115. package/resources/payments.d.ts.map +1 -1
  116. package/resources/payout-methods.d.mts +26 -3
  117. package/resources/payout-methods.d.mts.map +1 -1
  118. package/resources/payout-methods.d.ts +26 -3
  119. package/resources/payout-methods.d.ts.map +1 -1
  120. package/resources/payout-methods.js.map +1 -1
  121. package/resources/payout-methods.mjs.map +1 -1
  122. package/resources/reactions.d.mts +24 -1
  123. package/resources/reactions.d.mts.map +1 -1
  124. package/resources/reactions.d.ts +24 -1
  125. package/resources/reactions.d.ts.map +1 -1
  126. package/resources/reactions.js +11 -0
  127. package/resources/reactions.js.map +1 -1
  128. package/resources/reactions.mjs +11 -0
  129. package/resources/reactions.mjs.map +1 -1
  130. package/resources/refunds.d.mts +1 -1
  131. package/resources/refunds.d.mts.map +1 -1
  132. package/resources/refunds.d.ts +1 -1
  133. package/resources/refunds.d.ts.map +1 -1
  134. package/resources/shared.d.mts +73 -1
  135. package/resources/shared.d.mts.map +1 -1
  136. package/resources/shared.d.ts +73 -1
  137. package/resources/shared.d.ts.map +1 -1
  138. package/resources/verifications.d.mts +11 -3
  139. package/resources/verifications.d.mts.map +1 -1
  140. package/resources/verifications.d.ts +11 -3
  141. package/resources/verifications.d.ts.map +1 -1
  142. package/resources/webhooks.d.mts +43 -293
  143. package/resources/webhooks.d.mts.map +1 -1
  144. package/resources/webhooks.d.ts +43 -293
  145. package/resources/webhooks.d.ts.map +1 -1
  146. package/resources/webhooks.js.map +1 -1
  147. package/resources/webhooks.mjs +2 -2
  148. package/resources/webhooks.mjs.map +1 -1
  149. package/resources/withdrawals.d.mts +21 -128
  150. package/resources/withdrawals.d.mts.map +1 -1
  151. package/resources/withdrawals.d.ts +21 -128
  152. package/resources/withdrawals.d.ts.map +1 -1
  153. package/src/client.ts +133 -18
  154. package/src/internal/parse.ts +6 -0
  155. package/src/resources/ai-chats.ts +227 -0
  156. package/src/resources/apps.ts +6 -0
  157. package/src/resources/authorized-users.ts +45 -5
  158. package/src/resources/checkout-configurations.ts +15 -0
  159. package/src/resources/company-token-transactions.ts +433 -0
  160. package/src/resources/dm-channels.ts +212 -0
  161. package/src/resources/dm-members.ts +248 -0
  162. package/src/resources/files.ts +8 -2
  163. package/src/resources/index.ts +64 -9
  164. package/src/resources/leads.ts +9 -205
  165. package/src/resources/ledger-accounts.ts +3 -35
  166. package/src/resources/members.ts +16 -6
  167. package/src/resources/memberships.ts +45 -9
  168. package/src/resources/messages.ts +22 -0
  169. package/src/resources/payments.ts +109 -57
  170. package/src/resources/payout-methods.ts +37 -2
  171. package/src/resources/reactions.ts +36 -0
  172. package/src/resources/refunds.ts +2 -1
  173. package/src/resources/shared.ts +110 -11
  174. package/src/resources/verifications.ts +49 -36
  175. package/src/resources/webhooks.ts +78 -728
  176. package/src/resources/withdrawals.ts +29 -205
  177. package/src/version.ts +1 -1
  178. package/version.d.mts +1 -1
  179. package/version.d.ts +1 -1
  180. package/version.js +1 -1
  181. package/version.mjs +1 -1
@@ -3,11 +3,13 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as DisputesAPI from './disputes';
5
5
  import * as PaymentsAPI from './payments';
6
+ import * as PayoutMethodsAPI from './payout-methods';
6
7
  import * as RefundsAPI from './refunds';
7
8
  import * as SetupIntentsAPI from './setup-intents';
8
9
  import * as Shared from './shared';
10
+ import * as VerificationsAPI from './verifications';
9
11
  import * as WithdrawalsAPI from './withdrawals';
10
- import { Webhook } from 'standardwebhooks';
12
+ import { Webhook as Webhook_ } from 'standardwebhooks';
11
13
  import { APIPromise } from '../core/api-promise';
12
14
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
13
15
  import { RequestOptions } from '../internal/request-options';
@@ -46,7 +48,7 @@ export class Webhooks extends APIResource {
46
48
  * );
47
49
  * ```
48
50
  */
49
- retrieve(id: string, options?: RequestOptions): APIPromise<WebhookRetrieveResponse> {
51
+ retrieve(id: string, options?: RequestOptions): APIPromise<Webhook> {
50
52
  return this._client.get(path`/webhooks/${id}`, options);
51
53
  }
52
54
 
@@ -68,7 +70,7 @@ export class Webhooks extends APIResource {
68
70
  id: string,
69
71
  body: WebhookUpdateParams | null | undefined = {},
70
72
  options?: RequestOptions,
71
- ): APIPromise<WebhookUpdateResponse> {
73
+ ): APIPromise<Webhook> {
72
74
  return this._client.patch(path`/webhooks/${id}`, { body, ...options });
73
75
  }
74
76
 
@@ -121,7 +123,7 @@ export class Webhooks extends APIResource {
121
123
  if (headers !== undefined) {
122
124
  const keyStr: string | null = key === undefined ? this._client.webhookKey : key;
123
125
  if (keyStr === null) throw new Error('Webhook key must not be null in order to unwrap');
124
- const wh = new Webhook(keyStr);
126
+ const wh = new Webhook_(keyStr);
125
127
  wh.verify(body, headers);
126
128
  }
127
129
  return JSON.parse(body) as UnwrapWebhookEvent;
@@ -131,122 +133,14 @@ export class Webhooks extends APIResource {
131
133
  export type WebhookListResponsesCursorPage = CursorPage<WebhookListResponse>;
132
134
 
133
135
  /**
134
- * A webhook object, which can be configured to be sent updates about a company
136
+ * The different API versions
135
137
  */
136
- export interface WebhookCreateResponse {
137
- /**
138
- * The ID of the webhook
139
- */
140
- id: string;
141
-
142
- /**
143
- * The API version for this webhook
144
- */
145
- api_version: 'v1' | 'v2' | 'v5';
146
-
147
- /**
148
- * Whether or not to send events for child resources. For example, if the webhook
149
- * is created for a Company, enabling this will only send events from the Company's
150
- * sub-merchants (child companies).
151
- */
152
- child_resource_events: boolean;
153
-
154
- /**
155
- * The timestamp of when the webhook was created
156
- */
157
- created_at: string;
158
-
159
- /**
160
- * Whether or not this webhook is turned on or not
161
- */
162
- enabled: boolean;
163
-
164
- /**
165
- * The number of events this webhooks is configured to receive
166
- */
167
- events: Array<
168
- | 'invoice.created'
169
- | 'invoice.paid'
170
- | 'invoice.past_due'
171
- | 'invoice.voided'
172
- | 'membership.activated'
173
- | 'membership.deactivated'
174
- | 'entry.created'
175
- | 'entry.approved'
176
- | 'entry.denied'
177
- | 'entry.deleted'
178
- | 'setup_intent.requires_action'
179
- | 'setup_intent.succeeded'
180
- | 'setup_intent.canceled'
181
- | 'withdrawal.created'
182
- | 'withdrawal.updated'
183
- | 'course_lesson_interaction.completed'
184
- | 'payout_method.created'
185
- | 'verification.succeeded'
186
- | 'payment.created'
187
- | 'payment.succeeded'
188
- | 'payment.failed'
189
- | 'payment.pending'
190
- | 'dispute.created'
191
- | 'dispute.updated'
192
- | 'refund.created'
193
- | 'refund.updated'
194
- | 'membership.cancel_at_period_end_changed'
195
- >;
196
-
197
- /**
198
- * The resource ID
199
- */
200
- resource_id: string;
201
-
202
- /**
203
- * The list of events that can be tested with this webhook
204
- */
205
- testable_events: Array<
206
- | 'invoice.created'
207
- | 'invoice.paid'
208
- | 'invoice.past_due'
209
- | 'invoice.voided'
210
- | 'membership.activated'
211
- | 'membership.deactivated'
212
- | 'entry.created'
213
- | 'entry.approved'
214
- | 'entry.denied'
215
- | 'entry.deleted'
216
- | 'setup_intent.requires_action'
217
- | 'setup_intent.succeeded'
218
- | 'setup_intent.canceled'
219
- | 'withdrawal.created'
220
- | 'withdrawal.updated'
221
- | 'course_lesson_interaction.completed'
222
- | 'payout_method.created'
223
- | 'verification.succeeded'
224
- | 'payment.created'
225
- | 'payment.succeeded'
226
- | 'payment.failed'
227
- | 'payment.pending'
228
- | 'dispute.created'
229
- | 'dispute.updated'
230
- | 'refund.created'
231
- | 'refund.updated'
232
- | 'membership.cancel_at_period_end_changed'
233
- >;
234
-
235
- /**
236
- * The URL the webhook events will be sent to
237
- */
238
- url: string;
239
-
240
- /**
241
- * A unique secret key that will be sent with each webhook event
242
- */
243
- webhook_secret: string;
244
- }
138
+ export type APIVersion = 'v1' | 'v2' | 'v5';
245
139
 
246
140
  /**
247
141
  * A webhook object, which can be configured to be sent updates about a company
248
142
  */
249
- export interface WebhookRetrieveResponse {
143
+ export interface Webhook {
250
144
  /**
251
145
  * The ID of the webhook
252
146
  */
@@ -255,7 +149,7 @@ export interface WebhookRetrieveResponse {
255
149
  /**
256
150
  * The API version for this webhook
257
151
  */
258
- api_version: 'v1' | 'v2' | 'v5';
152
+ api_version: APIVersion;
259
153
 
260
154
  /**
261
155
  * Whether or not to send events for child resources. For example, if the webhook
@@ -277,35 +171,7 @@ export interface WebhookRetrieveResponse {
277
171
  /**
278
172
  * The number of events this webhooks is configured to receive
279
173
  */
280
- events: Array<
281
- | 'invoice.created'
282
- | 'invoice.paid'
283
- | 'invoice.past_due'
284
- | 'invoice.voided'
285
- | 'membership.activated'
286
- | 'membership.deactivated'
287
- | 'entry.created'
288
- | 'entry.approved'
289
- | 'entry.denied'
290
- | 'entry.deleted'
291
- | 'setup_intent.requires_action'
292
- | 'setup_intent.succeeded'
293
- | 'setup_intent.canceled'
294
- | 'withdrawal.created'
295
- | 'withdrawal.updated'
296
- | 'course_lesson_interaction.completed'
297
- | 'payout_method.created'
298
- | 'verification.succeeded'
299
- | 'payment.created'
300
- | 'payment.succeeded'
301
- | 'payment.failed'
302
- | 'payment.pending'
303
- | 'dispute.created'
304
- | 'dispute.updated'
305
- | 'refund.created'
306
- | 'refund.updated'
307
- | 'membership.cancel_at_period_end_changed'
308
- >;
174
+ events: Array<WebhookEvent>;
309
175
 
310
176
  /**
311
177
  * The resource ID
@@ -315,35 +181,7 @@ export interface WebhookRetrieveResponse {
315
181
  /**
316
182
  * The list of events that can be tested with this webhook
317
183
  */
318
- testable_events: Array<
319
- | 'invoice.created'
320
- | 'invoice.paid'
321
- | 'invoice.past_due'
322
- | 'invoice.voided'
323
- | 'membership.activated'
324
- | 'membership.deactivated'
325
- | 'entry.created'
326
- | 'entry.approved'
327
- | 'entry.denied'
328
- | 'entry.deleted'
329
- | 'setup_intent.requires_action'
330
- | 'setup_intent.succeeded'
331
- | 'setup_intent.canceled'
332
- | 'withdrawal.created'
333
- | 'withdrawal.updated'
334
- | 'course_lesson_interaction.completed'
335
- | 'payout_method.created'
336
- | 'verification.succeeded'
337
- | 'payment.created'
338
- | 'payment.succeeded'
339
- | 'payment.failed'
340
- | 'payment.pending'
341
- | 'dispute.created'
342
- | 'dispute.updated'
343
- | 'refund.created'
344
- | 'refund.updated'
345
- | 'membership.cancel_at_period_end_changed'
346
- >;
184
+ testable_events: Array<WebhookEvent>;
347
185
 
348
186
  /**
349
187
  * The URL the webhook events will be sent to
@@ -351,10 +189,42 @@ export interface WebhookRetrieveResponse {
351
189
  url: string;
352
190
  }
353
191
 
192
+ /**
193
+ * The different event types available
194
+ */
195
+ export type WebhookEvent =
196
+ | 'invoice.created'
197
+ | 'invoice.paid'
198
+ | 'invoice.past_due'
199
+ | 'invoice.voided'
200
+ | 'membership.activated'
201
+ | 'membership.deactivated'
202
+ | 'entry.created'
203
+ | 'entry.approved'
204
+ | 'entry.denied'
205
+ | 'entry.deleted'
206
+ | 'setup_intent.requires_action'
207
+ | 'setup_intent.succeeded'
208
+ | 'setup_intent.canceled'
209
+ | 'withdrawal.created'
210
+ | 'withdrawal.updated'
211
+ | 'course_lesson_interaction.completed'
212
+ | 'payout_method.created'
213
+ | 'verification.succeeded'
214
+ | 'payment.created'
215
+ | 'payment.succeeded'
216
+ | 'payment.failed'
217
+ | 'payment.pending'
218
+ | 'dispute.created'
219
+ | 'dispute.updated'
220
+ | 'refund.created'
221
+ | 'refund.updated'
222
+ | 'membership.cancel_at_period_end_changed';
223
+
354
224
  /**
355
225
  * A webhook object, which can be configured to be sent updates about a company
356
226
  */
357
- export interface WebhookUpdateResponse {
227
+ export interface WebhookCreateResponse {
358
228
  /**
359
229
  * The ID of the webhook
360
230
  */
@@ -363,7 +233,7 @@ export interface WebhookUpdateResponse {
363
233
  /**
364
234
  * The API version for this webhook
365
235
  */
366
- api_version: 'v1' | 'v2' | 'v5';
236
+ api_version: APIVersion;
367
237
 
368
238
  /**
369
239
  * Whether or not to send events for child resources. For example, if the webhook
@@ -385,35 +255,7 @@ export interface WebhookUpdateResponse {
385
255
  /**
386
256
  * The number of events this webhooks is configured to receive
387
257
  */
388
- events: Array<
389
- | 'invoice.created'
390
- | 'invoice.paid'
391
- | 'invoice.past_due'
392
- | 'invoice.voided'
393
- | 'membership.activated'
394
- | 'membership.deactivated'
395
- | 'entry.created'
396
- | 'entry.approved'
397
- | 'entry.denied'
398
- | 'entry.deleted'
399
- | 'setup_intent.requires_action'
400
- | 'setup_intent.succeeded'
401
- | 'setup_intent.canceled'
402
- | 'withdrawal.created'
403
- | 'withdrawal.updated'
404
- | 'course_lesson_interaction.completed'
405
- | 'payout_method.created'
406
- | 'verification.succeeded'
407
- | 'payment.created'
408
- | 'payment.succeeded'
409
- | 'payment.failed'
410
- | 'payment.pending'
411
- | 'dispute.created'
412
- | 'dispute.updated'
413
- | 'refund.created'
414
- | 'refund.updated'
415
- | 'membership.cancel_at_period_end_changed'
416
- >;
258
+ events: Array<WebhookEvent>;
417
259
 
418
260
  /**
419
261
  * The resource ID
@@ -423,40 +265,17 @@ export interface WebhookUpdateResponse {
423
265
  /**
424
266
  * The list of events that can be tested with this webhook
425
267
  */
426
- testable_events: Array<
427
- | 'invoice.created'
428
- | 'invoice.paid'
429
- | 'invoice.past_due'
430
- | 'invoice.voided'
431
- | 'membership.activated'
432
- | 'membership.deactivated'
433
- | 'entry.created'
434
- | 'entry.approved'
435
- | 'entry.denied'
436
- | 'entry.deleted'
437
- | 'setup_intent.requires_action'
438
- | 'setup_intent.succeeded'
439
- | 'setup_intent.canceled'
440
- | 'withdrawal.created'
441
- | 'withdrawal.updated'
442
- | 'course_lesson_interaction.completed'
443
- | 'payout_method.created'
444
- | 'verification.succeeded'
445
- | 'payment.created'
446
- | 'payment.succeeded'
447
- | 'payment.failed'
448
- | 'payment.pending'
449
- | 'dispute.created'
450
- | 'dispute.updated'
451
- | 'refund.created'
452
- | 'refund.updated'
453
- | 'membership.cancel_at_period_end_changed'
454
- >;
268
+ testable_events: Array<WebhookEvent>;
455
269
 
456
270
  /**
457
271
  * The URL the webhook events will be sent to
458
272
  */
459
273
  url: string;
274
+
275
+ /**
276
+ * A unique secret key that will be sent with each webhook event
277
+ */
278
+ webhook_secret: string;
460
279
  }
461
280
 
462
281
  /**
@@ -471,7 +290,7 @@ export interface WebhookListResponse {
471
290
  /**
472
291
  * The API version for this webhook
473
292
  */
474
- api_version: 'v1' | 'v2' | 'v5';
293
+ api_version: APIVersion;
475
294
 
476
295
  /**
477
296
  * Whether or not to send events for child resources. For example, if the webhook
@@ -493,35 +312,7 @@ export interface WebhookListResponse {
493
312
  /**
494
313
  * The number of events this webhooks is configured to receive
495
314
  */
496
- events: Array<
497
- | 'invoice.created'
498
- | 'invoice.paid'
499
- | 'invoice.past_due'
500
- | 'invoice.voided'
501
- | 'membership.activated'
502
- | 'membership.deactivated'
503
- | 'entry.created'
504
- | 'entry.approved'
505
- | 'entry.denied'
506
- | 'entry.deleted'
507
- | 'setup_intent.requires_action'
508
- | 'setup_intent.succeeded'
509
- | 'setup_intent.canceled'
510
- | 'withdrawal.created'
511
- | 'withdrawal.updated'
512
- | 'course_lesson_interaction.completed'
513
- | 'payout_method.created'
514
- | 'verification.succeeded'
515
- | 'payment.created'
516
- | 'payment.succeeded'
517
- | 'payment.failed'
518
- | 'payment.pending'
519
- | 'dispute.created'
520
- | 'dispute.updated'
521
- | 'refund.created'
522
- | 'refund.updated'
523
- | 'membership.cancel_at_period_end_changed'
524
- >;
315
+ events: Array<WebhookEvent>;
525
316
 
526
317
  /**
527
318
  * The URL the webhook events will be sent to
@@ -969,7 +760,7 @@ export interface WithdrawalCreatedWebhookEvent {
969
760
  /**
970
761
  * A withdrawal request.
971
762
  */
972
- data: WithdrawalCreatedWebhookEvent.Data;
763
+ data: WithdrawalsAPI.Withdrawal;
973
764
 
974
765
  /**
975
766
  * The timestamp in ISO 8601 format that the webhook was sent at on the server
@@ -987,188 +778,6 @@ export interface WithdrawalCreatedWebhookEvent {
987
778
  company_id?: string | null;
988
779
  }
989
780
 
990
- export namespace WithdrawalCreatedWebhookEvent {
991
- /**
992
- * A withdrawal request.
993
- */
994
- export interface Data {
995
- /**
996
- * Internal ID of the withdrawal request.
997
- */
998
- id: string;
999
-
1000
- /**
1001
- * How much money was attempted to be withdrawn, in a float type.
1002
- */
1003
- amount: number;
1004
-
1005
- /**
1006
- * When the withdrawal request was created.
1007
- */
1008
- created_at: string;
1009
-
1010
- /**
1011
- * The currency of the withdrawal request.
1012
- */
1013
- currency: Shared.Currency;
1014
-
1015
- /**
1016
- * The different error codes a payout can be in.
1017
- */
1018
- error_code:
1019
- | 'account_closed'
1020
- | 'account_does_not_exist'
1021
- | 'account_information_invalid'
1022
- | 'account_number_invalid_region'
1023
- | 'account_frozen'
1024
- | 'account_lookup_failed'
1025
- | 'account_not_found'
1026
- | 'amount_out_of_bounds'
1027
- | 'attributes_not_validated'
1028
- | 'b2b_payments_prohibited'
1029
- | 'bank_statement_required'
1030
- | 'compliance_review'
1031
- | 'currency_not_supported'
1032
- | 'deposit_canceled'
1033
- | 'deposit_failed'
1034
- | 'deposit_rejected'
1035
- | 'destination_unavailable'
1036
- | 'exceeded_account_limit'
1037
- | 'expired_quote'
1038
- | 'generic_payout_error'
1039
- | 'technical_problem'
1040
- | 'identification_number_invalid'
1041
- | 'invalid_account_number'
1042
- | 'invalid_bank_code'
1043
- | 'invalid_beneficiary'
1044
- | 'invalid_mailing_address'
1045
- | 'invalid_branch_number'
1046
- | 'invalid_branch_code'
1047
- | 'invalid_phone_number'
1048
- | 'invalid_routing_number'
1049
- | 'invalid_swift_code'
1050
- | 'invalid_company_details'
1051
- | 'manual_cancelation'
1052
- | 'misc_error'
1053
- | 'missing_city_and_country'
1054
- | 'missing_phone_number'
1055
- | 'missing_remittance_info'
1056
- | 'payee_name_invalid'
1057
- | 'receiving_account_locked'
1058
- | 'rejected_by_compliance'
1059
- | 'rtp_not_supported'
1060
- | 'non_transaction_account'
1061
- | 'source_token_insufficient_funds'
1062
- | 'ssn_invalid'
1063
- | 'wallet_screenshot_required'
1064
- | 'unsupported_region'
1065
- | null;
1066
-
1067
- /**
1068
- * The error message for the withdrawal, if any.
1069
- */
1070
- error_message: string | null;
1071
-
1072
- /**
1073
- * The estimated availability date for the withdrawal, if any.
1074
- */
1075
- estimated_availability: string | null;
1076
-
1077
- /**
1078
- * The fee amount that was charged for the withdrawal. This is in the same currency
1079
- * as the withdrawal amount.
1080
- */
1081
- fee_amount: number;
1082
-
1083
- /**
1084
- * The different fee types for a withdrawal.
1085
- */
1086
- fee_type: WithdrawalsAPI.WithdrawalFeeTypes | null;
1087
-
1088
- /**
1089
- * The ledger account associated with the withdrawal.
1090
- */
1091
- ledger_account: Data.LedgerAccount;
1092
-
1093
- /**
1094
- * The markup fee that was charged for the withdrawal. This is in the same currency
1095
- * as the withdrawal amount. This only applies to platform accounts using Whop
1096
- * Rails.
1097
- */
1098
- markup_fee: number;
1099
-
1100
- /**
1101
- * The payout token used for the withdrawal, if applicable.
1102
- */
1103
- payout_token: Data.PayoutToken | null;
1104
-
1105
- /**
1106
- * The speed of the withdrawal.
1107
- */
1108
- speed: WithdrawalsAPI.WithdrawalSpeeds;
1109
-
1110
- /**
1111
- * Status of the withdrawal.
1112
- */
1113
- status: WithdrawalsAPI.WithdrawalStatus;
1114
-
1115
- /**
1116
- * The trace code for the payout, if applicable. Provided on ACH transactions when
1117
- * available.
1118
- */
1119
- trace_code: string | null;
1120
- }
1121
-
1122
- export namespace Data {
1123
- /**
1124
- * The ledger account associated with the withdrawal.
1125
- */
1126
- export interface LedgerAccount {
1127
- /**
1128
- * The ID of the LedgerAccount.
1129
- */
1130
- id: string;
1131
-
1132
- /**
1133
- * The ID of the company associated with this ledger account.
1134
- */
1135
- company_id: string | null;
1136
- }
1137
-
1138
- /**
1139
- * The payout token used for the withdrawal, if applicable.
1140
- */
1141
- export interface PayoutToken {
1142
- /**
1143
- * The ID of the payout token
1144
- */
1145
- id: string;
1146
-
1147
- /**
1148
- * The date and time the payout token was created
1149
- */
1150
- created_at: string;
1151
-
1152
- /**
1153
- * The currency code of the payout destination. This is the currency that payouts
1154
- * will be made in for this token.
1155
- */
1156
- destination_currency_code: string;
1157
-
1158
- /**
1159
- * An optional nickname for the payout token to help the user identify it. This is
1160
- * not used by the provider and is only for the user's reference.
1161
- */
1162
- nickname: string | null;
1163
-
1164
- /**
1165
- * The name of the payer associated with the payout token.
1166
- */
1167
- payer_name: string | null;
1168
- }
1169
- }
1170
- }
1171
-
1172
781
  export interface WithdrawalUpdatedWebhookEvent {
1173
782
  /**
1174
783
  * A unique ID for every single webhook request
@@ -1183,7 +792,7 @@ export interface WithdrawalUpdatedWebhookEvent {
1183
792
  /**
1184
793
  * A withdrawal request.
1185
794
  */
1186
- data: WithdrawalUpdatedWebhookEvent.Data;
795
+ data: WithdrawalsAPI.Withdrawal;
1187
796
 
1188
797
  /**
1189
798
  * The timestamp in ISO 8601 format that the webhook was sent at on the server
@@ -1201,188 +810,6 @@ export interface WithdrawalUpdatedWebhookEvent {
1201
810
  company_id?: string | null;
1202
811
  }
1203
812
 
1204
- export namespace WithdrawalUpdatedWebhookEvent {
1205
- /**
1206
- * A withdrawal request.
1207
- */
1208
- export interface Data {
1209
- /**
1210
- * Internal ID of the withdrawal request.
1211
- */
1212
- id: string;
1213
-
1214
- /**
1215
- * How much money was attempted to be withdrawn, in a float type.
1216
- */
1217
- amount: number;
1218
-
1219
- /**
1220
- * When the withdrawal request was created.
1221
- */
1222
- created_at: string;
1223
-
1224
- /**
1225
- * The currency of the withdrawal request.
1226
- */
1227
- currency: Shared.Currency;
1228
-
1229
- /**
1230
- * The different error codes a payout can be in.
1231
- */
1232
- error_code:
1233
- | 'account_closed'
1234
- | 'account_does_not_exist'
1235
- | 'account_information_invalid'
1236
- | 'account_number_invalid_region'
1237
- | 'account_frozen'
1238
- | 'account_lookup_failed'
1239
- | 'account_not_found'
1240
- | 'amount_out_of_bounds'
1241
- | 'attributes_not_validated'
1242
- | 'b2b_payments_prohibited'
1243
- | 'bank_statement_required'
1244
- | 'compliance_review'
1245
- | 'currency_not_supported'
1246
- | 'deposit_canceled'
1247
- | 'deposit_failed'
1248
- | 'deposit_rejected'
1249
- | 'destination_unavailable'
1250
- | 'exceeded_account_limit'
1251
- | 'expired_quote'
1252
- | 'generic_payout_error'
1253
- | 'technical_problem'
1254
- | 'identification_number_invalid'
1255
- | 'invalid_account_number'
1256
- | 'invalid_bank_code'
1257
- | 'invalid_beneficiary'
1258
- | 'invalid_mailing_address'
1259
- | 'invalid_branch_number'
1260
- | 'invalid_branch_code'
1261
- | 'invalid_phone_number'
1262
- | 'invalid_routing_number'
1263
- | 'invalid_swift_code'
1264
- | 'invalid_company_details'
1265
- | 'manual_cancelation'
1266
- | 'misc_error'
1267
- | 'missing_city_and_country'
1268
- | 'missing_phone_number'
1269
- | 'missing_remittance_info'
1270
- | 'payee_name_invalid'
1271
- | 'receiving_account_locked'
1272
- | 'rejected_by_compliance'
1273
- | 'rtp_not_supported'
1274
- | 'non_transaction_account'
1275
- | 'source_token_insufficient_funds'
1276
- | 'ssn_invalid'
1277
- | 'wallet_screenshot_required'
1278
- | 'unsupported_region'
1279
- | null;
1280
-
1281
- /**
1282
- * The error message for the withdrawal, if any.
1283
- */
1284
- error_message: string | null;
1285
-
1286
- /**
1287
- * The estimated availability date for the withdrawal, if any.
1288
- */
1289
- estimated_availability: string | null;
1290
-
1291
- /**
1292
- * The fee amount that was charged for the withdrawal. This is in the same currency
1293
- * as the withdrawal amount.
1294
- */
1295
- fee_amount: number;
1296
-
1297
- /**
1298
- * The different fee types for a withdrawal.
1299
- */
1300
- fee_type: WithdrawalsAPI.WithdrawalFeeTypes | null;
1301
-
1302
- /**
1303
- * The ledger account associated with the withdrawal.
1304
- */
1305
- ledger_account: Data.LedgerAccount;
1306
-
1307
- /**
1308
- * The markup fee that was charged for the withdrawal. This is in the same currency
1309
- * as the withdrawal amount. This only applies to platform accounts using Whop
1310
- * Rails.
1311
- */
1312
- markup_fee: number;
1313
-
1314
- /**
1315
- * The payout token used for the withdrawal, if applicable.
1316
- */
1317
- payout_token: Data.PayoutToken | null;
1318
-
1319
- /**
1320
- * The speed of the withdrawal.
1321
- */
1322
- speed: WithdrawalsAPI.WithdrawalSpeeds;
1323
-
1324
- /**
1325
- * Status of the withdrawal.
1326
- */
1327
- status: WithdrawalsAPI.WithdrawalStatus;
1328
-
1329
- /**
1330
- * The trace code for the payout, if applicable. Provided on ACH transactions when
1331
- * available.
1332
- */
1333
- trace_code: string | null;
1334
- }
1335
-
1336
- export namespace Data {
1337
- /**
1338
- * The ledger account associated with the withdrawal.
1339
- */
1340
- export interface LedgerAccount {
1341
- /**
1342
- * The ID of the LedgerAccount.
1343
- */
1344
- id: string;
1345
-
1346
- /**
1347
- * The ID of the company associated with this ledger account.
1348
- */
1349
- company_id: string | null;
1350
- }
1351
-
1352
- /**
1353
- * The payout token used for the withdrawal, if applicable.
1354
- */
1355
- export interface PayoutToken {
1356
- /**
1357
- * The ID of the payout token
1358
- */
1359
- id: string;
1360
-
1361
- /**
1362
- * The date and time the payout token was created
1363
- */
1364
- created_at: string;
1365
-
1366
- /**
1367
- * The currency code of the payout destination. This is the currency that payouts
1368
- * will be made in for this token.
1369
- */
1370
- destination_currency_code: string;
1371
-
1372
- /**
1373
- * An optional nickname for the payout token to help the user identify it. This is
1374
- * not used by the provider and is only for the user's reference.
1375
- */
1376
- nickname: string | null;
1377
-
1378
- /**
1379
- * The name of the payer associated with the payout token.
1380
- */
1381
- payer_name: string | null;
1382
- }
1383
- }
1384
- }
1385
-
1386
813
  export interface CourseLessonInteractionCompletedWebhookEvent {
1387
814
  /**
1388
815
  * A unique ID for every single webhook request
@@ -1457,6 +884,12 @@ export namespace PayoutMethodCreatedWebhookEvent {
1457
884
  */
1458
885
  id: string;
1459
886
 
887
+ /**
888
+ * A reference to identify the payout destination, such as the last 4 digits of an
889
+ * account number or an email address.
890
+ */
891
+ account_reference: string | null;
892
+
1460
893
  /**
1461
894
  * The company associated with the payout token
1462
895
  */
@@ -1478,6 +911,11 @@ export namespace PayoutMethodCreatedWebhookEvent {
1478
911
  */
1479
912
  destination: Data.Destination | null;
1480
913
 
914
+ /**
915
+ * The name of the bank or financial institution.
916
+ */
917
+ institution_name: string | null;
918
+
1481
919
  /**
1482
920
  * Whether this payout token is the default for the payout account
1483
921
  */
@@ -1508,7 +946,7 @@ export namespace PayoutMethodCreatedWebhookEvent {
1508
946
  /**
1509
947
  * The category of the payout destination
1510
948
  */
1511
- category: 'crypto' | 'rtp' | 'next_day_bank' | 'bank_wire' | 'digital_wallet' | 'unknown';
949
+ category: PayoutMethodsAPI.PayoutDestinationCategory;
1512
950
 
1513
951
  /**
1514
952
  * The country code of the payout destination
@@ -1568,27 +1006,7 @@ export namespace VerificationSucceededWebhookEvent {
1568
1006
  /**
1569
1007
  * An error code for a verification attempt.
1570
1008
  */
1571
- last_error_code:
1572
- | 'abandoned'
1573
- | 'consent_declined'
1574
- | 'country_not_supported'
1575
- | 'device_not_supported'
1576
- | 'document_expired'
1577
- | 'document_type_not_supported'
1578
- | 'document_unverified_other'
1579
- | 'email_unverified_other'
1580
- | 'email_verification_declined'
1581
- | 'id_number_insufficient_document_data'
1582
- | 'id_number_mismatch'
1583
- | 'id_number_unverified_other'
1584
- | 'phone_unverified_other'
1585
- | 'phone_verification_declined'
1586
- | 'selfie_document_missing_photo'
1587
- | 'selfie_face_mismatch'
1588
- | 'selfie_manipulated'
1589
- | 'selfie_unverified_other'
1590
- | 'under_supported_age'
1591
- | null;
1009
+ last_error_code: VerificationsAPI.VerificationErrorCode | null;
1592
1010
 
1593
1011
  /**
1594
1012
  * The last error reason that occurred during the verification.
@@ -1598,20 +1016,7 @@ export namespace VerificationSucceededWebhookEvent {
1598
1016
  /**
1599
1017
  * The status of the verification.
1600
1018
  */
1601
- status:
1602
- | 'requires_input'
1603
- | 'processing'
1604
- | 'verified'
1605
- | 'canceled'
1606
- | 'created'
1607
- | 'started'
1608
- | 'submitted'
1609
- | 'approved'
1610
- | 'declined'
1611
- | 'resubmission_requested'
1612
- | 'expired'
1613
- | 'abandoned'
1614
- | 'review';
1019
+ status: VerificationsAPI.VerificationStatus;
1615
1020
  }
1616
1021
  }
1617
1022
 
@@ -2344,7 +1749,7 @@ export interface WebhookCreateParams {
2344
1749
  /**
2345
1750
  * The different API versions
2346
1751
  */
2347
- api_version?: 'v1' | 'v2' | 'v5' | null;
1752
+ api_version?: APIVersion | null;
2348
1753
 
2349
1754
  /**
2350
1755
  * Whether or not to send events for child resources. For example, if the webhook
@@ -2361,35 +1766,7 @@ export interface WebhookCreateParams {
2361
1766
  /**
2362
1767
  * The events to send the webhook for.
2363
1768
  */
2364
- events?: Array<
2365
- | 'invoice.created'
2366
- | 'invoice.paid'
2367
- | 'invoice.past_due'
2368
- | 'invoice.voided'
2369
- | 'membership.activated'
2370
- | 'membership.deactivated'
2371
- | 'entry.created'
2372
- | 'entry.approved'
2373
- | 'entry.denied'
2374
- | 'entry.deleted'
2375
- | 'setup_intent.requires_action'
2376
- | 'setup_intent.succeeded'
2377
- | 'setup_intent.canceled'
2378
- | 'withdrawal.created'
2379
- | 'withdrawal.updated'
2380
- | 'course_lesson_interaction.completed'
2381
- | 'payout_method.created'
2382
- | 'verification.succeeded'
2383
- | 'payment.created'
2384
- | 'payment.succeeded'
2385
- | 'payment.failed'
2386
- | 'payment.pending'
2387
- | 'dispute.created'
2388
- | 'dispute.updated'
2389
- | 'refund.created'
2390
- | 'refund.updated'
2391
- | 'membership.cancel_at_period_end_changed'
2392
- > | null;
1769
+ events?: Array<WebhookEvent> | null;
2393
1770
 
2394
1771
  /**
2395
1772
  * The resource to create the webhook for. By default this will use current company
@@ -2401,7 +1778,7 @@ export interface WebhookUpdateParams {
2401
1778
  /**
2402
1779
  * The different API versions
2403
1780
  */
2404
- api_version?: 'v1' | 'v2' | 'v5' | null;
1781
+ api_version?: APIVersion | null;
2405
1782
 
2406
1783
  /**
2407
1784
  * Whether or not to send events for child resources.
@@ -2416,35 +1793,7 @@ export interface WebhookUpdateParams {
2416
1793
  /**
2417
1794
  * The events to send the webhook for.
2418
1795
  */
2419
- events?: Array<
2420
- | 'invoice.created'
2421
- | 'invoice.paid'
2422
- | 'invoice.past_due'
2423
- | 'invoice.voided'
2424
- | 'membership.activated'
2425
- | 'membership.deactivated'
2426
- | 'entry.created'
2427
- | 'entry.approved'
2428
- | 'entry.denied'
2429
- | 'entry.deleted'
2430
- | 'setup_intent.requires_action'
2431
- | 'setup_intent.succeeded'
2432
- | 'setup_intent.canceled'
2433
- | 'withdrawal.created'
2434
- | 'withdrawal.updated'
2435
- | 'course_lesson_interaction.completed'
2436
- | 'payout_method.created'
2437
- | 'verification.succeeded'
2438
- | 'payment.created'
2439
- | 'payment.succeeded'
2440
- | 'payment.failed'
2441
- | 'payment.pending'
2442
- | 'dispute.created'
2443
- | 'dispute.updated'
2444
- | 'refund.created'
2445
- | 'refund.updated'
2446
- | 'membership.cancel_at_period_end_changed'
2447
- > | null;
1796
+ events?: Array<WebhookEvent> | null;
2448
1797
 
2449
1798
  /**
2450
1799
  * The URL to send the webhook to.
@@ -2476,9 +1825,10 @@ export interface WebhookListParams extends CursorPageParams {
2476
1825
 
2477
1826
  export declare namespace Webhooks {
2478
1827
  export {
1828
+ type APIVersion as APIVersion,
1829
+ type Webhook as Webhook,
1830
+ type WebhookEvent as WebhookEvent,
2479
1831
  type WebhookCreateResponse as WebhookCreateResponse,
2480
- type WebhookRetrieveResponse as WebhookRetrieveResponse,
2481
- type WebhookUpdateResponse as WebhookUpdateResponse,
2482
1832
  type WebhookListResponse as WebhookListResponse,
2483
1833
  type WebhookDeleteResponse as WebhookDeleteResponse,
2484
1834
  type InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent,