@whop/sdk 0.0.22 → 0.0.24

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 (138) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -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/app-builds.d.mts +7 -18
  20. package/resources/app-builds.d.mts.map +1 -1
  21. package/resources/app-builds.d.ts +7 -18
  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 +19 -17
  26. package/resources/apps.d.mts.map +1 -1
  27. package/resources/apps.d.ts +19 -17
  28. package/resources/apps.d.ts.map +1 -1
  29. package/resources/checkout-configurations.d.mts +8 -17
  30. package/resources/checkout-configurations.d.mts.map +1 -1
  31. package/resources/checkout-configurations.d.ts +8 -17
  32. package/resources/checkout-configurations.d.ts.map +1 -1
  33. package/resources/companies.d.mts +23 -34
  34. package/resources/companies.d.mts.map +1 -1
  35. package/resources/companies.d.ts +23 -34
  36. package/resources/companies.d.ts.map +1 -1
  37. package/resources/course-lessons.d.mts +19 -84
  38. package/resources/course-lessons.d.mts.map +1 -1
  39. package/resources/course-lessons.d.ts +19 -84
  40. package/resources/course-lessons.d.ts.map +1 -1
  41. package/resources/courses.d.mts +8 -42
  42. package/resources/courses.d.mts.map +1 -1
  43. package/resources/courses.d.ts +8 -42
  44. package/resources/courses.d.ts.map +1 -1
  45. package/resources/disputes.d.mts +16 -68
  46. package/resources/disputes.d.mts.map +1 -1
  47. package/resources/disputes.d.ts +16 -68
  48. package/resources/disputes.d.ts.map +1 -1
  49. package/resources/experiences.d.mts +19 -17
  50. package/resources/experiences.d.mts.map +1 -1
  51. package/resources/experiences.d.ts +19 -17
  52. package/resources/experiences.d.ts.map +1 -1
  53. package/resources/files.d.mts +104 -0
  54. package/resources/files.d.mts.map +1 -0
  55. package/resources/files.d.ts +104 -0
  56. package/resources/files.d.ts.map +1 -0
  57. package/resources/files.js +35 -0
  58. package/resources/files.js.map +1 -0
  59. package/resources/files.mjs +31 -0
  60. package/resources/files.mjs.map +1 -0
  61. package/resources/forum-posts.d.mts +6 -32
  62. package/resources/forum-posts.d.mts.map +1 -1
  63. package/resources/forum-posts.d.ts +6 -32
  64. package/resources/forum-posts.d.ts.map +1 -1
  65. package/resources/index.d.mts +3 -2
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +3 -2
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js +3 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +1 -0
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/ledger-accounts.d.mts +0 -4
  74. package/resources/ledger-accounts.d.mts.map +1 -1
  75. package/resources/ledger-accounts.d.ts +0 -4
  76. package/resources/ledger-accounts.d.ts.map +1 -1
  77. package/resources/messages.d.mts +6 -32
  78. package/resources/messages.d.mts.map +1 -1
  79. package/resources/messages.d.ts +6 -32
  80. package/resources/messages.d.ts.map +1 -1
  81. package/resources/notifications.d.mts +4 -0
  82. package/resources/notifications.d.mts.map +1 -1
  83. package/resources/notifications.d.ts +4 -0
  84. package/resources/notifications.d.ts.map +1 -1
  85. package/resources/notifications.js +4 -0
  86. package/resources/notifications.js.map +1 -1
  87. package/resources/notifications.mjs +4 -0
  88. package/resources/notifications.mjs.map +1 -1
  89. package/resources/payments.d.mts +2 -2
  90. package/resources/payments.d.mts.map +1 -1
  91. package/resources/payments.d.ts +2 -2
  92. package/resources/payments.d.ts.map +1 -1
  93. package/resources/payout-methods.d.mts +8 -0
  94. package/resources/payout-methods.d.mts.map +1 -1
  95. package/resources/payout-methods.d.ts +8 -0
  96. package/resources/payout-methods.d.ts.map +1 -1
  97. package/resources/plans.d.mts +16 -34
  98. package/resources/plans.d.mts.map +1 -1
  99. package/resources/plans.d.ts +16 -34
  100. package/resources/plans.d.ts.map +1 -1
  101. package/resources/webhooks.d.mts +437 -11
  102. package/resources/webhooks.d.mts.map +1 -1
  103. package/resources/webhooks.d.ts +437 -11
  104. package/resources/webhooks.d.ts.map +1 -1
  105. package/resources/webhooks.js +90 -0
  106. package/resources/webhooks.js.map +1 -1
  107. package/resources/webhooks.mjs +90 -0
  108. package/resources/webhooks.mjs.map +1 -1
  109. package/resources/withdrawals.d.mts +8 -19
  110. package/resources/withdrawals.d.mts.map +1 -1
  111. package/resources/withdrawals.d.ts +8 -19
  112. package/resources/withdrawals.d.ts.map +1 -1
  113. package/src/client.ts +28 -2
  114. package/src/lib/upload-file.ts +115 -0
  115. package/src/resources/app-builds.ts +7 -21
  116. package/src/resources/apps.ts +21 -18
  117. package/src/resources/checkout-configurations.ts +9 -18
  118. package/src/resources/companies.ts +25 -42
  119. package/src/resources/course-lessons.ts +19 -104
  120. package/src/resources/courses.ts +8 -52
  121. package/src/resources/disputes.ts +16 -84
  122. package/src/resources/experiences.ts +21 -21
  123. package/src/resources/files.ts +140 -0
  124. package/src/resources/forum-posts.ts +6 -38
  125. package/src/resources/index.ts +10 -1
  126. package/src/resources/ledger-accounts.ts +0 -18
  127. package/src/resources/messages.ts +6 -38
  128. package/src/resources/notifications.ts +4 -0
  129. package/src/resources/payments.ts +46 -30
  130. package/src/resources/payout-methods.ts +10 -0
  131. package/src/resources/plans.ts +18 -36
  132. package/src/resources/webhooks.ts +800 -10
  133. package/src/resources/withdrawals.ts +8 -21
  134. package/src/version.ts +1 -1
  135. package/version.d.mts +1 -1
  136. package/version.d.ts +1 -1
  137. package/version.js +1 -1
  138. package/version.mjs +1 -1
@@ -5,12 +5,266 @@ import * as RefundsAPI from "./refunds.mjs";
5
5
  import * as SetupIntentsAPI from "./setup-intents.mjs";
6
6
  import * as Shared from "./shared.mjs";
7
7
  import * as WithdrawalsAPI from "./withdrawals.mjs";
8
+ import { APIPromise } from "../core/api-promise.mjs";
9
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
10
+ import { RequestOptions } from "../internal/request-options.mjs";
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
  /**
@@ -348,7 +658,7 @@ export declare namespace WithdrawalCreatedWebhookEvent {
348
658
  /**
349
659
  * The different error codes a payout can be in.
350
660
  */
351
- error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
661
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_mailing_address' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
352
662
  /**
353
663
  * The error message for the withdrawal, if any.
354
664
  */
@@ -393,10 +703,6 @@ export declare namespace WithdrawalCreatedWebhookEvent {
393
703
  * available.
394
704
  */
395
705
  trace_code: string | null;
396
- /**
397
- * The type of withdrawal.
398
- */
399
- withdrawal_type: WithdrawalsAPI.WithdrawalTypes;
400
706
  }
401
707
  namespace Data {
402
708
  /**
@@ -462,6 +768,10 @@ export interface WithdrawalUpdatedWebhookEvent {
462
768
  * The webhook event type
463
769
  */
464
770
  type: 'withdrawal.updated';
771
+ /**
772
+ * The company ID that this webhook event is associated with
773
+ */
774
+ company_id?: string | null;
465
775
  }
466
776
  export declare namespace WithdrawalUpdatedWebhookEvent {
467
777
  /**
@@ -487,7 +797,7 @@ export declare namespace WithdrawalUpdatedWebhookEvent {
487
797
  /**
488
798
  * The different error codes a payout can be in.
489
799
  */
490
- error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
800
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_mailing_address' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
491
801
  /**
492
802
  * The error message for the withdrawal, if any.
493
803
  */
@@ -532,10 +842,6 @@ export declare namespace WithdrawalUpdatedWebhookEvent {
532
842
  * available.
533
843
  */
534
844
  trace_code: string | null;
535
- /**
536
- * The type of withdrawal.
537
- */
538
- withdrawal_type: WithdrawalsAPI.WithdrawalTypes;
539
845
  }
540
846
  namespace Data {
541
847
  /**
@@ -601,6 +907,10 @@ export interface CourseLessonInteractionCompletedWebhookEvent {
601
907
  * The webhook event type
602
908
  */
603
909
  type: 'course_lesson_interaction.completed';
910
+ /**
911
+ * The company ID that this webhook event is associated with
912
+ */
913
+ company_id?: string | null;
604
914
  }
605
915
  export interface PayoutMethodCreatedWebhookEvent {
606
916
  /**
@@ -623,6 +933,10 @@ export interface PayoutMethodCreatedWebhookEvent {
623
933
  * The webhook event type
624
934
  */
625
935
  type: 'payout_method.created';
936
+ /**
937
+ * The company ID that this webhook event is associated with
938
+ */
939
+ company_id?: string | null;
626
940
  }
627
941
  export declare namespace PayoutMethodCreatedWebhookEvent {
628
942
  /**
@@ -637,6 +951,10 @@ export declare namespace PayoutMethodCreatedWebhookEvent {
637
951
  * The company associated with the payout token
638
952
  */
639
953
  company: Data.Company | null;
954
+ /**
955
+ * The date and time the payout token was created
956
+ */
957
+ created_at: string;
640
958
  /**
641
959
  * The currency code of the payout destination. This is the currency that payouts
642
960
  * will be made in for this token.
@@ -706,6 +1024,10 @@ export interface VerificationSucceededWebhookEvent {
706
1024
  * The webhook event type
707
1025
  */
708
1026
  type: 'verification.succeeded';
1027
+ /**
1028
+ * The company ID that this webhook event is associated with
1029
+ */
1030
+ company_id?: string | null;
709
1031
  }
710
1032
  export declare namespace VerificationSucceededWebhookEvent {
711
1033
  /**
@@ -751,6 +1073,10 @@ export interface PaymentCreatedWebhookEvent {
751
1073
  * The webhook event type
752
1074
  */
753
1075
  type: 'payment.created';
1076
+ /**
1077
+ * The company ID that this webhook event is associated with
1078
+ */
1079
+ company_id?: string | null;
754
1080
  }
755
1081
  export interface PaymentSucceededWebhookEvent {
756
1082
  /**
@@ -773,6 +1099,10 @@ export interface PaymentSucceededWebhookEvent {
773
1099
  * The webhook event type
774
1100
  */
775
1101
  type: 'payment.succeeded';
1102
+ /**
1103
+ * The company ID that this webhook event is associated with
1104
+ */
1105
+ company_id?: string | null;
776
1106
  }
777
1107
  export interface PaymentFailedWebhookEvent {
778
1108
  /**
@@ -795,6 +1125,10 @@ export interface PaymentFailedWebhookEvent {
795
1125
  * The webhook event type
796
1126
  */
797
1127
  type: 'payment.failed';
1128
+ /**
1129
+ * The company ID that this webhook event is associated with
1130
+ */
1131
+ company_id?: string | null;
798
1132
  }
799
1133
  export interface PaymentPendingWebhookEvent {
800
1134
  /**
@@ -817,6 +1151,10 @@ export interface PaymentPendingWebhookEvent {
817
1151
  * The webhook event type
818
1152
  */
819
1153
  type: 'payment.pending';
1154
+ /**
1155
+ * The company ID that this webhook event is associated with
1156
+ */
1157
+ company_id?: string | null;
820
1158
  }
821
1159
  export interface DisputeCreatedWebhookEvent {
822
1160
  /**
@@ -839,6 +1177,10 @@ export interface DisputeCreatedWebhookEvent {
839
1177
  * The webhook event type
840
1178
  */
841
1179
  type: 'dispute.created';
1180
+ /**
1181
+ * The company ID that this webhook event is associated with
1182
+ */
1183
+ company_id?: string | null;
842
1184
  }
843
1185
  export interface DisputeUpdatedWebhookEvent {
844
1186
  /**
@@ -861,6 +1203,10 @@ export interface DisputeUpdatedWebhookEvent {
861
1203
  * The webhook event type
862
1204
  */
863
1205
  type: 'dispute.updated';
1206
+ /**
1207
+ * The company ID that this webhook event is associated with
1208
+ */
1209
+ company_id?: string | null;
864
1210
  }
865
1211
  export interface RefundCreatedWebhookEvent {
866
1212
  /**
@@ -883,6 +1229,10 @@ export interface RefundCreatedWebhookEvent {
883
1229
  * The webhook event type
884
1230
  */
885
1231
  type: 'refund.created';
1232
+ /**
1233
+ * The company ID that this webhook event is associated with
1234
+ */
1235
+ company_id?: string | null;
886
1236
  }
887
1237
  export declare namespace RefundCreatedWebhookEvent {
888
1238
  /**
@@ -1072,6 +1422,10 @@ export interface RefundUpdatedWebhookEvent {
1072
1422
  * The webhook event type
1073
1423
  */
1074
1424
  type: 'refund.updated';
1425
+ /**
1426
+ * The company ID that this webhook event is associated with
1427
+ */
1428
+ company_id?: string | null;
1075
1429
  }
1076
1430
  export declare namespace RefundUpdatedWebhookEvent {
1077
1431
  /**
@@ -1262,9 +1616,81 @@ export interface MembershipCancelAtPeriodEndChangedWebhookEvent {
1262
1616
  * The webhook event type
1263
1617
  */
1264
1618
  type: 'membership.cancel_at_period_end_changed';
1619
+ /**
1620
+ * The company ID that this webhook event is associated with
1621
+ */
1622
+ company_id?: string | null;
1265
1623
  }
1266
1624
  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;
1625
+ export interface WebhookCreateParams {
1626
+ /**
1627
+ * The URL to send the webhook to.
1628
+ */
1629
+ url: string;
1630
+ /**
1631
+ * The different API versions
1632
+ */
1633
+ api_version?: 'v1' | 'v2' | 'v5' | null;
1634
+ /**
1635
+ * Whether or not to send events for child resources. For example, if the webhook
1636
+ * is created for a Company, enabling this will only send events from the Company's
1637
+ * sub-merchants (child companies).
1638
+ */
1639
+ child_resource_events?: boolean | null;
1640
+ /**
1641
+ * Whether or not the webhook is enabled.
1642
+ */
1643
+ enabled?: boolean | null;
1644
+ /**
1645
+ * The events to send the webhook for.
1646
+ */
1647
+ 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;
1648
+ /**
1649
+ * The resource to create the webhook for. By default this will use current company
1650
+ */
1651
+ resource_id?: string | null;
1652
+ }
1653
+ export interface WebhookUpdateParams {
1654
+ /**
1655
+ * The different API versions
1656
+ */
1657
+ api_version?: 'v1' | 'v2' | 'v5' | null;
1658
+ /**
1659
+ * Whether or not to send events for child resources.
1660
+ */
1661
+ child_resource_events?: boolean | null;
1662
+ /**
1663
+ * Whether or not the webhook is enabled.
1664
+ */
1665
+ enabled?: boolean | null;
1666
+ /**
1667
+ * The events to send the webhook for.
1668
+ */
1669
+ 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;
1670
+ /**
1671
+ * The URL to send the webhook to.
1672
+ */
1673
+ url?: string | null;
1674
+ }
1675
+ export interface WebhookListParams extends CursorPageParams {
1676
+ /**
1677
+ * The ID of the company to list webhooks for
1678
+ */
1679
+ company_id: string;
1680
+ /**
1681
+ * Returns the elements in the list that come before the specified cursor.
1682
+ */
1683
+ before?: string | null;
1684
+ /**
1685
+ * Returns the first _n_ elements from the list.
1686
+ */
1687
+ first?: number | null;
1688
+ /**
1689
+ * Returns the last _n_ elements from the list.
1690
+ */
1691
+ last?: number | null;
1692
+ }
1267
1693
  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, };
1694
+ 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
1695
  }
1270
1696
  //# sourceMappingURL=webhooks.d.mts.map