@getivy/node-sdk 1.4.0 → 1.6.1

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 (85) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/LICENSE +1 -1
  3. package/core.d.ts +1 -1
  4. package/core.d.ts.map +1 -1
  5. package/core.js +13 -17
  6. package/core.js.map +1 -1
  7. package/core.mjs +13 -17
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +7 -4
  10. package/index.d.ts +7 -4
  11. package/index.d.ts.map +1 -1
  12. package/index.js +4 -0
  13. package/index.js.map +1 -1
  14. package/index.mjs +4 -0
  15. package/index.mjs.map +1 -1
  16. package/internal/utils/query.d.ts +5 -0
  17. package/internal/utils/query.d.ts.map +1 -0
  18. package/internal/utils/query.js +24 -0
  19. package/internal/utils/query.js.map +1 -0
  20. package/internal/utils/query.mjs +20 -0
  21. package/internal/utils/query.mjs.map +1 -0
  22. package/package.json +1 -1
  23. package/resources/balance.d.ts +9 -3
  24. package/resources/balance.d.ts.map +1 -1
  25. package/resources/checkoutsession.d.ts +80 -121
  26. package/resources/checkoutsession.d.ts.map +1 -1
  27. package/resources/data/accounts.d.ts +12 -1
  28. package/resources/data/accounts.d.ts.map +1 -1
  29. package/resources/data/transactions.d.ts +19 -133
  30. package/resources/data/transactions.d.ts.map +1 -1
  31. package/resources/deposits.d.ts +32 -6
  32. package/resources/deposits.d.ts.map +1 -1
  33. package/resources/fx.d.ts +70 -6
  34. package/resources/fx.d.ts.map +1 -1
  35. package/resources/fx.js +6 -0
  36. package/resources/fx.js.map +1 -1
  37. package/resources/fx.mjs +6 -0
  38. package/resources/fx.mjs.map +1 -1
  39. package/resources/index.d.ts +3 -2
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js +3 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -0
  44. package/resources/index.mjs.map +1 -1
  45. package/resources/orders.d.ts +147 -141
  46. package/resources/orders.d.ts.map +1 -1
  47. package/resources/payee.d.ts +50 -0
  48. package/resources/payee.d.ts.map +1 -0
  49. package/resources/payee.js +30 -0
  50. package/resources/payee.js.map +1 -0
  51. package/resources/payee.mjs +26 -0
  52. package/resources/payee.mjs.map +1 -0
  53. package/resources/payouts.d.ts +124 -18
  54. package/resources/payouts.d.ts.map +1 -1
  55. package/resources/refunds.d.ts +3 -9
  56. package/resources/refunds.d.ts.map +1 -1
  57. package/resources/refunds.js.map +1 -1
  58. package/resources/refunds.mjs.map +1 -1
  59. package/resources/returns.d.ts +2 -2
  60. package/resources/returns.d.ts.map +1 -1
  61. package/resources/transactions.d.ts +25 -2
  62. package/resources/transactions.d.ts.map +1 -1
  63. package/resources/webhook/subscription.d.ts +5 -5
  64. package/resources/webhook/subscription.d.ts.map +1 -1
  65. package/src/core.ts +16 -21
  66. package/src/index.ts +14 -2
  67. package/src/internal/utils/query.ts +23 -0
  68. package/src/resources/balance.ts +10 -3
  69. package/src/resources/checkoutsession.ts +360 -178
  70. package/src/resources/data/accounts.ts +15 -1
  71. package/src/resources/data/transactions.ts +19 -175
  72. package/src/resources/deposits.ts +56 -6
  73. package/src/resources/fx.ts +83 -5
  74. package/src/resources/index.ts +3 -1
  75. package/src/resources/orders.ts +195 -189
  76. package/src/resources/payee.ts +63 -0
  77. package/src/resources/payouts.ts +208 -18
  78. package/src/resources/refunds.ts +2 -29
  79. package/src/resources/returns.ts +2 -2
  80. package/src/resources/transactions.ts +38 -2
  81. package/src/resources/webhook/subscription.ts +15 -20
  82. package/src/version.ts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
@@ -54,7 +54,7 @@ export namespace AccountListResponse {
54
54
 
55
55
  export namespace Account {
56
56
  export interface FinancialAddress {
57
- type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
57
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban' | 'wallet';
58
58
 
59
59
  bankCode?: FinancialAddress.BankCode;
60
60
 
@@ -63,6 +63,8 @@ export namespace AccountListResponse {
63
63
  iban?: FinancialAddress.Iban;
64
64
 
65
65
  sortCode?: FinancialAddress.SortCode;
66
+
67
+ wallet?: FinancialAddress.Wallet;
66
68
  }
67
69
 
68
70
  export namespace FinancialAddress {
@@ -97,6 +99,18 @@ export namespace AccountListResponse {
97
99
 
98
100
  accountHolderName?: string;
99
101
  }
102
+
103
+ export interface Wallet {
104
+ /**
105
+ * The blockchain wallet address
106
+ */
107
+ address: string;
108
+
109
+ /**
110
+ * The blockchain network
111
+ */
112
+ blockchain: 'ETH' | 'ETH-SEPOLIA' | 'SOL' | 'SOL-DEVNET' | 'MATIC' | 'MATIC-AMOY';
113
+ }
100
114
  }
101
115
  }
102
116
  }
@@ -15,216 +15,60 @@ export class Transactions extends APIResource {
15
15
 
16
16
  export interface TransactionListResponse {
17
17
  /**
18
- * Array of transactions
18
+ * Array of transactions for the given data session
19
19
  */
20
- data: Array<TransactionListResponse.Data>;
21
-
22
- /**
23
- * Pagination information
24
- */
25
- paging: TransactionListResponse.Paging;
20
+ transactions: Array<TransactionListResponse.Transaction>;
26
21
  }
27
22
 
28
23
  export namespace TransactionListResponse {
29
- export interface Data {
24
+ export interface Transaction {
30
25
  /**
31
- * Transaction identifier
26
+ * The ID of the transaction.
32
27
  */
33
28
  id: string;
34
29
 
35
30
  /**
36
- * Amount of the transaction
31
+ * The ID of the account the transaction belongs to.
37
32
  */
38
- amount: string;
33
+ accountId: string;
39
34
 
40
35
  /**
41
- * Balance information
36
+ * The amount of the transaction.
42
37
  */
43
- balance: Data.Balance;
44
-
45
- /**
46
- * Bank statement reference
47
- */
48
- bankStatementReference: string;
49
-
50
- /**
51
- * Creditor account details
52
- */
53
- creditor: Data.Creditor;
38
+ amount: string;
54
39
 
55
40
  /**
56
- * ISO 4217 currency code
41
+ * The currency of the transaction.
57
42
  */
58
43
  currency: string;
59
44
 
60
45
  /**
61
- * Debtor account details
62
- */
63
- debtor: Data.Debtor;
64
-
65
- /**
66
- * Side of the transaction
67
- */
68
- side: 'credit' | 'debit';
69
-
70
- /**
71
- * Transaction date as unix timestamp
46
+ * The date and time when the transaction occurred.
72
47
  */
73
- transactionDate: number;
74
- }
75
-
76
- export namespace Data {
77
- /**
78
- * Balance information
79
- */
80
- export interface Balance {
81
- /**
82
- * Balance after the transaction
83
- */
84
- after: string;
85
-
86
- /**
87
- * Balance before the transaction
88
- */
89
- before: string;
90
- }
91
-
92
- /**
93
- * Creditor account details
94
- */
95
- export interface Creditor {
96
- /**
97
- * Type of financial address
98
- */
99
- type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
100
-
101
- bankCode?: Creditor.BankCode;
102
-
103
- bban?: Creditor.Bban;
104
-
105
- iban?: Creditor.Iban;
106
-
107
- sortCode?: Creditor.SortCode;
108
- }
109
-
110
- export namespace Creditor {
111
- export interface BankCode {
112
- accountHolderName: string;
113
-
114
- accountNumber: string;
115
-
116
- code: string;
117
- }
118
-
119
- export interface Bban {
120
- accountHolderName: string;
121
-
122
- bban: string;
123
-
124
- bic?: string;
125
- }
126
-
127
- export interface Iban {
128
- accountHolderName: string;
129
-
130
- iban: string;
131
-
132
- bic?: string;
133
- }
134
-
135
- export interface SortCode {
136
- accountHolderName: string;
137
-
138
- accountNumber: string;
139
-
140
- sortCode: string;
141
- }
142
- }
48
+ timestamp: unknown;
143
49
 
144
50
  /**
145
- * Debtor account details
51
+ * The type of transaction (debit or credit).
146
52
  */
147
- export interface Debtor {
148
- /**
149
- * Type of financial address
150
- */
151
- type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
152
-
153
- bankCode?: Debtor.BankCode;
154
-
155
- bban?: Debtor.Bban;
156
-
157
- iban?: Debtor.Iban;
158
-
159
- sortCode?: Debtor.SortCode;
160
- }
161
-
162
- export namespace Debtor {
163
- export interface BankCode {
164
- accountHolderName: string;
165
-
166
- accountNumber: string;
167
-
168
- code: string;
169
- }
170
-
171
- export interface Bban {
172
- accountHolderName: string;
173
-
174
- bban: string;
53
+ type: 'credit' | 'debit';
175
54
 
176
- bic?: string;
177
- }
178
-
179
- export interface Iban {
180
- accountHolderName: string;
181
-
182
- iban: string;
183
-
184
- bic?: string;
185
- }
186
-
187
- export interface SortCode {
188
- accountHolderName: string;
189
-
190
- accountNumber: string;
191
-
192
- sortCode: string;
193
- }
194
- }
195
- }
196
-
197
- /**
198
- * Pagination information
199
- */
200
- export interface Paging {
201
55
  /**
202
- * Whether there are more transactions available
56
+ * The name of the counterparty (creditor or debtor) if available.
203
57
  */
204
- hasNext: boolean;
58
+ counterpartyName?: string;
205
59
 
206
60
  /**
207
- * Cursor for the next page of results
61
+ * The description of the transaction.
208
62
  */
209
- nextCursor?: string;
63
+ description?: string;
210
64
  }
211
65
  }
212
66
 
213
67
  export interface TransactionListParams {
214
68
  /**
215
- * Start timestamp (inclusive) - unix timestamp
216
- */
217
- from: number;
218
-
219
- /**
220
- * End timestamp (exclusive) - unix timestamp
221
- */
222
- to: number;
223
-
224
- /**
225
- * Cursor for pagination
69
+ * The ID of the data session to retrieve transactions for.
226
70
  */
227
- afterCursor?: string;
71
+ sessionId: string;
228
72
  }
229
73
 
230
74
  export declare namespace Transactions {
@@ -29,7 +29,7 @@ export interface DepositRetrieveResponse {
29
29
  /**
30
30
  * The currency of the deposit
31
31
  */
32
- currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
32
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK' | 'USDC';
33
33
 
34
34
  /**
35
35
  * The payee account identifier
@@ -64,9 +64,31 @@ export interface DepositRetrieveResponse {
64
64
  bankStatementReference?: string;
65
65
 
66
66
  /**
67
- * The payment rail used for the deposit
67
+ * The payment rail or blockchain used for the deposit
68
68
  */
69
- rail?: string;
69
+ rail?:
70
+ | 'sepa_instant'
71
+ | 'faster_payments'
72
+ | 'sepa'
73
+ | 'elixir'
74
+ | 'express_elixir'
75
+ | 'sek_account_to_account'
76
+ | 'sumclearing'
77
+ | 'straksclearing'
78
+ | 'swift'
79
+ | 'internal'
80
+ | 'target'
81
+ | 'ETH'
82
+ | 'ETH-SEPOLIA'
83
+ | 'SOL'
84
+ | 'SOL-DEVNET'
85
+ | 'MATIC'
86
+ | 'MATIC-AMOY';
87
+
88
+ /**
89
+ * The transaction hash for crypto deposits
90
+ */
91
+ txHash?: string;
70
92
  }
71
93
 
72
94
  export namespace DepositRetrieveResponse {
@@ -74,7 +96,7 @@ export namespace DepositRetrieveResponse {
74
96
  * The payee account identifier
75
97
  */
76
98
  export interface Payee {
77
- type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
99
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban' | 'wallet';
78
100
 
79
101
  bankCode?: Payee.BankCode;
80
102
 
@@ -83,6 +105,8 @@ export namespace DepositRetrieveResponse {
83
105
  iban?: Payee.Iban;
84
106
 
85
107
  sortCode?: Payee.SortCode;
108
+
109
+ wallet?: Payee.Wallet;
86
110
  }
87
111
 
88
112
  export namespace Payee {
@@ -117,13 +141,25 @@ export namespace DepositRetrieveResponse {
117
141
 
118
142
  sortCode: string;
119
143
  }
144
+
145
+ export interface Wallet {
146
+ /**
147
+ * The blockchain wallet address
148
+ */
149
+ address: string;
150
+
151
+ /**
152
+ * The blockchain network
153
+ */
154
+ blockchain: 'ETH' | 'ETH-SEPOLIA' | 'SOL' | 'SOL-DEVNET' | 'MATIC' | 'MATIC-AMOY';
155
+ }
120
156
  }
121
157
 
122
158
  /**
123
159
  * The payer account identifier
124
160
  */
125
161
  export interface Payer {
126
- type: 'iban' | 'sort_code' | 'bank_code' | 'bban';
162
+ type: 'iban' | 'sort_code' | 'bank_code' | 'bban' | 'wallet';
127
163
 
128
164
  bankCode?: Payer.BankCode;
129
165
 
@@ -132,6 +168,8 @@ export namespace DepositRetrieveResponse {
132
168
  iban?: Payer.Iban;
133
169
 
134
170
  sortCode?: Payer.SortCode;
171
+
172
+ wallet?: Payer.Wallet;
135
173
  }
136
174
 
137
175
  export namespace Payer {
@@ -166,6 +204,18 @@ export namespace DepositRetrieveResponse {
166
204
 
167
205
  sortCode: string;
168
206
  }
207
+
208
+ export interface Wallet {
209
+ /**
210
+ * The blockchain wallet address
211
+ */
212
+ address: string;
213
+
214
+ /**
215
+ * The blockchain network
216
+ */
217
+ blockchain: 'ETH' | 'ETH-SEPOLIA' | 'SOL' | 'SOL-DEVNET' | 'MATIC' | 'MATIC-AMOY';
218
+ }
169
219
  }
170
220
 
171
221
  export interface Return {
@@ -187,7 +237,7 @@ export namespace DepositRetrieveResponse {
187
237
  /**
188
238
  * The currency of the return
189
239
  */
190
- currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
240
+ currency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK' | 'USDC';
191
241
 
192
242
  /**
193
243
  * The ID of the associated deposit
@@ -11,6 +11,13 @@ export class Fx extends APIResource {
11
11
  return this._client.post('/api/service/fx/retrieve', { body, ...options });
12
12
  }
13
13
 
14
+ /**
15
+ * Execute a standalone foreign exchange transaction.
16
+ */
17
+ execute(body: FxExecuteParams, options?: Core.RequestOptions): Core.APIPromise<FxExecuteResponse> {
18
+ return this._client.post('/api/service/fx/execute', { body, ...options });
19
+ }
20
+
14
21
  /**
15
22
  * Retrieve the current exchange rate for a given currency pair. The rate is not
16
23
  * guaranteed for any following transactions.
@@ -37,17 +44,59 @@ export interface FxRetrieveResponse {
37
44
  /**
38
45
  * The source currency code
39
46
  */
40
- sourceCurrency: 'EUR' | 'GBP';
47
+ sourceCurrency: 'EUR' | 'GBP' | 'USDC';
48
+
49
+ /**
50
+ * The status of the FX transaction.
51
+ */
52
+ status: 'initiated' | 'succeeded' | 'failed';
53
+
54
+ /**
55
+ * The target currency code
56
+ */
57
+ targetCurrency: 'EUR' | 'GBP' | 'USDC';
58
+
59
+ /**
60
+ * Additional metadata.
61
+ */
62
+ metadata?: { [key: string]: unknown };
63
+
64
+ /**
65
+ * The amount of source currency to convert.
66
+ */
67
+ sourceAmount?: string;
68
+
69
+ /**
70
+ * The amount of the target currency for the given source amount.
71
+ */
72
+ targetAmount?: string;
73
+ }
74
+
75
+ export interface FxExecuteResponse {
76
+ /**
77
+ * The fxId attached to the transfer.
78
+ */
79
+ id: string;
80
+
81
+ /**
82
+ * The exchange rate for the given currency pair.
83
+ */
84
+ rate: string;
85
+
86
+ /**
87
+ * The source currency code
88
+ */
89
+ sourceCurrency: 'EUR' | 'GBP' | 'USDC';
41
90
 
42
91
  /**
43
92
  * The status of the FX transaction.
44
93
  */
45
- status: 'success' | 'processing' | 'failed';
94
+ status: 'initiated' | 'succeeded' | 'failed';
46
95
 
47
96
  /**
48
97
  * The target currency code
49
98
  */
50
- targetCurrency: 'USDC';
99
+ targetCurrency: 'EUR' | 'GBP' | 'USDC';
51
100
 
52
101
  /**
53
102
  * Additional metadata.
@@ -91,16 +140,43 @@ export interface FxRetrieveParams {
91
140
  fxId: string;
92
141
  }
93
142
 
143
+ export interface FxExecuteParams {
144
+ /**
145
+ * The source account id.
146
+ */
147
+ sourceAccountId: string;
148
+
149
+ /**
150
+ * The amount of source currency to convert. Minimum: 10
151
+ */
152
+ sourceAmount: string;
153
+
154
+ /**
155
+ * The target account id.
156
+ */
157
+ targetAccountId: string;
158
+
159
+ /**
160
+ * Deprecated: use the Idempotency-Key request header instead.
161
+ */
162
+ idempotencyKey?: string;
163
+
164
+ /**
165
+ * Additional metadata.
166
+ */
167
+ metadata?: { [key: string]: unknown };
168
+ }
169
+
94
170
  export interface FxRetrieveRateParams {
95
171
  /**
96
172
  * The source currency code.
97
173
  */
98
- sourceCurrency: 'EUR' | 'GBP' | 'PLN' | 'SEK' | 'DKK';
174
+ sourceCurrency: 'EUR' | 'GBP' | 'USDC';
99
175
 
100
176
  /**
101
177
  * The target currency code.
102
178
  */
103
- targetCurrency: 'EUR' | 'GBP' | 'PLN' | 'USDC' | 'SEK' | 'DKK';
179
+ targetCurrency: 'EUR' | 'GBP' | 'USDC';
104
180
 
105
181
  /**
106
182
  * The amount of source currency to convert. If not provided, only the rate will be
@@ -112,8 +188,10 @@ export interface FxRetrieveRateParams {
112
188
  export declare namespace Fx {
113
189
  export {
114
190
  type FxRetrieveResponse as FxRetrieveResponse,
191
+ type FxExecuteResponse as FxExecuteResponse,
115
192
  type FxRetrieveRateResponse as FxRetrieveRateResponse,
116
193
  type FxRetrieveParams as FxRetrieveParams,
194
+ type FxExecuteParams as FxExecuteParams,
117
195
  type FxRetrieveRateParams as FxRetrieveRateParams,
118
196
  };
119
197
  }
@@ -39,8 +39,10 @@ export { Deposits, type DepositRetrieveResponse, type DepositRetrieveParams } fr
39
39
  export {
40
40
  Fx,
41
41
  type FxRetrieveResponse,
42
+ type FxExecuteResponse,
42
43
  type FxRetrieveRateResponse,
43
44
  type FxRetrieveParams,
45
+ type FxExecuteParams,
44
46
  type FxRetrieveRateParams,
45
47
  } from './fx';
46
48
  export {
@@ -52,6 +54,7 @@ export {
52
54
  type OrderRetrieveParams,
53
55
  type OrderExpireParams,
54
56
  } from './orders';
57
+ export { Payee, type PayeeVerifyResponse, type PayeeVerifyParams } from './payee';
55
58
  export {
56
59
  Payouts,
57
60
  type Payout,
@@ -65,7 +68,6 @@ export {
65
68
  Refunds,
66
69
  type Refund,
67
70
  type RefundCreateResponse,
68
- type RefundRetrieveResponse,
69
71
  type RefundCreateParams,
70
72
  type RefundRetrieveParams,
71
73
  } from './refunds';