@getivy/node-sdk 0.1.0-alpha.33 → 0.1.0-alpha.35

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 (60) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +2 -0
  3. package/core.d.ts +7 -4
  4. package/core.d.ts.map +1 -1
  5. package/core.js +16 -9
  6. package/core.js.map +1 -1
  7. package/core.mjs +16 -9
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +3 -0
  10. package/index.d.ts +3 -0
  11. package/index.d.ts.map +1 -1
  12. package/index.js +6 -2
  13. package/index.js.map +1 -1
  14. package/index.mjs +6 -2
  15. package/index.mjs.map +1 -1
  16. package/package.json +4 -5
  17. package/resource.d.ts +1 -1
  18. package/resource.d.ts.map +1 -1
  19. package/resource.js.map +1 -1
  20. package/resource.mjs.map +1 -1
  21. package/resources/banks.d.ts +3 -3
  22. package/resources/banks.d.ts.map +1 -1
  23. package/resources/checkoutsession.d.ts +16 -19
  24. package/resources/checkoutsession.d.ts.map +1 -1
  25. package/resources/orders.d.ts +10 -6
  26. package/resources/orders.d.ts.map +1 -1
  27. package/resources/payouts.d.ts +132 -92
  28. package/resources/payouts.d.ts.map +1 -1
  29. package/resources/payouts.js +3 -4
  30. package/resources/payouts.js.map +1 -1
  31. package/resources/payouts.mjs +3 -4
  32. package/resources/payouts.mjs.map +1 -1
  33. package/resources/refunds.d.ts +4 -0
  34. package/resources/refunds.d.ts.map +1 -1
  35. package/resources/refunds.js +4 -0
  36. package/resources/refunds.js.map +1 -1
  37. package/resources/refunds.mjs +4 -0
  38. package/resources/refunds.mjs.map +1 -1
  39. package/resources/reports.d.ts +4 -0
  40. package/resources/reports.d.ts.map +1 -1
  41. package/resources/reports.js +4 -0
  42. package/resources/reports.js.map +1 -1
  43. package/resources/reports.mjs +4 -0
  44. package/resources/reports.mjs.map +1 -1
  45. package/resources/subaccounts.d.ts +0 -2
  46. package/resources/subaccounts.d.ts.map +1 -1
  47. package/src/core.ts +17 -8
  48. package/src/index.ts +11 -0
  49. package/src/resource.ts +1 -1
  50. package/src/resources/banks.ts +9 -0
  51. package/src/resources/checkoutsession.ts +8 -28
  52. package/src/resources/orders.ts +8 -4
  53. package/src/resources/payouts.ts +129 -128
  54. package/src/resources/refunds.ts +4 -0
  55. package/src/resources/reports.ts +4 -0
  56. package/src/resources/subaccounts.ts +0 -4
  57. package/src/version.ts +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
  60. package/version.mjs +1 -1
@@ -5,15 +5,14 @@ import * as Core from '../core';
5
5
 
6
6
  export class Payouts extends APIResource {
7
7
  /**
8
- * Create a Customer Payout to a customer's bank account for withdrawals or similar
9
- * purposes.
8
+ * Create a payout for a merchant.
10
9
  */
11
10
  create(body: PayoutCreateParams, options?: Core.RequestOptions): Core.APIPromise<PayoutCreateResponse> {
12
11
  return this._client.post('/api/service/payout/create', { body, ...options });
13
12
  }
14
13
 
15
14
  /**
16
- * Retrieve a Customer Payout by id
15
+ * Retrieve a payout object by id.
17
16
  */
18
17
  retrieve(
19
18
  body: PayoutRetrieveParams,
@@ -23,7 +22,7 @@ export class Payouts extends APIResource {
23
22
  }
24
23
 
25
24
  /**
26
- * List all Customer Payouts made by this merchant account.
25
+ * List payouts for a merchant.
27
26
  */
28
27
  list(body: PayoutListParams, options?: Core.RequestOptions): Core.APIPromise<PayoutListResponse> {
29
28
  return this._client.post('/api/service/payout/list', { body, ...options });
@@ -31,29 +30,62 @@ export class Payouts extends APIResource {
31
30
  }
32
31
 
33
32
  export interface PayoutCreateResponse {
33
+ /**
34
+ * The payout ID
35
+ */
34
36
  id: string;
35
37
 
38
+ /**
39
+ * The payout amount
40
+ */
36
41
  amount: number;
37
42
 
43
+ /**
44
+ * The payout created at
45
+ */
38
46
  createdAt: unknown;
39
47
 
48
+ /**
49
+ * The payout currency
50
+ */
40
51
  currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
41
52
 
53
+ /**
54
+ * The payout destination
55
+ */
42
56
  destination: PayoutCreateResponse.Destination;
43
57
 
44
- status: 'pending' | 'paid' | 'failed';
58
+ /**
59
+ * The payout status
60
+ */
61
+ status: 'paid' | 'pending' | 'in_transit' | 'failed' | 'canceled';
62
+
63
+ /**
64
+ * The payout type
65
+ */
66
+ type: 'beneficiary' | 'customer';
45
67
 
68
+ /**
69
+ * The payout updated at
70
+ */
46
71
  updatedAt: unknown;
47
72
 
48
- metadata?: Record<string, unknown>;
73
+ /**
74
+ * The payout metadata
75
+ */
76
+ metadata?: { [key: string]: unknown };
49
77
 
78
+ /**
79
+ * The payout payment reference
80
+ */
50
81
  paymentReference?: string;
51
82
  }
52
83
 
53
84
  export namespace PayoutCreateResponse {
85
+ /**
86
+ * The payout destination
87
+ */
54
88
  export interface Destination {
55
- psuData: Destination.PsuData | null;
56
-
57
89
  type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
58
90
 
59
91
  bankCode?: Destination.BankCode;
@@ -62,28 +94,10 @@ export namespace PayoutCreateResponse {
62
94
 
63
95
  iban?: Destination.Iban;
64
96
 
65
- paymentReference?: string;
66
-
67
97
  sortCode?: Destination.SortCode;
68
98
  }
69
99
 
70
100
  export namespace Destination {
71
- export interface PsuData {
72
- branchNumber?: string;
73
-
74
- clientId?: string;
75
-
76
- ipAddress?: string;
77
-
78
- oib?: string;
79
-
80
- psuId?: string;
81
-
82
- ssn?: string;
83
-
84
- username?: string;
85
- }
86
-
87
101
  export interface BankCode {
88
102
  accountHolderName: string;
89
103
 
@@ -119,29 +133,62 @@ export namespace PayoutCreateResponse {
119
133
  }
120
134
 
121
135
  export interface PayoutRetrieveResponse {
136
+ /**
137
+ * The payout ID
138
+ */
122
139
  id: string;
123
140
 
141
+ /**
142
+ * The payout amount
143
+ */
124
144
  amount: number;
125
145
 
146
+ /**
147
+ * The payout created at
148
+ */
126
149
  createdAt: unknown;
127
150
 
151
+ /**
152
+ * The payout currency
153
+ */
128
154
  currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
129
155
 
156
+ /**
157
+ * The payout destination
158
+ */
130
159
  destination: PayoutRetrieveResponse.Destination;
131
160
 
132
- status: 'pending' | 'paid' | 'failed';
161
+ /**
162
+ * The payout status
163
+ */
164
+ status: 'paid' | 'pending' | 'in_transit' | 'failed' | 'canceled';
165
+
166
+ /**
167
+ * The payout type
168
+ */
169
+ type: 'beneficiary' | 'customer';
133
170
 
171
+ /**
172
+ * The payout updated at
173
+ */
134
174
  updatedAt: unknown;
135
175
 
136
- metadata?: Record<string, unknown>;
176
+ /**
177
+ * The payout metadata
178
+ */
179
+ metadata?: { [key: string]: unknown };
137
180
 
181
+ /**
182
+ * The payout payment reference
183
+ */
138
184
  paymentReference?: string;
139
185
  }
140
186
 
141
187
  export namespace PayoutRetrieveResponse {
188
+ /**
189
+ * The payout destination
190
+ */
142
191
  export interface Destination {
143
- psuData: Destination.PsuData | null;
144
-
145
192
  type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
146
193
 
147
194
  bankCode?: Destination.BankCode;
@@ -150,28 +197,10 @@ export namespace PayoutRetrieveResponse {
150
197
 
151
198
  iban?: Destination.Iban;
152
199
 
153
- paymentReference?: string;
154
-
155
200
  sortCode?: Destination.SortCode;
156
201
  }
157
202
 
158
203
  export namespace Destination {
159
- export interface PsuData {
160
- branchNumber?: string;
161
-
162
- clientId?: string;
163
-
164
- ipAddress?: string;
165
-
166
- oib?: string;
167
-
168
- psuId?: string;
169
-
170
- ssn?: string;
171
-
172
- username?: string;
173
- }
174
-
175
204
  export interface BankCode {
176
205
  accountHolderName: string;
177
206
 
@@ -207,52 +236,73 @@ export namespace PayoutRetrieveResponse {
207
236
  }
208
237
 
209
238
  export interface PayoutListResponse {
210
- /**
211
- * The total number of items
212
- */
213
239
  count: number;
214
240
 
215
- /**
216
- * Whether there are more items to retrieve
217
- */
218
241
  hasNext: boolean;
219
242
 
220
- /**
221
- * Array of Customer Payout objects
222
- */
223
243
  items: Array<PayoutListResponse.Item>;
224
244
 
225
- /**
226
- * The number of items skipped
227
- */
228
245
  skip: number;
229
246
  }
230
247
 
231
248
  export namespace PayoutListResponse {
232
249
  export interface Item {
250
+ /**
251
+ * The payout ID
252
+ */
233
253
  id: string;
234
254
 
255
+ /**
256
+ * The payout amount
257
+ */
235
258
  amount: number;
236
259
 
260
+ /**
261
+ * The payout created at
262
+ */
237
263
  createdAt: unknown;
238
264
 
265
+ /**
266
+ * The payout currency
267
+ */
239
268
  currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
240
269
 
270
+ /**
271
+ * The payout destination
272
+ */
241
273
  destination: Item.Destination;
242
274
 
243
- status: 'pending' | 'paid' | 'failed';
275
+ /**
276
+ * The payout status
277
+ */
278
+ status: 'paid' | 'pending' | 'in_transit' | 'failed' | 'canceled';
279
+
280
+ /**
281
+ * The payout type
282
+ */
283
+ type: 'beneficiary' | 'customer';
244
284
 
285
+ /**
286
+ * The payout updated at
287
+ */
245
288
  updatedAt: unknown;
246
289
 
247
- metadata?: Record<string, unknown>;
290
+ /**
291
+ * The payout metadata
292
+ */
293
+ metadata?: { [key: string]: unknown };
248
294
 
295
+ /**
296
+ * The payout payment reference
297
+ */
249
298
  paymentReference?: string;
250
299
  }
251
300
 
252
301
  export namespace Item {
302
+ /**
303
+ * The payout destination
304
+ */
253
305
  export interface Destination {
254
- psuData: Destination.PsuData | null;
255
-
256
306
  type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
257
307
 
258
308
  bankCode?: Destination.BankCode;
@@ -261,28 +311,10 @@ export namespace PayoutListResponse {
261
311
 
262
312
  iban?: Destination.Iban;
263
313
 
264
- paymentReference?: string;
265
-
266
314
  sortCode?: Destination.SortCode;
267
315
  }
268
316
 
269
317
  export namespace Destination {
270
- export interface PsuData {
271
- branchNumber?: string;
272
-
273
- clientId?: string;
274
-
275
- ipAddress?: string;
276
-
277
- oib?: string;
278
-
279
- psuId?: string;
280
-
281
- ssn?: string;
282
-
283
- username?: string;
284
- }
285
-
286
318
  export interface BankCode {
287
319
  accountHolderName: string;
288
320
 
@@ -320,56 +352,47 @@ export namespace PayoutListResponse {
320
352
 
321
353
  export interface PayoutCreateParams {
322
354
  /**
323
- * The amount of the customer payout
355
+ * The payout amount in decimal format. The minimum amount is 0.01.
324
356
  */
325
357
  amount: number;
326
358
 
327
359
  /**
328
- * The currency of the customer payout
360
+ * The payout currency
329
361
  */
330
362
  currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
331
363
 
332
364
  /**
333
- * The destination of the customer payout.
365
+ * The payout destination
334
366
  */
335
367
  destination: PayoutCreateParams.Destination;
336
368
 
337
369
  /**
338
- * The metadata of the customer payout
370
+ * This can be used to store any additional information you need to associate with
371
+ * this payout.
339
372
  */
340
- metadata?: Record<string, unknown>;
373
+ metadata?: { [key: string]: unknown };
341
374
 
342
375
  /**
343
- * The payment reference of the customer payout. The customer will see this
344
- * reference in their bank statement.
376
+ * The payout payment reference. This is visible to the receiving party, if
377
+ * possible.
345
378
  */
346
379
  paymentReference?: string;
347
380
  }
348
381
 
349
382
  export namespace PayoutCreateParams {
350
383
  /**
351
- * The destination of the customer payout.
384
+ * The payout destination
352
385
  */
353
386
  export interface Destination {
354
- /**
355
- * Used for open-loop customer payouts. Disabled by default for merchants.
356
- */
357
- financialAddress?: Destination.FinancialAddress;
387
+ financialAddress?: Destination.FinancialAddress | null;
358
388
 
359
- /**
360
- * For closed-loop customer payouts. The destination account will be taken from the
361
- * payer of this order.
362
- */
363
389
  orderId?: string;
390
+
391
+ type?: 'beneficiary';
364
392
  }
365
393
 
366
394
  export namespace Destination {
367
- /**
368
- * Used for open-loop customer payouts. Disabled by default for merchants.
369
- */
370
395
  export interface FinancialAddress {
371
- psuData: FinancialAddress.PsuData | null;
372
-
373
396
  type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
374
397
 
375
398
  bankCode?: FinancialAddress.BankCode;
@@ -378,28 +401,10 @@ export namespace PayoutCreateParams {
378
401
 
379
402
  iban?: FinancialAddress.Iban;
380
403
 
381
- paymentReference?: string;
382
-
383
404
  sortCode?: FinancialAddress.SortCode;
384
405
  }
385
406
 
386
407
  export namespace FinancialAddress {
387
- export interface PsuData {
388
- branchNumber?: string;
389
-
390
- clientId?: string;
391
-
392
- ipAddress?: string;
393
-
394
- oib?: string;
395
-
396
- psuId?: string;
397
-
398
- ssn?: string;
399
-
400
- username?: string;
401
- }
402
-
403
408
  export interface BankCode {
404
409
  accountHolderName: string;
405
410
 
@@ -437,21 +442,17 @@ export namespace PayoutCreateParams {
437
442
 
438
443
  export interface PayoutRetrieveParams {
439
444
  /**
440
- * The unique identifier of the Customer Payout
445
+ * The payout ID
441
446
  */
442
447
  id: string;
443
448
  }
444
449
 
445
450
  export interface PayoutListParams {
446
- /**
447
- * The number of items to retrieve
448
- */
449
451
  limit?: number;
450
452
 
451
- /**
452
- * The number of items to skip
453
- */
454
453
  skip?: number;
454
+
455
+ type?: 'customer-payout' | 'beneficiary-payout';
455
456
  }
456
457
 
457
458
  export declare namespace Payouts {
@@ -9,6 +9,8 @@ export class Refunds extends APIResource {
9
9
  * Ivy's internal `orderId` or by the `referenceId` provided by the merchant during
10
10
  * checkout creation. If the refund should only be partial, you can specifiy this
11
11
  * with the `amount` parameter.
12
+ *
13
+ * @deprecated
12
14
  */
13
15
  create(body: RefundCreateParams, options?: Core.RequestOptions): Core.APIPromise<RefundCreateResponse> {
14
16
  return this._client.post('/api/service/merchant/payment/refund', { body, ...options });
@@ -20,6 +22,8 @@ export class Refunds extends APIResource {
20
22
  * ("referenceId"). If only a partial amount should be refunded the desired amount
21
23
  * can be set with the "amount" parameter. Additional information regarding the
22
24
  * refund can be provided through the "description" parameter.
25
+ *
26
+ * @deprecated
23
27
  */
24
28
  batch(body: RefundBatchParams, options?: Core.RequestOptions): Core.APIPromise<RefundBatchResponse> {
25
29
  return this._client.post('/api/service/merchant/payment/refund/batch', { body, ...options });
@@ -8,6 +8,8 @@ export class Reports extends APIResource {
8
8
  * Create a Payout Report for a given timerange. A Payout Report is generated
9
9
  * async. Please follow [this guide](https://docs.getivy.de/docs/payout-report-1)
10
10
  * to learn more in detail.
11
+ *
12
+ * @deprecated
11
13
  */
12
14
  create(body: ReportCreateParams, options?: Core.RequestOptions): Core.APIPromise<ReportCreateResponse> {
13
15
  return this._client.post('/api/service/merchant/payout/export/create', { body, ...options });
@@ -27,6 +29,8 @@ export class Reports extends APIResource {
27
29
  /**
28
30
  * Download the actual Payout Report once the creation succeeded with this
29
31
  * endpoint.
32
+ *
33
+ * @deprecated
30
34
  */
31
35
  download(body: ReportDownloadParams, options?: Core.RequestOptions): Core.APIPromise<void> {
32
36
  return this._client.post('/api/service/merchant/payout/export/download', {
@@ -41,8 +41,6 @@ export interface SubaccountCreateResponse {
41
41
 
42
42
  updatedAt: unknown;
43
43
 
44
- themeName?: 'default' | 'kraken' | 'inpay';
45
-
46
44
  websiteUrl?: string;
47
45
  }
48
46
 
@@ -61,8 +59,6 @@ export interface SubaccountRetrieveResponse {
61
59
 
62
60
  updatedAt: unknown;
63
61
 
64
- themeName?: 'default' | 'kraken' | 'inpay';
65
-
66
62
  websiteUrl?: string;
67
63
  }
68
64
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.0-alpha.33'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.35'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.0-alpha.33";
1
+ export declare const VERSION = "0.1.0-alpha.35";
2
2
  //# sourceMappingURL=version.d.ts.map
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.33'; // x-release-please-version
4
+ exports.VERSION = '0.1.0-alpha.35'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-alpha.33'; // x-release-please-version
1
+ export const VERSION = '0.1.0-alpha.35'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map