@getivy/node-sdk 0.1.0-alpha.9 → 1.1.0

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 (231) hide show
  1. package/CHANGELOG.md +334 -0
  2. package/README.md +16 -26
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +25 -15
  9. package/core.js.map +1 -1
  10. package/core.mjs +26 -16
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +36 -18
  13. package/index.d.ts +36 -18
  14. package/index.d.ts.map +1 -1
  15. package/index.js +27 -8
  16. package/index.js.map +1 -1
  17. package/index.mjs +27 -8
  18. package/index.mjs.map +1 -1
  19. package/package.json +11 -33
  20. package/resource.d.ts +1 -1
  21. package/resource.d.ts.map +1 -1
  22. package/resource.js.map +1 -1
  23. package/resource.mjs.map +1 -1
  24. package/resources/balance.d.ts +8 -5
  25. package/resources/balance.d.ts.map +1 -1
  26. package/resources/banks.d.ts +82 -67
  27. package/resources/banks.d.ts.map +1 -1
  28. package/resources/beneficiary-payouts.d.ts +61 -0
  29. package/resources/beneficiary-payouts.d.ts.map +1 -0
  30. package/resources/beneficiary-payouts.js +16 -0
  31. package/resources/beneficiary-payouts.js.map +1 -0
  32. package/resources/beneficiary-payouts.mjs +12 -0
  33. package/resources/beneficiary-payouts.mjs.map +1 -0
  34. package/resources/capabilities.d.ts +1 -10
  35. package/resources/capabilities.d.ts.map +1 -1
  36. package/resources/charges.d.ts +28 -19
  37. package/resources/charges.d.ts.map +1 -1
  38. package/resources/checkoutsession.d.ts +275 -1360
  39. package/resources/checkoutsession.d.ts.map +1 -1
  40. package/resources/customers.d.ts +140 -10
  41. package/resources/customers.d.ts.map +1 -1
  42. package/resources/customers.js +9 -2
  43. package/resources/customers.js.map +1 -1
  44. package/resources/customers.mjs +9 -2
  45. package/resources/customers.mjs.map +1 -1
  46. package/resources/data/accounts.d.ts +83 -0
  47. package/resources/data/accounts.d.ts.map +1 -0
  48. package/resources/data/accounts.js +15 -0
  49. package/resources/data/accounts.js.map +1 -0
  50. package/resources/data/accounts.mjs +11 -0
  51. package/resources/data/accounts.mjs.map +1 -0
  52. package/resources/data/balances.d.ts +48 -0
  53. package/resources/data/balances.d.ts.map +1 -0
  54. package/resources/data/balances.js +15 -0
  55. package/resources/data/balances.js.map +1 -0
  56. package/resources/data/balances.mjs +11 -0
  57. package/resources/data/balances.mjs.map +1 -0
  58. package/resources/data/consent.d.ts +80 -0
  59. package/resources/data/consent.d.ts.map +1 -0
  60. package/resources/data/consent.js +21 -0
  61. package/resources/data/consent.js.map +1 -0
  62. package/resources/data/consent.mjs +17 -0
  63. package/resources/data/consent.mjs.map +1 -0
  64. package/resources/data/data.d.ts +26 -0
  65. package/resources/data/data.d.ts.map +1 -0
  66. package/resources/data/data.js +55 -0
  67. package/resources/data/data.js.map +1 -0
  68. package/resources/data/data.mjs +28 -0
  69. package/resources/data/data.mjs.map +1 -0
  70. package/resources/data/index.d.ts +7 -0
  71. package/resources/data/index.d.ts.map +1 -0
  72. package/resources/data/index.js +17 -0
  73. package/resources/data/index.js.map +1 -0
  74. package/resources/data/index.mjs +8 -0
  75. package/resources/data/index.mjs.map +1 -0
  76. package/resources/data/session.d.ts +258 -0
  77. package/resources/data/session.d.ts.map +1 -0
  78. package/resources/data/session.js +21 -0
  79. package/resources/data/session.js.map +1 -0
  80. package/resources/data/session.mjs +17 -0
  81. package/resources/data/session.mjs.map +1 -0
  82. package/resources/data/transactions.d.ts +175 -0
  83. package/resources/data/transactions.d.ts.map +1 -0
  84. package/resources/data/transactions.js +16 -0
  85. package/resources/data/transactions.js.map +1 -0
  86. package/resources/data/transactions.mjs +12 -0
  87. package/resources/data/transactions.mjs.map +1 -0
  88. package/resources/data.d.ts +2 -0
  89. package/resources/data.d.ts.map +1 -0
  90. package/resources/data.js +19 -0
  91. package/resources/data.js.map +1 -0
  92. package/resources/data.mjs +3 -0
  93. package/resources/data.mjs.map +1 -0
  94. package/resources/deposits.d.ts +165 -0
  95. package/resources/deposits.d.ts.map +1 -0
  96. package/resources/deposits.js +15 -0
  97. package/resources/deposits.js.map +1 -0
  98. package/resources/deposits.mjs +11 -0
  99. package/resources/deposits.mjs.map +1 -0
  100. package/resources/fx.d.ts +90 -0
  101. package/resources/fx.d.ts.map +1 -0
  102. package/resources/fx.js +22 -0
  103. package/resources/fx.js.map +1 -0
  104. package/resources/fx.mjs +18 -0
  105. package/resources/fx.mjs.map +1 -0
  106. package/resources/index.d.ts +13 -8
  107. package/resources/index.d.ts.map +1 -1
  108. package/resources/index.js +15 -5
  109. package/resources/index.js.map +1 -1
  110. package/resources/index.mjs +7 -2
  111. package/resources/index.mjs.map +1 -1
  112. package/resources/mandates.d.ts +55 -17
  113. package/resources/mandates.d.ts.map +1 -1
  114. package/resources/orders.d.ts +720 -743
  115. package/resources/orders.d.ts.map +1 -1
  116. package/resources/orders.js +13 -3
  117. package/resources/orders.js.map +1 -1
  118. package/resources/orders.mjs +13 -3
  119. package/resources/orders.mjs.map +1 -1
  120. package/resources/payouts.d.ts +219 -103
  121. package/resources/payouts.d.ts.map +1 -1
  122. package/resources/payouts.js +3 -4
  123. package/resources/payouts.js.map +1 -1
  124. package/resources/payouts.mjs +3 -4
  125. package/resources/payouts.mjs.map +1 -1
  126. package/resources/refunds.d.ts +53 -97
  127. package/resources/refunds.d.ts.map +1 -1
  128. package/resources/refunds.js +8 -12
  129. package/resources/refunds.js.map +1 -1
  130. package/resources/refunds.mjs +8 -12
  131. package/resources/refunds.mjs.map +1 -1
  132. package/resources/returns.d.ts +104 -0
  133. package/resources/returns.d.ts.map +1 -0
  134. package/resources/returns.js +21 -0
  135. package/resources/returns.js.map +1 -0
  136. package/resources/returns.mjs +17 -0
  137. package/resources/returns.mjs.map +1 -0
  138. package/resources/subaccounts.d.ts +15 -5
  139. package/resources/subaccounts.d.ts.map +1 -1
  140. package/resources/subaccounts.js.map +1 -1
  141. package/resources/subaccounts.mjs.map +1 -1
  142. package/resources/transactions.d.ts +174 -0
  143. package/resources/transactions.d.ts.map +1 -0
  144. package/resources/transactions.js +15 -0
  145. package/resources/transactions.js.map +1 -0
  146. package/resources/transactions.mjs +11 -0
  147. package/resources/transactions.mjs.map +1 -0
  148. package/resources/webhook/index.d.ts +3 -0
  149. package/resources/webhook/index.d.ts.map +1 -0
  150. package/resources/webhook/index.js +9 -0
  151. package/resources/webhook/index.js.map +1 -0
  152. package/resources/webhook/index.mjs +4 -0
  153. package/resources/webhook/index.mjs.map +1 -0
  154. package/resources/webhook/subscription.d.ts +152 -0
  155. package/resources/webhook/subscription.d.ts.map +1 -0
  156. package/resources/{webhooksubscription.js → webhook/subscription.js} +6 -6
  157. package/resources/webhook/subscription.js.map +1 -0
  158. package/resources/{webhooksubscription.mjs → webhook/subscription.mjs} +4 -4
  159. package/resources/webhook/subscription.mjs.map +1 -0
  160. package/resources/webhook/webhook.d.ts +28 -0
  161. package/resources/webhook/webhook.d.ts.map +1 -0
  162. package/resources/webhook/webhook.js +45 -0
  163. package/resources/webhook/webhook.js.map +1 -0
  164. package/resources/webhook/webhook.mjs +18 -0
  165. package/resources/webhook/webhook.mjs.map +1 -0
  166. package/resources/webhook.d.ts +2 -0
  167. package/resources/webhook.d.ts.map +1 -0
  168. package/resources/webhook.js +19 -0
  169. package/resources/webhook.js.map +1 -0
  170. package/resources/webhook.mjs +3 -0
  171. package/resources/webhook.mjs.map +1 -0
  172. package/resources.d.ts +2 -0
  173. package/resources.d.ts.map +1 -0
  174. package/resources.js +18 -0
  175. package/resources.js.map +1 -0
  176. package/resources.mjs +2 -0
  177. package/resources.mjs.map +1 -0
  178. package/src/_shims/index.d.ts +2 -0
  179. package/src/_shims/index.js +5 -1
  180. package/src/_shims/index.mjs +5 -1
  181. package/src/core.ts +44 -16
  182. package/src/index.ts +111 -60
  183. package/src/resource.ts +1 -1
  184. package/src/resources/balance.ts +8 -5
  185. package/src/resources/banks.ts +130 -67
  186. package/src/resources/beneficiary-payouts.ts +78 -0
  187. package/src/resources/capabilities.ts +1 -10
  188. package/src/resources/charges.ts +30 -21
  189. package/src/resources/checkoutsession.ts +1224 -3096
  190. package/src/resources/customers.ts +164 -9
  191. package/src/resources/data/accounts.ts +113 -0
  192. package/src/resources/data/balances.ts +60 -0
  193. package/src/resources/data/consent.ts +110 -0
  194. package/src/resources/data/data.ts +75 -0
  195. package/src/resources/data/index.ts +20 -0
  196. package/src/resources/data/session.ts +1317 -0
  197. package/src/resources/data/transactions.ts +235 -0
  198. package/src/resources/data.ts +3 -0
  199. package/src/resources/deposits.ts +231 -0
  200. package/src/resources/fx.ts +119 -0
  201. package/src/resources/index.ts +33 -28
  202. package/src/resources/mandates.ts +79 -17
  203. package/src/resources/orders.ts +1449 -1075
  204. package/src/resources/payouts.ts +273 -103
  205. package/src/resources/refunds.ts +70 -111
  206. package/src/resources/returns.ts +140 -0
  207. package/src/resources/subaccounts.ts +26 -4
  208. package/src/resources/transactions.ts +234 -0
  209. package/src/resources/webhook/index.ts +16 -0
  210. package/src/resources/{webhooksubscription.ts → webhook/subscription.ts} +164 -112
  211. package/src/resources/webhook/webhook.ts +69 -0
  212. package/src/resources/webhook.ts +3 -0
  213. package/src/resources.ts +1 -0
  214. package/src/version.ts +1 -1
  215. package/version.d.ts +1 -1
  216. package/version.d.ts.map +1 -1
  217. package/version.js +1 -1
  218. package/version.js.map +1 -1
  219. package/version.mjs +1 -1
  220. package/version.mjs.map +1 -1
  221. package/resources/reports.d.ts +0 -120
  222. package/resources/reports.d.ts.map +0 -1
  223. package/resources/reports.js +0 -31
  224. package/resources/reports.js.map +0 -1
  225. package/resources/reports.mjs +0 -27
  226. package/resources/reports.mjs.map +0 -1
  227. package/resources/webhooksubscription.d.ts +0 -155
  228. package/resources/webhooksubscription.d.ts.map +0 -1
  229. package/resources/webhooksubscription.js.map +0 -1
  230. package/resources/webhooksubscription.mjs.map +0 -1
  231. package/src/resources/reports.ts +0 -172
@@ -1,17 +1,17 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import * as Core from '../core';
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
5
 
6
- export class Webhooksubscription extends APIResource {
6
+ export class Subscription extends APIResource {
7
7
  /**
8
8
  * Creates a webhook subscription that sends various events from Ivy to a specified
9
9
  * url. There can be multiple subscriptions per app.
10
10
  */
11
11
  create(
12
- body: WebhooksubscriptionCreateParams,
12
+ body: SubscriptionCreateParams,
13
13
  options?: Core.RequestOptions,
14
- ): Core.APIPromise<WebhooksubscriptionCreateResponse> {
14
+ ): Core.APIPromise<SubscriptionCreateResponse> {
15
15
  return this._client.post('/api/service/webhook-subscription/create', { body, ...options });
16
16
  }
17
17
 
@@ -20,9 +20,9 @@ export class Webhooksubscription extends APIResource {
20
20
  * used via the app or via the API by providing an API key.
21
21
  */
22
22
  update(
23
- body: WebhooksubscriptionUpdateParams,
23
+ body: SubscriptionUpdateParams,
24
24
  options?: Core.RequestOptions,
25
- ): Core.APIPromise<WebhooksubscriptionUpdateResponse> {
25
+ ): Core.APIPromise<SubscriptionUpdateResponse> {
26
26
  return this._client.post('/api/service/webhook-subscription/update', { body, ...options });
27
27
  }
28
28
 
@@ -31,9 +31,9 @@ export class Webhooksubscription extends APIResource {
31
31
  * results are paginated and provided in chronological order.
32
32
  */
33
33
  list(
34
- body: WebhooksubscriptionListParams,
34
+ body: SubscriptionListParams,
35
35
  options?: Core.RequestOptions,
36
- ): Core.APIPromise<WebhooksubscriptionListResponse> {
36
+ ): Core.APIPromise<SubscriptionListResponse> {
37
37
  return this._client.post('/api/service/webhook-subscription/list', { body, ...options });
38
38
  }
39
39
 
@@ -41,30 +41,27 @@ export class Webhooksubscription extends APIResource {
41
41
  * Deletes a webhook subscription.
42
42
  */
43
43
  delete(
44
- body: WebhooksubscriptionDeleteParams,
44
+ body: SubscriptionDeleteParams,
45
45
  options?: Core.RequestOptions,
46
- ): Core.APIPromise<WebhooksubscriptionDeleteResponse> {
46
+ ): Core.APIPromise<SubscriptionDeleteResponse> {
47
47
  return this._client.post('/api/service/webhook-subscription/delete', { body, ...options });
48
48
  }
49
49
 
50
50
  /**
51
- * Trigger the webhook event "test" for the specified webhook subscription.
51
+ * Sends a test ping to verify webhook subscription endpoint connectivity.
52
52
  */
53
53
  ping(
54
- body: WebhooksubscriptionPingParams,
54
+ body: SubscriptionPingParams,
55
55
  options?: Core.RequestOptions,
56
- ): Core.APIPromise<WebhooksubscriptionPingResponse> {
56
+ ): Core.APIPromise<SubscriptionPingResponse> {
57
57
  return this._client.post('/api/service/webhook-subscription/ping', { body, ...options });
58
58
  }
59
59
  }
60
60
 
61
- export interface WebhooksubscriptionCreateResponse {
62
- /**
63
- * The unique id for the webhook subscription.
64
- */
65
- id: string;
61
+ export interface SubscriptionCreateResponse {
62
+ id: unknown;
66
63
 
67
- createdAt: string;
64
+ createdAt: unknown;
68
65
 
69
66
  events: Array<
70
67
  | 'test'
@@ -74,6 +71,9 @@ export interface WebhooksubscriptionCreateResponse {
74
71
  | 'order_updated'
75
72
  | 'refund_succeeded'
76
73
  | 'refund_failed'
74
+ | 'refund.initiated'
75
+ | 'refund.succeeded'
76
+ | 'refund.failed'
77
77
  | 'payout_report_requested'
78
78
  | 'data_session_completed'
79
79
  | 'checkout_session_created'
@@ -86,37 +86,32 @@ export interface WebhooksubscriptionCreateResponse {
86
86
  | 'mandate_setup_succeeded'
87
87
  | 'mandate_setup_failed'
88
88
  | 'mandate_revoked'
89
+ | 'user_payout.initiated'
89
90
  | 'user_payout.failed'
90
91
  | 'user_payout.paid'
91
- | 'user_payout.initiated'
92
+ | 'payout.initiated'
93
+ | 'payout.failed'
94
+ | 'payout.paid'
95
+ | 'deposit.received'
96
+ | 'return.initiated'
97
+ | 'return.succeeded'
98
+ | 'return.failed'
99
+ | 'return.returned'
92
100
  >;
93
101
 
94
- /**
95
- * The unique id for the webhook subscription.
96
- */
97
- merchant: string;
102
+ merchant: unknown;
98
103
 
99
- /**
100
- * @deprecated The unique id for the webhook subscription.
101
- */
102
- merchantApp: string;
104
+ merchantApp: unknown;
103
105
 
104
- updatedAt: string;
106
+ updatedAt: unknown;
105
107
 
106
- /**
107
- * The url that will listen to the webhook events coming from Ivy. Must be unique
108
- * for the merchant app.
109
- */
110
108
  url: string;
111
109
  }
112
110
 
113
- export interface WebhooksubscriptionUpdateResponse {
114
- /**
115
- * The unique id for the webhook subscription.
116
- */
117
- id: string;
111
+ export interface SubscriptionUpdateResponse {
112
+ id: unknown;
118
113
 
119
- createdAt: string;
114
+ createdAt: unknown;
120
115
 
121
116
  events: Array<
122
117
  | 'test'
@@ -126,6 +121,9 @@ export interface WebhooksubscriptionUpdateResponse {
126
121
  | 'order_updated'
127
122
  | 'refund_succeeded'
128
123
  | 'refund_failed'
124
+ | 'refund.initiated'
125
+ | 'refund.succeeded'
126
+ | 'refund.failed'
129
127
  | 'payout_report_requested'
130
128
  | 'data_session_completed'
131
129
  | 'checkout_session_created'
@@ -138,48 +136,55 @@ export interface WebhooksubscriptionUpdateResponse {
138
136
  | 'mandate_setup_succeeded'
139
137
  | 'mandate_setup_failed'
140
138
  | 'mandate_revoked'
139
+ | 'user_payout.initiated'
141
140
  | 'user_payout.failed'
142
141
  | 'user_payout.paid'
143
- | 'user_payout.initiated'
142
+ | 'payout.initiated'
143
+ | 'payout.failed'
144
+ | 'payout.paid'
145
+ | 'deposit.received'
146
+ | 'return.initiated'
147
+ | 'return.succeeded'
148
+ | 'return.failed'
149
+ | 'return.returned'
144
150
  >;
145
151
 
146
- /**
147
- * The unique id for the webhook subscription.
148
- */
149
- merchant: string;
152
+ merchant: unknown;
150
153
 
151
- /**
152
- * @deprecated The unique id for the webhook subscription.
153
- */
154
- merchantApp: string;
154
+ merchantApp: unknown;
155
155
 
156
- updatedAt: string;
156
+ updatedAt: unknown;
157
157
 
158
- /**
159
- * The url that will listen to the webhook events coming from Ivy. Must be unique
160
- * for the merchant app.
161
- */
162
158
  url: string;
163
159
  }
164
160
 
165
- export interface WebhooksubscriptionListResponse {
161
+ export interface SubscriptionListResponse {
162
+ /**
163
+ * The total number of webhook subscriptions
164
+ */
166
165
  count: number;
167
166
 
167
+ /**
168
+ * Whether there are more webhook subscriptions to retrieve
169
+ */
168
170
  hasNext: boolean;
169
171
 
170
- items: Array<WebhooksubscriptionListResponse.Item>;
172
+ /**
173
+ * Array of webhook subscription objects
174
+ */
175
+ items: Array<SubscriptionListResponse.Item>;
171
176
 
177
+ /**
178
+ * The number of webhook subscriptions skipped
179
+ */
172
180
  skip: number;
173
181
  }
174
182
 
175
- export namespace WebhooksubscriptionListResponse {
183
+ export namespace SubscriptionListResponse {
176
184
  export interface Item {
177
- /**
178
- * The unique id for the webhook subscription.
179
- */
180
- id: string;
185
+ id: unknown;
181
186
 
182
- createdAt: string;
187
+ createdAt: unknown;
183
188
 
184
189
  events: Array<
185
190
  | 'test'
@@ -189,6 +194,9 @@ export namespace WebhooksubscriptionListResponse {
189
194
  | 'order_updated'
190
195
  | 'refund_succeeded'
191
196
  | 'refund_failed'
197
+ | 'refund.initiated'
198
+ | 'refund.succeeded'
199
+ | 'refund.failed'
192
200
  | 'payout_report_requested'
193
201
  | 'data_session_completed'
194
202
  | 'checkout_session_created'
@@ -201,64 +209,73 @@ export namespace WebhooksubscriptionListResponse {
201
209
  | 'mandate_setup_succeeded'
202
210
  | 'mandate_setup_failed'
203
211
  | 'mandate_revoked'
212
+ | 'user_payout.initiated'
204
213
  | 'user_payout.failed'
205
214
  | 'user_payout.paid'
206
- | 'user_payout.initiated'
215
+ | 'payout.initiated'
216
+ | 'payout.failed'
217
+ | 'payout.paid'
218
+ | 'deposit.received'
219
+ | 'return.initiated'
220
+ | 'return.succeeded'
221
+ | 'return.failed'
222
+ | 'return.returned'
207
223
  >;
208
224
 
209
- /**
210
- * The unique id for the webhook subscription.
211
- */
212
- merchant: string;
225
+ merchant: unknown;
213
226
 
214
- /**
215
- * @deprecated The unique id for the webhook subscription.
216
- */
217
- merchantApp: string;
227
+ merchantApp: unknown;
218
228
 
219
- updatedAt: string;
229
+ updatedAt: unknown;
220
230
 
221
- /**
222
- * The url that will listen to the webhook events coming from Ivy. Must be unique
223
- * for the merchant app.
224
- */
225
231
  url: string;
226
232
  }
227
233
  }
228
234
 
229
- export interface WebhooksubscriptionDeleteResponse {
235
+ export interface SubscriptionDeleteResponse {
236
+ /**
237
+ * Whether the webhook subscription was successfully deleted
238
+ */
230
239
  success: boolean;
231
240
  }
232
241
 
233
- export interface WebhooksubscriptionPingResponse {
242
+ export interface SubscriptionPingResponse {
234
243
  /**
235
- * The unique identifier of the webhook that was sent.
244
+ * The unique identifier of the webhook subscription
236
245
  */
237
- id: string;
246
+ id: unknown;
238
247
 
239
- date: string;
248
+ /**
249
+ * The timestamp when the ping was executed
250
+ */
251
+ date: unknown;
240
252
 
241
253
  /**
242
- * The response body returned by the targeted webhook endpoint.
254
+ * The response from the webhook endpoint
243
255
  */
244
- response: string | number | boolean | Array<unknown> | Record<string, unknown> | null;
256
+ response: unknown;
245
257
 
246
258
  /**
247
- * The status code returned by the targeted webhook endpoint.
259
+ * The HTTP status code returned by the webhook endpoint
248
260
  */
249
261
  statusCode: number;
250
262
 
251
263
  /**
252
- * True if the targeted webhook endpoint returned status code 200. False otherwise.
264
+ * Whether the ping was successful
253
265
  */
254
266
  success: boolean;
255
267
  }
256
268
 
257
- export interface WebhooksubscriptionCreateParams {
269
+ export interface SubscriptionCreateParams {
270
+ /**
271
+ * The endpoint where webhook events are sent.
272
+ */
273
+ url: string;
274
+
258
275
  /**
259
276
  * The events to subscribe the url to.
260
277
  */
261
- events: Array<
278
+ events?: Array<
262
279
  | 'test'
263
280
  | 'merchant_updated'
264
281
  | 'merchant_app_updated'
@@ -266,6 +283,9 @@ export interface WebhooksubscriptionCreateParams {
266
283
  | 'order_updated'
267
284
  | 'refund_succeeded'
268
285
  | 'refund_failed'
286
+ | 'refund.initiated'
287
+ | 'refund.succeeded'
288
+ | 'refund.failed'
269
289
  | 'payout_report_requested'
270
290
  | 'data_session_completed'
271
291
  | 'checkout_session_created'
@@ -278,20 +298,29 @@ export interface WebhooksubscriptionCreateParams {
278
298
  | 'mandate_setup_succeeded'
279
299
  | 'mandate_setup_failed'
280
300
  | 'mandate_revoked'
301
+ | 'user_payout.initiated'
281
302
  | 'user_payout.failed'
282
303
  | 'user_payout.paid'
283
- | 'user_payout.initiated'
304
+ | 'payout.initiated'
305
+ | 'payout.failed'
306
+ | 'payout.paid'
307
+ | 'deposit.received'
308
+ | 'return.initiated'
309
+ | 'return.succeeded'
310
+ | 'return.failed'
311
+ | 'return.returned'
284
312
  >;
313
+ }
285
314
 
315
+ export interface SubscriptionUpdateParams {
286
316
  /**
287
- * The endpoint where webhook events are sent.
317
+ * The unique identifier of the webhook subscription to update
288
318
  */
289
- url: string;
290
- }
291
-
292
- export interface WebhooksubscriptionUpdateParams {
293
- id: string;
319
+ id: unknown;
294
320
 
321
+ /**
322
+ * The new events to subscribe the url to
323
+ */
295
324
  events?: Array<
296
325
  | 'test'
297
326
  | 'merchant_updated'
@@ -300,6 +329,9 @@ export interface WebhooksubscriptionUpdateParams {
300
329
  | 'order_updated'
301
330
  | 'refund_succeeded'
302
331
  | 'refund_failed'
332
+ | 'refund.initiated'
333
+ | 'refund.succeeded'
334
+ | 'refund.failed'
303
335
  | 'payout_report_requested'
304
336
  | 'data_session_completed'
305
337
  | 'checkout_session_created'
@@ -312,42 +344,62 @@ export interface WebhooksubscriptionUpdateParams {
312
344
  | 'mandate_setup_succeeded'
313
345
  | 'mandate_setup_failed'
314
346
  | 'mandate_revoked'
347
+ | 'user_payout.initiated'
315
348
  | 'user_payout.failed'
316
349
  | 'user_payout.paid'
317
- | 'user_payout.initiated'
350
+ | 'payout.initiated'
351
+ | 'payout.failed'
352
+ | 'payout.paid'
353
+ | 'deposit.received'
354
+ | 'return.initiated'
355
+ | 'return.succeeded'
356
+ | 'return.failed'
357
+ | 'return.returned'
318
358
  >;
319
359
 
360
+ /**
361
+ * The new endpoint where webhook events are sent
362
+ */
320
363
  url?: string;
321
364
  }
322
365
 
323
- export interface WebhooksubscriptionListParams {
366
+ export interface SubscriptionListParams {
367
+ /**
368
+ * The maximum number of webhook subscriptions to return
369
+ */
324
370
  limit?: number;
325
371
 
372
+ /**
373
+ * The number of webhook subscriptions to skip
374
+ */
326
375
  skip?: number;
327
376
  }
328
377
 
329
- export interface WebhooksubscriptionDeleteParams {
330
- id: string;
378
+ export interface SubscriptionDeleteParams {
379
+ /**
380
+ * The unique identifier of the webhook subscription to delete
381
+ */
382
+ id: unknown;
331
383
  }
332
384
 
333
- export interface WebhooksubscriptionPingParams {
385
+ export interface SubscriptionPingParams {
334
386
  /**
335
- * The unique identifier for the webhook subscription to trigger.
387
+ * The unique identifier of the webhook subscription to ping
336
388
  */
337
- id: string;
389
+ id: unknown;
338
390
  }
339
391
 
340
- export declare namespace Webhooksubscription {
392
+ export declare namespace Subscription {
341
393
  export {
342
- type WebhooksubscriptionCreateResponse as WebhooksubscriptionCreateResponse,
343
- type WebhooksubscriptionUpdateResponse as WebhooksubscriptionUpdateResponse,
344
- type WebhooksubscriptionListResponse as WebhooksubscriptionListResponse,
345
- type WebhooksubscriptionDeleteResponse as WebhooksubscriptionDeleteResponse,
346
- type WebhooksubscriptionPingResponse as WebhooksubscriptionPingResponse,
347
- type WebhooksubscriptionCreateParams as WebhooksubscriptionCreateParams,
348
- type WebhooksubscriptionUpdateParams as WebhooksubscriptionUpdateParams,
349
- type WebhooksubscriptionListParams as WebhooksubscriptionListParams,
350
- type WebhooksubscriptionDeleteParams as WebhooksubscriptionDeleteParams,
351
- type WebhooksubscriptionPingParams as WebhooksubscriptionPingParams,
394
+ type SubscriptionCreateResponse as SubscriptionCreateResponse,
395
+ type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
396
+ type SubscriptionListResponse as SubscriptionListResponse,
397
+ type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
398
+ type SubscriptionPingResponse as SubscriptionPingResponse,
399
+ type SubscriptionCreateParams as SubscriptionCreateParams,
400
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
401
+ type SubscriptionListParams as SubscriptionListParams,
402
+ type SubscriptionDeleteParams as SubscriptionDeleteParams,
403
+ type SubscriptionPingParams as SubscriptionPingParams,
352
404
  };
353
405
  }
@@ -0,0 +1,69 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as SubscriptionAPI from './subscription';
6
+ import {
7
+ Subscription,
8
+ SubscriptionCreateParams,
9
+ SubscriptionCreateResponse,
10
+ SubscriptionDeleteParams,
11
+ SubscriptionDeleteResponse,
12
+ SubscriptionListParams,
13
+ SubscriptionListResponse,
14
+ SubscriptionPingParams,
15
+ SubscriptionPingResponse,
16
+ SubscriptionUpdateParams,
17
+ SubscriptionUpdateResponse,
18
+ } from './subscription';
19
+
20
+ export class Webhook extends APIResource {
21
+ subscription: SubscriptionAPI.Subscription = new SubscriptionAPI.Subscription(this._client);
22
+
23
+ /**
24
+ * This endpoint allows you to trigger a specific webhook by its ID.
25
+ */
26
+ trigger(
27
+ body: WebhookTriggerParams,
28
+ options?: Core.RequestOptions,
29
+ ): Core.APIPromise<WebhookTriggerResponse> {
30
+ return this._client.post('/api/service/webhook/trigger', { body, ...options });
31
+ }
32
+ }
33
+
34
+ export interface WebhookTriggerResponse {
35
+ /**
36
+ * Indicates whether the webhook was successfully triggered
37
+ */
38
+ success: boolean;
39
+ }
40
+
41
+ export interface WebhookTriggerParams {
42
+ /**
43
+ * The unique identifier for the webhook to trigger.
44
+ */
45
+ id: unknown;
46
+ }
47
+
48
+ Webhook.Subscription = Subscription;
49
+
50
+ export declare namespace Webhook {
51
+ export {
52
+ type WebhookTriggerResponse as WebhookTriggerResponse,
53
+ type WebhookTriggerParams as WebhookTriggerParams,
54
+ };
55
+
56
+ export {
57
+ Subscription as Subscription,
58
+ type SubscriptionCreateResponse as SubscriptionCreateResponse,
59
+ type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
60
+ type SubscriptionListResponse as SubscriptionListResponse,
61
+ type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
62
+ type SubscriptionPingResponse as SubscriptionPingResponse,
63
+ type SubscriptionCreateParams as SubscriptionCreateParams,
64
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
65
+ type SubscriptionListParams as SubscriptionListParams,
66
+ type SubscriptionDeleteParams as SubscriptionDeleteParams,
67
+ type SubscriptionPingParams as SubscriptionPingParams,
68
+ };
69
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './webhook/index';
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '1.1.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.9";
1
+ export declare const VERSION = "1.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.0-alpha.9'; // x-release-please-version
4
+ exports.VERSION = '1.1.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.9'; // x-release-please-version
1
+ export const VERSION = '1.1.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}