@whop/sdk 0.0.21 → 0.0.23

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 (103) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +16 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +16 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/upload-file.d.mts +39 -0
  11. package/lib/upload-file.d.mts.map +1 -0
  12. package/lib/upload-file.d.ts +39 -0
  13. package/lib/upload-file.d.ts.map +1 -0
  14. package/lib/upload-file.js +68 -0
  15. package/lib/upload-file.js.map +1 -0
  16. package/lib/upload-file.mjs +65 -0
  17. package/lib/upload-file.mjs.map +1 -0
  18. package/package.json +1 -1
  19. package/resources/files.d.mts +104 -0
  20. package/resources/files.d.mts.map +1 -0
  21. package/resources/files.d.ts +104 -0
  22. package/resources/files.d.ts.map +1 -0
  23. package/resources/files.js +35 -0
  24. package/resources/files.js.map +1 -0
  25. package/resources/files.mjs +31 -0
  26. package/resources/files.mjs.map +1 -0
  27. package/resources/index.d.mts +6 -2
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +6 -2
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +9 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +4 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/leads.d.mts +489 -0
  36. package/resources/leads.d.mts.map +1 -0
  37. package/resources/leads.d.ts +489 -0
  38. package/resources/leads.d.ts.map +1 -0
  39. package/resources/leads.js +94 -0
  40. package/resources/leads.js.map +1 -0
  41. package/resources/leads.mjs +90 -0
  42. package/resources/leads.mjs.map +1 -0
  43. package/resources/ledger-accounts.d.mts +25 -0
  44. package/resources/ledger-accounts.d.mts.map +1 -1
  45. package/resources/ledger-accounts.d.ts +25 -0
  46. package/resources/ledger-accounts.d.ts.map +1 -1
  47. package/resources/payments.d.mts +1 -1
  48. package/resources/payments.d.mts.map +1 -1
  49. package/resources/payments.d.ts +1 -1
  50. package/resources/payments.d.ts.map +1 -1
  51. package/resources/payout-methods.d.mts +69 -1
  52. package/resources/payout-methods.d.mts.map +1 -1
  53. package/resources/payout-methods.d.ts +69 -1
  54. package/resources/payout-methods.d.ts.map +1 -1
  55. package/resources/payout-methods.js +11 -0
  56. package/resources/payout-methods.js.map +1 -1
  57. package/resources/payout-methods.mjs +11 -0
  58. package/resources/payout-methods.mjs.map +1 -1
  59. package/resources/plans.d.mts +8 -0
  60. package/resources/plans.d.mts.map +1 -1
  61. package/resources/plans.d.ts +8 -0
  62. package/resources/plans.d.ts.map +1 -1
  63. package/resources/topups.d.mts +79 -0
  64. package/resources/topups.d.mts.map +1 -0
  65. package/resources/topups.d.ts +79 -0
  66. package/resources/topups.d.ts.map +1 -0
  67. package/resources/topups.js +29 -0
  68. package/resources/topups.js.map +1 -0
  69. package/resources/topups.mjs +25 -0
  70. package/resources/topups.mjs.map +1 -0
  71. package/resources/verifications.d.mts +38 -0
  72. package/resources/verifications.d.mts.map +1 -0
  73. package/resources/verifications.d.ts +38 -0
  74. package/resources/verifications.d.ts.map +1 -0
  75. package/resources/verifications.js +20 -0
  76. package/resources/verifications.js.map +1 -0
  77. package/resources/verifications.mjs +16 -0
  78. package/resources/verifications.mjs.map +1 -0
  79. package/resources/webhooks.d.mts +431 -1
  80. package/resources/webhooks.d.mts.map +1 -1
  81. package/resources/webhooks.d.ts +431 -1
  82. package/resources/webhooks.d.ts.map +1 -1
  83. package/resources/webhooks.js +90 -0
  84. package/resources/webhooks.js.map +1 -1
  85. package/resources/webhooks.mjs +90 -0
  86. package/resources/webhooks.mjs.map +1 -1
  87. package/src/client.ts +72 -0
  88. package/src/lib/upload-file.ts +115 -0
  89. package/src/resources/files.ts +140 -0
  90. package/src/resources/index.ts +24 -0
  91. package/src/resources/leads.ts +583 -0
  92. package/src/resources/ledger-accounts.ts +63 -0
  93. package/src/resources/payments.ts +30 -30
  94. package/src/resources/payout-methods.ts +83 -0
  95. package/src/resources/plans.ts +10 -0
  96. package/src/resources/topups.ts +95 -0
  97. package/src/resources/verifications.ts +81 -0
  98. package/src/resources/webhooks.ts +793 -0
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -5,12 +5,266 @@ import * as RefundsAPI from "./refunds.js";
5
5
  import * as SetupIntentsAPI from "./setup-intents.js";
6
6
  import * as Shared from "./shared.js";
7
7
  import * as WithdrawalsAPI from "./withdrawals.js";
8
+ import { APIPromise } from "../core/api-promise.js";
9
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
10
+ import { RequestOptions } from "../internal/request-options.js";
8
11
  export declare class Webhooks extends APIResource {
12
+ /**
13
+ * Creates a new webhook
14
+ *
15
+ * Required permissions:
16
+ *
17
+ * - `developer:manage_webhook`
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const webhook = await client.webhooks.create({
22
+ * url: 'https://example.com/path',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse>;
27
+ /**
28
+ * Retrieves a webhook by ID
29
+ *
30
+ * Required permissions:
31
+ *
32
+ * - `developer:manage_webhook`
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const webhook = await client.webhooks.retrieve(
37
+ * 'hook_xxxxxxxxxxxxx',
38
+ * );
39
+ * ```
40
+ */
41
+ retrieve(id: string, options?: RequestOptions): APIPromise<WebhookRetrieveResponse>;
42
+ /**
43
+ * Updates a webhook
44
+ *
45
+ * Required permissions:
46
+ *
47
+ * - `developer:manage_webhook`
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const webhook = await client.webhooks.update(
52
+ * 'hook_xxxxxxxxxxxxx',
53
+ * );
54
+ * ```
55
+ */
56
+ update(id: string, body?: WebhookUpdateParams | null | undefined, options?: RequestOptions): APIPromise<WebhookUpdateResponse>;
57
+ /**
58
+ * Lists webhooks for a company
59
+ *
60
+ * Required permissions:
61
+ *
62
+ * - `developer:manage_webhook`
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * // Automatically fetches more pages as needed.
67
+ * for await (const webhookListResponse of client.webhooks.list(
68
+ * { company_id: 'biz_xxxxxxxxxxxxxx' },
69
+ * )) {
70
+ * // ...
71
+ * }
72
+ * ```
73
+ */
74
+ list(query: WebhookListParams, options?: RequestOptions): PagePromise<WebhookListResponsesCursorPage, WebhookListResponse>;
75
+ /**
76
+ * Deletes a webhook
77
+ *
78
+ * Required permissions:
79
+ *
80
+ * - `developer:manage_webhook`
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const webhook = await client.webhooks.delete(
85
+ * 'hook_xxxxxxxxxxxxx',
86
+ * );
87
+ * ```
88
+ */
89
+ delete(id: string, options?: RequestOptions): APIPromise<WebhookDeleteResponse>;
9
90
  unwrap(body: string, { headers, key }: {
10
91
  headers: Record<string, string>;
11
92
  key?: string;
12
93
  }): UnwrapWebhookEvent;
13
94
  }
95
+ export type WebhookListResponsesCursorPage = CursorPage<WebhookListResponse>;
96
+ /**
97
+ * A webhook object, which can be configured to be sent updates about a company
98
+ */
99
+ export interface WebhookCreateResponse {
100
+ /**
101
+ * The ID of the webhook
102
+ */
103
+ id: string;
104
+ /**
105
+ * The API version for this webhook
106
+ */
107
+ api_version: 'v1' | 'v2' | 'v5';
108
+ /**
109
+ * Whether or not to send events for child resources. For example, if the webhook
110
+ * is created for a Company, enabling this will only send events from the Company's
111
+ * sub-merchants (child companies).
112
+ */
113
+ child_resource_events: boolean;
114
+ /**
115
+ * The timestamp of when the webhook was created
116
+ */
117
+ created_at: string;
118
+ /**
119
+ * Whether or not this webhook is turned on or not
120
+ */
121
+ enabled: boolean;
122
+ /**
123
+ * The number of events this webhooks is configured to receive
124
+ */
125
+ events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
126
+ /**
127
+ * The resource ID
128
+ */
129
+ resource_id: string;
130
+ /**
131
+ * The list of events that can be tested with this webhook
132
+ */
133
+ testable_events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
134
+ /**
135
+ * The URL the webhook events will be sent to
136
+ */
137
+ url: string;
138
+ /**
139
+ * A unique secret key that will be sent with each webhook event
140
+ */
141
+ webhook_secret: string;
142
+ }
143
+ /**
144
+ * A webhook object, which can be configured to be sent updates about a company
145
+ */
146
+ export interface WebhookRetrieveResponse {
147
+ /**
148
+ * The ID of the webhook
149
+ */
150
+ id: string;
151
+ /**
152
+ * The API version for this webhook
153
+ */
154
+ api_version: 'v1' | 'v2' | 'v5';
155
+ /**
156
+ * Whether or not to send events for child resources. For example, if the webhook
157
+ * is created for a Company, enabling this will only send events from the Company's
158
+ * sub-merchants (child companies).
159
+ */
160
+ child_resource_events: boolean;
161
+ /**
162
+ * The timestamp of when the webhook was created
163
+ */
164
+ created_at: string;
165
+ /**
166
+ * Whether or not this webhook is turned on or not
167
+ */
168
+ enabled: boolean;
169
+ /**
170
+ * The number of events this webhooks is configured to receive
171
+ */
172
+ events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
173
+ /**
174
+ * The resource ID
175
+ */
176
+ resource_id: string;
177
+ /**
178
+ * The list of events that can be tested with this webhook
179
+ */
180
+ testable_events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
181
+ /**
182
+ * The URL the webhook events will be sent to
183
+ */
184
+ url: string;
185
+ }
186
+ /**
187
+ * A webhook object, which can be configured to be sent updates about a company
188
+ */
189
+ export interface WebhookUpdateResponse {
190
+ /**
191
+ * The ID of the webhook
192
+ */
193
+ id: string;
194
+ /**
195
+ * The API version for this webhook
196
+ */
197
+ api_version: 'v1' | 'v2' | 'v5';
198
+ /**
199
+ * Whether or not to send events for child resources. For example, if the webhook
200
+ * is created for a Company, enabling this will only send events from the Company's
201
+ * sub-merchants (child companies).
202
+ */
203
+ child_resource_events: boolean;
204
+ /**
205
+ * The timestamp of when the webhook was created
206
+ */
207
+ created_at: string;
208
+ /**
209
+ * Whether or not this webhook is turned on or not
210
+ */
211
+ enabled: boolean;
212
+ /**
213
+ * The number of events this webhooks is configured to receive
214
+ */
215
+ events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
216
+ /**
217
+ * The resource ID
218
+ */
219
+ resource_id: string;
220
+ /**
221
+ * The list of events that can be tested with this webhook
222
+ */
223
+ testable_events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
224
+ /**
225
+ * The URL the webhook events will be sent to
226
+ */
227
+ url: string;
228
+ }
229
+ /**
230
+ * A webhook object, which can be configured to be sent updates about a company
231
+ */
232
+ export interface WebhookListResponse {
233
+ /**
234
+ * The ID of the webhook
235
+ */
236
+ id: string;
237
+ /**
238
+ * The API version for this webhook
239
+ */
240
+ api_version: 'v1' | 'v2' | 'v5';
241
+ /**
242
+ * Whether or not to send events for child resources. For example, if the webhook
243
+ * is created for a Company, enabling this will only send events from the Company's
244
+ * sub-merchants (child companies).
245
+ */
246
+ child_resource_events: boolean;
247
+ /**
248
+ * The timestamp of when the webhook was created
249
+ */
250
+ created_at: string;
251
+ /**
252
+ * Whether or not this webhook is turned on or not
253
+ */
254
+ enabled: boolean;
255
+ /**
256
+ * The number of events this webhooks is configured to receive
257
+ */
258
+ events: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'>;
259
+ /**
260
+ * The URL the webhook events will be sent to
261
+ */
262
+ url: string;
263
+ }
264
+ /**
265
+ * Represents `true` or `false` values.
266
+ */
267
+ export type WebhookDeleteResponse = boolean;
14
268
  export interface InvoiceCreatedWebhookEvent {
15
269
  /**
16
270
  * A unique ID for every single webhook request
@@ -32,6 +286,10 @@ export interface InvoiceCreatedWebhookEvent {
32
286
  * The webhook event type
33
287
  */
34
288
  type: 'invoice.created';
289
+ /**
290
+ * The company ID that this webhook event is associated with
291
+ */
292
+ company_id?: string | null;
35
293
  }
36
294
  export interface InvoicePaidWebhookEvent {
37
295
  /**
@@ -54,6 +312,10 @@ export interface InvoicePaidWebhookEvent {
54
312
  * The webhook event type
55
313
  */
56
314
  type: 'invoice.paid';
315
+ /**
316
+ * The company ID that this webhook event is associated with
317
+ */
318
+ company_id?: string | null;
57
319
  }
58
320
  export interface InvoicePastDueWebhookEvent {
59
321
  /**
@@ -76,6 +338,10 @@ export interface InvoicePastDueWebhookEvent {
76
338
  * The webhook event type
77
339
  */
78
340
  type: 'invoice.past_due';
341
+ /**
342
+ * The company ID that this webhook event is associated with
343
+ */
344
+ company_id?: string | null;
79
345
  }
80
346
  export interface InvoiceVoidedWebhookEvent {
81
347
  /**
@@ -98,6 +364,10 @@ export interface InvoiceVoidedWebhookEvent {
98
364
  * The webhook event type
99
365
  */
100
366
  type: 'invoice.voided';
367
+ /**
368
+ * The company ID that this webhook event is associated with
369
+ */
370
+ company_id?: string | null;
101
371
  }
102
372
  export interface MembershipActivatedWebhookEvent {
103
373
  /**
@@ -121,6 +391,10 @@ export interface MembershipActivatedWebhookEvent {
121
391
  * The webhook event type
122
392
  */
123
393
  type: 'membership.activated';
394
+ /**
395
+ * The company ID that this webhook event is associated with
396
+ */
397
+ company_id?: string | null;
124
398
  }
125
399
  export interface MembershipDeactivatedWebhookEvent {
126
400
  /**
@@ -144,6 +418,10 @@ export interface MembershipDeactivatedWebhookEvent {
144
418
  * The webhook event type
145
419
  */
146
420
  type: 'membership.deactivated';
421
+ /**
422
+ * The company ID that this webhook event is associated with
423
+ */
424
+ company_id?: string | null;
147
425
  }
148
426
  export interface EntryCreatedWebhookEvent {
149
427
  /**
@@ -166,6 +444,10 @@ export interface EntryCreatedWebhookEvent {
166
444
  * The webhook event type
167
445
  */
168
446
  type: 'entry.created';
447
+ /**
448
+ * The company ID that this webhook event is associated with
449
+ */
450
+ company_id?: string | null;
169
451
  }
170
452
  export interface EntryApprovedWebhookEvent {
171
453
  /**
@@ -188,6 +470,10 @@ export interface EntryApprovedWebhookEvent {
188
470
  * The webhook event type
189
471
  */
190
472
  type: 'entry.approved';
473
+ /**
474
+ * The company ID that this webhook event is associated with
475
+ */
476
+ company_id?: string | null;
191
477
  }
192
478
  export interface EntryDeniedWebhookEvent {
193
479
  /**
@@ -210,6 +496,10 @@ export interface EntryDeniedWebhookEvent {
210
496
  * The webhook event type
211
497
  */
212
498
  type: 'entry.denied';
499
+ /**
500
+ * The company ID that this webhook event is associated with
501
+ */
502
+ company_id?: string | null;
213
503
  }
214
504
  export interface EntryDeletedWebhookEvent {
215
505
  /**
@@ -232,6 +522,10 @@ export interface EntryDeletedWebhookEvent {
232
522
  * The webhook event type
233
523
  */
234
524
  type: 'entry.deleted';
525
+ /**
526
+ * The company ID that this webhook event is associated with
527
+ */
528
+ company_id?: string | null;
235
529
  }
236
530
  export interface SetupIntentRequiresActionWebhookEvent {
237
531
  /**
@@ -255,6 +549,10 @@ export interface SetupIntentRequiresActionWebhookEvent {
255
549
  * The webhook event type
256
550
  */
257
551
  type: 'setup_intent.requires_action';
552
+ /**
553
+ * The company ID that this webhook event is associated with
554
+ */
555
+ company_id?: string | null;
258
556
  }
259
557
  export interface SetupIntentSucceededWebhookEvent {
260
558
  /**
@@ -278,6 +576,10 @@ export interface SetupIntentSucceededWebhookEvent {
278
576
  * The webhook event type
279
577
  */
280
578
  type: 'setup_intent.succeeded';
579
+ /**
580
+ * The company ID that this webhook event is associated with
581
+ */
582
+ company_id?: string | null;
281
583
  }
282
584
  export interface SetupIntentCanceledWebhookEvent {
283
585
  /**
@@ -301,6 +603,10 @@ export interface SetupIntentCanceledWebhookEvent {
301
603
  * The webhook event type
302
604
  */
303
605
  type: 'setup_intent.canceled';
606
+ /**
607
+ * The company ID that this webhook event is associated with
608
+ */
609
+ company_id?: string | null;
304
610
  }
305
611
  export interface WithdrawalCreatedWebhookEvent {
306
612
  /**
@@ -323,6 +629,10 @@ export interface WithdrawalCreatedWebhookEvent {
323
629
  * The webhook event type
324
630
  */
325
631
  type: 'withdrawal.created';
632
+ /**
633
+ * The company ID that this webhook event is associated with
634
+ */
635
+ company_id?: string | null;
326
636
  }
327
637
  export declare namespace WithdrawalCreatedWebhookEvent {
328
638
  /**
@@ -462,6 +772,10 @@ export interface WithdrawalUpdatedWebhookEvent {
462
772
  * The webhook event type
463
773
  */
464
774
  type: 'withdrawal.updated';
775
+ /**
776
+ * The company ID that this webhook event is associated with
777
+ */
778
+ company_id?: string | null;
465
779
  }
466
780
  export declare namespace WithdrawalUpdatedWebhookEvent {
467
781
  /**
@@ -601,6 +915,10 @@ export interface CourseLessonInteractionCompletedWebhookEvent {
601
915
  * The webhook event type
602
916
  */
603
917
  type: 'course_lesson_interaction.completed';
918
+ /**
919
+ * The company ID that this webhook event is associated with
920
+ */
921
+ company_id?: string | null;
604
922
  }
605
923
  export interface PayoutMethodCreatedWebhookEvent {
606
924
  /**
@@ -623,6 +941,10 @@ export interface PayoutMethodCreatedWebhookEvent {
623
941
  * The webhook event type
624
942
  */
625
943
  type: 'payout_method.created';
944
+ /**
945
+ * The company ID that this webhook event is associated with
946
+ */
947
+ company_id?: string | null;
626
948
  }
627
949
  export declare namespace PayoutMethodCreatedWebhookEvent {
628
950
  /**
@@ -706,6 +1028,10 @@ export interface VerificationSucceededWebhookEvent {
706
1028
  * The webhook event type
707
1029
  */
708
1030
  type: 'verification.succeeded';
1031
+ /**
1032
+ * The company ID that this webhook event is associated with
1033
+ */
1034
+ company_id?: string | null;
709
1035
  }
710
1036
  export declare namespace VerificationSucceededWebhookEvent {
711
1037
  /**
@@ -751,6 +1077,10 @@ export interface PaymentCreatedWebhookEvent {
751
1077
  * The webhook event type
752
1078
  */
753
1079
  type: 'payment.created';
1080
+ /**
1081
+ * The company ID that this webhook event is associated with
1082
+ */
1083
+ company_id?: string | null;
754
1084
  }
755
1085
  export interface PaymentSucceededWebhookEvent {
756
1086
  /**
@@ -773,6 +1103,10 @@ export interface PaymentSucceededWebhookEvent {
773
1103
  * The webhook event type
774
1104
  */
775
1105
  type: 'payment.succeeded';
1106
+ /**
1107
+ * The company ID that this webhook event is associated with
1108
+ */
1109
+ company_id?: string | null;
776
1110
  }
777
1111
  export interface PaymentFailedWebhookEvent {
778
1112
  /**
@@ -795,6 +1129,10 @@ export interface PaymentFailedWebhookEvent {
795
1129
  * The webhook event type
796
1130
  */
797
1131
  type: 'payment.failed';
1132
+ /**
1133
+ * The company ID that this webhook event is associated with
1134
+ */
1135
+ company_id?: string | null;
798
1136
  }
799
1137
  export interface PaymentPendingWebhookEvent {
800
1138
  /**
@@ -817,6 +1155,10 @@ export interface PaymentPendingWebhookEvent {
817
1155
  * The webhook event type
818
1156
  */
819
1157
  type: 'payment.pending';
1158
+ /**
1159
+ * The company ID that this webhook event is associated with
1160
+ */
1161
+ company_id?: string | null;
820
1162
  }
821
1163
  export interface DisputeCreatedWebhookEvent {
822
1164
  /**
@@ -839,6 +1181,10 @@ export interface DisputeCreatedWebhookEvent {
839
1181
  * The webhook event type
840
1182
  */
841
1183
  type: 'dispute.created';
1184
+ /**
1185
+ * The company ID that this webhook event is associated with
1186
+ */
1187
+ company_id?: string | null;
842
1188
  }
843
1189
  export interface DisputeUpdatedWebhookEvent {
844
1190
  /**
@@ -861,6 +1207,10 @@ export interface DisputeUpdatedWebhookEvent {
861
1207
  * The webhook event type
862
1208
  */
863
1209
  type: 'dispute.updated';
1210
+ /**
1211
+ * The company ID that this webhook event is associated with
1212
+ */
1213
+ company_id?: string | null;
864
1214
  }
865
1215
  export interface RefundCreatedWebhookEvent {
866
1216
  /**
@@ -883,6 +1233,10 @@ export interface RefundCreatedWebhookEvent {
883
1233
  * The webhook event type
884
1234
  */
885
1235
  type: 'refund.created';
1236
+ /**
1237
+ * The company ID that this webhook event is associated with
1238
+ */
1239
+ company_id?: string | null;
886
1240
  }
887
1241
  export declare namespace RefundCreatedWebhookEvent {
888
1242
  /**
@@ -1072,6 +1426,10 @@ export interface RefundUpdatedWebhookEvent {
1072
1426
  * The webhook event type
1073
1427
  */
1074
1428
  type: 'refund.updated';
1429
+ /**
1430
+ * The company ID that this webhook event is associated with
1431
+ */
1432
+ company_id?: string | null;
1075
1433
  }
1076
1434
  export declare namespace RefundUpdatedWebhookEvent {
1077
1435
  /**
@@ -1262,9 +1620,81 @@ export interface MembershipCancelAtPeriodEndChangedWebhookEvent {
1262
1620
  * The webhook event type
1263
1621
  */
1264
1622
  type: 'membership.cancel_at_period_end_changed';
1623
+ /**
1624
+ * The company ID that this webhook event is associated with
1625
+ */
1626
+ company_id?: string | null;
1265
1627
  }
1266
1628
  export type UnwrapWebhookEvent = InvoiceCreatedWebhookEvent | InvoicePaidWebhookEvent | InvoicePastDueWebhookEvent | InvoiceVoidedWebhookEvent | MembershipActivatedWebhookEvent | MembershipDeactivatedWebhookEvent | EntryCreatedWebhookEvent | EntryApprovedWebhookEvent | EntryDeniedWebhookEvent | EntryDeletedWebhookEvent | SetupIntentRequiresActionWebhookEvent | SetupIntentSucceededWebhookEvent | SetupIntentCanceledWebhookEvent | WithdrawalCreatedWebhookEvent | WithdrawalUpdatedWebhookEvent | CourseLessonInteractionCompletedWebhookEvent | PayoutMethodCreatedWebhookEvent | VerificationSucceededWebhookEvent | PaymentCreatedWebhookEvent | PaymentSucceededWebhookEvent | PaymentFailedWebhookEvent | PaymentPendingWebhookEvent | DisputeCreatedWebhookEvent | DisputeUpdatedWebhookEvent | RefundCreatedWebhookEvent | RefundUpdatedWebhookEvent | MembershipCancelAtPeriodEndChangedWebhookEvent;
1629
+ export interface WebhookCreateParams {
1630
+ /**
1631
+ * The URL to send the webhook to.
1632
+ */
1633
+ url: string;
1634
+ /**
1635
+ * The different API versions
1636
+ */
1637
+ api_version?: 'v1' | 'v2' | 'v5' | null;
1638
+ /**
1639
+ * Whether or not to send events for child resources. For example, if the webhook
1640
+ * is created for a Company, enabling this will only send events from the Company's
1641
+ * sub-merchants (child companies).
1642
+ */
1643
+ child_resource_events?: boolean | null;
1644
+ /**
1645
+ * Whether or not the webhook is enabled.
1646
+ */
1647
+ enabled?: boolean | null;
1648
+ /**
1649
+ * The events to send the webhook for.
1650
+ */
1651
+ events?: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'> | null;
1652
+ /**
1653
+ * The resource to create the webhook for. By default this will use current company
1654
+ */
1655
+ resource_id?: string | null;
1656
+ }
1657
+ export interface WebhookUpdateParams {
1658
+ /**
1659
+ * The different API versions
1660
+ */
1661
+ api_version?: 'v1' | 'v2' | 'v5' | null;
1662
+ /**
1663
+ * Whether or not to send events for child resources.
1664
+ */
1665
+ child_resource_events?: boolean | null;
1666
+ /**
1667
+ * Whether or not the webhook is enabled.
1668
+ */
1669
+ enabled?: boolean | null;
1670
+ /**
1671
+ * The events to send the webhook for.
1672
+ */
1673
+ events?: Array<'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'invoice.voided' | 'membership.activated' | 'membership.deactivated' | 'entry.created' | 'entry.approved' | 'entry.denied' | 'entry.deleted' | 'setup_intent.requires_action' | 'setup_intent.succeeded' | 'setup_intent.canceled' | 'withdrawal.created' | 'withdrawal.updated' | 'course_lesson_interaction.completed' | 'payout_method.created' | 'verification.succeeded' | 'payment.created' | 'payment.succeeded' | 'payment.failed' | 'payment.pending' | 'dispute.created' | 'dispute.updated' | 'refund.created' | 'refund.updated' | 'membership.cancel_at_period_end_changed'> | null;
1674
+ /**
1675
+ * The URL to send the webhook to.
1676
+ */
1677
+ url?: string | null;
1678
+ }
1679
+ export interface WebhookListParams extends CursorPageParams {
1680
+ /**
1681
+ * The ID of the company to list webhooks for
1682
+ */
1683
+ company_id: string;
1684
+ /**
1685
+ * Returns the elements in the list that come before the specified cursor.
1686
+ */
1687
+ before?: string | null;
1688
+ /**
1689
+ * Returns the first _n_ elements from the list.
1690
+ */
1691
+ first?: number | null;
1692
+ /**
1693
+ * Returns the last _n_ elements from the list.
1694
+ */
1695
+ last?: number | null;
1696
+ }
1267
1697
  export declare namespace Webhooks {
1268
- export { type InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent, type InvoicePaidWebhookEvent as InvoicePaidWebhookEvent, type InvoicePastDueWebhookEvent as InvoicePastDueWebhookEvent, type InvoiceVoidedWebhookEvent as InvoiceVoidedWebhookEvent, type MembershipActivatedWebhookEvent as MembershipActivatedWebhookEvent, type MembershipDeactivatedWebhookEvent as MembershipDeactivatedWebhookEvent, type EntryCreatedWebhookEvent as EntryCreatedWebhookEvent, type EntryApprovedWebhookEvent as EntryApprovedWebhookEvent, type EntryDeniedWebhookEvent as EntryDeniedWebhookEvent, type EntryDeletedWebhookEvent as EntryDeletedWebhookEvent, type SetupIntentRequiresActionWebhookEvent as SetupIntentRequiresActionWebhookEvent, type SetupIntentSucceededWebhookEvent as SetupIntentSucceededWebhookEvent, type SetupIntentCanceledWebhookEvent as SetupIntentCanceledWebhookEvent, type WithdrawalCreatedWebhookEvent as WithdrawalCreatedWebhookEvent, type WithdrawalUpdatedWebhookEvent as WithdrawalUpdatedWebhookEvent, type CourseLessonInteractionCompletedWebhookEvent as CourseLessonInteractionCompletedWebhookEvent, type PayoutMethodCreatedWebhookEvent as PayoutMethodCreatedWebhookEvent, type VerificationSucceededWebhookEvent as VerificationSucceededWebhookEvent, type PaymentCreatedWebhookEvent as PaymentCreatedWebhookEvent, type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent, type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent, type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent, type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent, type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent, type RefundCreatedWebhookEvent as RefundCreatedWebhookEvent, type RefundUpdatedWebhookEvent as RefundUpdatedWebhookEvent, type MembershipCancelAtPeriodEndChangedWebhookEvent as MembershipCancelAtPeriodEndChangedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
1698
+ export { type WebhookCreateResponse as WebhookCreateResponse, type WebhookRetrieveResponse as WebhookRetrieveResponse, type WebhookUpdateResponse as WebhookUpdateResponse, type WebhookListResponse as WebhookListResponse, type WebhookDeleteResponse as WebhookDeleteResponse, type InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent, type InvoicePaidWebhookEvent as InvoicePaidWebhookEvent, type InvoicePastDueWebhookEvent as InvoicePastDueWebhookEvent, type InvoiceVoidedWebhookEvent as InvoiceVoidedWebhookEvent, type MembershipActivatedWebhookEvent as MembershipActivatedWebhookEvent, type MembershipDeactivatedWebhookEvent as MembershipDeactivatedWebhookEvent, type EntryCreatedWebhookEvent as EntryCreatedWebhookEvent, type EntryApprovedWebhookEvent as EntryApprovedWebhookEvent, type EntryDeniedWebhookEvent as EntryDeniedWebhookEvent, type EntryDeletedWebhookEvent as EntryDeletedWebhookEvent, type SetupIntentRequiresActionWebhookEvent as SetupIntentRequiresActionWebhookEvent, type SetupIntentSucceededWebhookEvent as SetupIntentSucceededWebhookEvent, type SetupIntentCanceledWebhookEvent as SetupIntentCanceledWebhookEvent, type WithdrawalCreatedWebhookEvent as WithdrawalCreatedWebhookEvent, type WithdrawalUpdatedWebhookEvent as WithdrawalUpdatedWebhookEvent, type CourseLessonInteractionCompletedWebhookEvent as CourseLessonInteractionCompletedWebhookEvent, type PayoutMethodCreatedWebhookEvent as PayoutMethodCreatedWebhookEvent, type VerificationSucceededWebhookEvent as VerificationSucceededWebhookEvent, type PaymentCreatedWebhookEvent as PaymentCreatedWebhookEvent, type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent, type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent, type PaymentPendingWebhookEvent as PaymentPendingWebhookEvent, type DisputeCreatedWebhookEvent as DisputeCreatedWebhookEvent, type DisputeUpdatedWebhookEvent as DisputeUpdatedWebhookEvent, type RefundCreatedWebhookEvent as RefundCreatedWebhookEvent, type RefundUpdatedWebhookEvent as RefundUpdatedWebhookEvent, type MembershipCancelAtPeriodEndChangedWebhookEvent as MembershipCancelAtPeriodEndChangedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, type WebhookListResponsesCursorPage as WebhookListResponsesCursorPage, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, };
1269
1699
  }
1270
1700
  //# sourceMappingURL=webhooks.d.ts.map