modern-treasury 0.0.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 (169) hide show
  1. package/.eslintrc.js +10 -0
  2. package/.prettierrc +6 -0
  3. package/LICENSE +7 -0
  4. package/README.md +198 -0
  5. package/build +10 -0
  6. package/core.ts +746 -0
  7. package/dist/cjs/core.d.ts +215 -0
  8. package/dist/cjs/core.js +815 -0
  9. package/dist/cjs/core.js.map +1 -0
  10. package/dist/cjs/index.d.ts +118 -0
  11. package/dist/cjs/index.js +128 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/pagination.d.ts +14 -0
  14. package/dist/cjs/pagination.js +22 -0
  15. package/dist/cjs/pagination.js.map +1 -0
  16. package/dist/cjs/resource.d.ts +11 -0
  17. package/dist/cjs/resource.js +16 -0
  18. package/dist/cjs/resource.js.map +1 -0
  19. package/dist/cjs/resources/counterparties.d.ts +500 -0
  20. package/dist/cjs/resources/counterparties.js +57 -0
  21. package/dist/cjs/resources/counterparties.js.map +1 -0
  22. package/dist/cjs/resources/documents.d.ts +66 -0
  23. package/dist/cjs/resources/documents.js +23 -0
  24. package/dist/cjs/resources/documents.js.map +1 -0
  25. package/dist/cjs/resources/events.d.ts +53 -0
  26. package/dist/cjs/resources/events.js +22 -0
  27. package/dist/cjs/resources/events.js.map +1 -0
  28. package/dist/cjs/resources/expected-payments.d.ts +928 -0
  29. package/dist/cjs/resources/expected-payments.js +31 -0
  30. package/dist/cjs/resources/expected-payments.js.map +1 -0
  31. package/dist/cjs/resources/external-accounts.d.ts +597 -0
  32. package/dist/cjs/resources/external-accounts.js +51 -0
  33. package/dist/cjs/resources/external-accounts.js.map +1 -0
  34. package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
  35. package/dist/cjs/resources/incoming-payment-details.js +35 -0
  36. package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
  37. package/dist/cjs/resources/index.d.ts +15 -0
  38. package/dist/cjs/resources/index.js +46 -0
  39. package/dist/cjs/resources/index.js.map +1 -0
  40. package/dist/cjs/resources/internal-accounts.d.ts +666 -0
  41. package/dist/cjs/resources/internal-accounts.js +31 -0
  42. package/dist/cjs/resources/internal-accounts.js.map +1 -0
  43. package/dist/cjs/resources/line-items.d.ts +90 -0
  44. package/dist/cjs/resources/line-items.js +38 -0
  45. package/dist/cjs/resources/line-items.js.map +1 -0
  46. package/dist/cjs/resources/paper-items.d.ts +279 -0
  47. package/dist/cjs/resources/paper-items.js +25 -0
  48. package/dist/cjs/resources/paper-items.js.map +1 -0
  49. package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
  50. package/dist/cjs/resources/payment-orders/index.js +33 -0
  51. package/dist/cjs/resources/payment-orders/index.js.map +1 -0
  52. package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
  53. package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
  54. package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
  55. package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
  56. package/dist/cjs/resources/payment-orders/reversals.js +23 -0
  57. package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
  58. package/dist/cjs/resources/returns.d.ts +487 -0
  59. package/dist/cjs/resources/returns.js +31 -0
  60. package/dist/cjs/resources/returns.js.map +1 -0
  61. package/dist/cjs/resources/top-level.d.ts +3 -0
  62. package/dist/cjs/resources/top-level.js +4 -0
  63. package/dist/cjs/resources/top-level.js.map +1 -0
  64. package/dist/cjs/resources/transactions.d.ts +377 -0
  65. package/dist/cjs/resources/transactions.js +31 -0
  66. package/dist/cjs/resources/transactions.js.map +1 -0
  67. package/dist/cjs/resources/validations.d.ts +97 -0
  68. package/dist/cjs/resources/validations.js +16 -0
  69. package/dist/cjs/resources/validations.js.map +1 -0
  70. package/dist/cjs/resources/webhooks.d.ts +31 -0
  71. package/dist/cjs/resources/webhooks.js +44 -0
  72. package/dist/cjs/resources/webhooks.js.map +1 -0
  73. package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
  74. package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
  75. package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
  76. package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
  77. package/dist/cjs/tests/api-resources/documents.test.js +78 -0
  78. package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
  79. package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
  80. package/dist/cjs/tests/api-resources/events.test.js +100 -0
  81. package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
  82. package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
  83. package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
  84. package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
  85. package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
  86. package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
  87. package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
  88. package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
  89. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
  90. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
  91. package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
  92. package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
  93. package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
  94. package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
  95. package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
  96. package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
  97. package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
  98. package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
  99. package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
  100. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
  101. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
  102. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
  103. package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
  104. package/dist/cjs/tests/api-resources/returns.test.js +116 -0
  105. package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
  106. package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
  107. package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
  108. package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
  109. package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
  110. package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
  111. package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
  112. package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
  113. package/dist/cjs/tests/api-resources/validations.test.js +62 -0
  114. package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
  115. package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
  116. package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
  117. package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
  118. package/dist/cjs/tests/form.test.d.ts +1 -0
  119. package/dist/cjs/tests/form.test.js +61 -0
  120. package/dist/cjs/tests/form.test.js.map +1 -0
  121. package/dist/cjs/tests/index.test.d.ts +1 -0
  122. package/dist/cjs/tests/index.test.js +57 -0
  123. package/dist/cjs/tests/index.test.js.map +1 -0
  124. package/dist/cjs/tests/responses.test.d.ts +1 -0
  125. package/dist/cjs/tests/responses.test.js +60 -0
  126. package/dist/cjs/tests/responses.test.js.map +1 -0
  127. package/index.ts +175 -0
  128. package/jest.config.js +8 -0
  129. package/package.json +47 -0
  130. package/pagination.ts +36 -0
  131. package/resource.ts +22 -0
  132. package/resources/counterparties.ts +666 -0
  133. package/resources/documents.ts +97 -0
  134. package/resources/events.ts +86 -0
  135. package/resources/expected-payments.ts +1016 -0
  136. package/resources/external-accounts.ts +762 -0
  137. package/resources/incoming-payment-details.ts +592 -0
  138. package/resources/index.ts +16 -0
  139. package/resources/internal-accounts.ts +774 -0
  140. package/resources/line-items.ts +138 -0
  141. package/resources/paper-items.ts +317 -0
  142. package/resources/payment-orders/index.ts +3 -0
  143. package/resources/payment-orders/payment-orders.ts +2486 -0
  144. package/resources/payment-orders/reversals.ts +72 -0
  145. package/resources/returns.ts +545 -0
  146. package/resources/top-level.ts +5 -0
  147. package/resources/transactions.ts +441 -0
  148. package/resources/validations.ts +115 -0
  149. package/resources/webhooks.ts +48 -0
  150. package/tests/api-resources/counterparties.test.ts +237 -0
  151. package/tests/api-resources/documents.test.ts +40 -0
  152. package/tests/api-resources/events.test.ts +62 -0
  153. package/tests/api-resources/expected-payments.test.ts +138 -0
  154. package/tests/api-resources/external-accounts.test.ts +210 -0
  155. package/tests/api-resources/incoming-payment-details.test.ts +92 -0
  156. package/tests/api-resources/internal-accounts.test.ts +103 -0
  157. package/tests/api-resources/line-items.test.ts +85 -0
  158. package/tests/api-resources/paper-items.test.ts +58 -0
  159. package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
  160. package/tests/api-resources/returns.test.ts +78 -0
  161. package/tests/api-resources/top-level.test.ts +21 -0
  162. package/tests/api-resources/transactions.test.ts +96 -0
  163. package/tests/api-resources/validations.test.ts +24 -0
  164. package/tests/api-resources/webhooks.test.ts +102 -0
  165. package/tests/form.test.ts +27 -0
  166. package/tests/index.test.ts +62 -0
  167. package/tests/responses.test.ts +25 -0
  168. package/tsconfig.cjs.json +8 -0
  169. package/tsconfig.json +36 -0
@@ -0,0 +1,666 @@
1
+ import * as Core from '../core';
2
+ import { APIResource } from '../resource';
3
+ import { Page, PageParams } from '../pagination';
4
+ export declare class InternalAccounts extends APIResource {
5
+ create(
6
+ body: InternalAccountCreateParams,
7
+ options?: Core.RequestOptions,
8
+ ): Promise<Core.APIResponse<InternalAccount>>;
9
+ retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<InternalAccount>>;
10
+ update(
11
+ id: string,
12
+ body?: InternalAccountUpdateParams,
13
+ options?: Core.RequestOptions,
14
+ ): Promise<Core.APIResponse<InternalAccount>>;
15
+ update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<InternalAccount>>;
16
+ list(
17
+ query?: InternalAccountListParams,
18
+ options?: Core.RequestOptions,
19
+ ): Core.PagePromise<InternalAccountsPage>;
20
+ list(options?: Core.RequestOptions): Core.PagePromise<InternalAccountsPage>;
21
+ }
22
+ export declare class InternalAccountsPage extends Page<InternalAccount> {}
23
+ export interface InternalAccount {
24
+ /**
25
+ * An array of account detail objects.
26
+ */
27
+ account_details?: Array<InternalAccount.AccountDetails>;
28
+ /**
29
+ * Can be checking, savings or other.
30
+ */
31
+ account_type?: 'checking' | 'other' | 'savings' | null;
32
+ /**
33
+ * Specifies which financial institution the accounts belong to.
34
+ */
35
+ connection?: InternalAccount.Connection;
36
+ created_at?: string;
37
+ /**
38
+ * The currency of the account.
39
+ */
40
+ currency?:
41
+ | 'AED'
42
+ | 'AFN'
43
+ | 'ALL'
44
+ | 'AMD'
45
+ | 'ANG'
46
+ | 'AOA'
47
+ | 'ARS'
48
+ | 'AUD'
49
+ | 'AWG'
50
+ | 'AZN'
51
+ | 'BAM'
52
+ | 'BBD'
53
+ | 'BCH'
54
+ | 'BDT'
55
+ | 'BGN'
56
+ | 'BHD'
57
+ | 'BIF'
58
+ | 'BMD'
59
+ | 'BND'
60
+ | 'BOB'
61
+ | 'BRL'
62
+ | 'BSD'
63
+ | 'BTC'
64
+ | 'BTN'
65
+ | 'BWP'
66
+ | 'BYN'
67
+ | 'BYR'
68
+ | 'BZD'
69
+ | 'CAD'
70
+ | 'CDF'
71
+ | 'CHF'
72
+ | 'CLF'
73
+ | 'CLP'
74
+ | 'CNH'
75
+ | 'CNY'
76
+ | 'COP'
77
+ | 'CRC'
78
+ | 'CUC'
79
+ | 'CUP'
80
+ | 'CVE'
81
+ | 'CZK'
82
+ | 'DJF'
83
+ | 'DKK'
84
+ | 'DOP'
85
+ | 'DZD'
86
+ | 'EEK'
87
+ | 'EGP'
88
+ | 'ERN'
89
+ | 'ETB'
90
+ | 'EUR'
91
+ | 'FJD'
92
+ | 'FKP'
93
+ | 'GBP'
94
+ | 'GBX'
95
+ | 'GEL'
96
+ | 'GGP'
97
+ | 'GHS'
98
+ | 'GIP'
99
+ | 'GMD'
100
+ | 'GNF'
101
+ | 'GTQ'
102
+ | 'GYD'
103
+ | 'HKD'
104
+ | 'HNL'
105
+ | 'HRK'
106
+ | 'HTG'
107
+ | 'HUF'
108
+ | 'IDR'
109
+ | 'ILS'
110
+ | 'IMP'
111
+ | 'INR'
112
+ | 'IQD'
113
+ | 'IRR'
114
+ | 'ISK'
115
+ | 'JEP'
116
+ | 'JMD'
117
+ | 'JOD'
118
+ | 'JPY'
119
+ | 'KES'
120
+ | 'KGS'
121
+ | 'KHR'
122
+ | 'KMF'
123
+ | 'KPW'
124
+ | 'KRW'
125
+ | 'KWD'
126
+ | 'KYD'
127
+ | 'KZT'
128
+ | 'LAK'
129
+ | 'LBP'
130
+ | 'LKR'
131
+ | 'LRD'
132
+ | 'LSL'
133
+ | 'LTL'
134
+ | 'LVL'
135
+ | 'LYD'
136
+ | 'MAD'
137
+ | 'MDL'
138
+ | 'MGA'
139
+ | 'MKD'
140
+ | 'MMK'
141
+ | 'MNT'
142
+ | 'MOP'
143
+ | 'MRO'
144
+ | 'MRU'
145
+ | 'MTL'
146
+ | 'MUR'
147
+ | 'MVR'
148
+ | 'MWK'
149
+ | 'MXN'
150
+ | 'MYR'
151
+ | 'MZN'
152
+ | 'NAD'
153
+ | 'NGN'
154
+ | 'NIO'
155
+ | 'NOK'
156
+ | 'NPR'
157
+ | 'NZD'
158
+ | 'OMR'
159
+ | 'PAB'
160
+ | 'PEN'
161
+ | 'PGK'
162
+ | 'PHP'
163
+ | 'PKR'
164
+ | 'PLN'
165
+ | 'PYG'
166
+ | 'QAR'
167
+ | 'RON'
168
+ | 'RSD'
169
+ | 'RUB'
170
+ | 'RWF'
171
+ | 'SAR'
172
+ | 'SBD'
173
+ | 'SCR'
174
+ | 'SDG'
175
+ | 'SEK'
176
+ | 'SGD'
177
+ | 'SHP'
178
+ | 'SKK'
179
+ | 'SLL'
180
+ | 'SOS'
181
+ | 'SRD'
182
+ | 'SSP'
183
+ | 'STD'
184
+ | 'SVC'
185
+ | 'SYP'
186
+ | 'SZL'
187
+ | 'THB'
188
+ | 'TJS'
189
+ | 'TMM'
190
+ | 'TMT'
191
+ | 'TND'
192
+ | 'TOP'
193
+ | 'TRY'
194
+ | 'TTD'
195
+ | 'TWD'
196
+ | 'TZS'
197
+ | 'UAH'
198
+ | 'UGX'
199
+ | 'USD'
200
+ | 'UYU'
201
+ | 'UZS'
202
+ | 'VEF'
203
+ | 'VES'
204
+ | 'VND'
205
+ | 'VUV'
206
+ | 'WST'
207
+ | 'XAF'
208
+ | 'XAG'
209
+ | 'XAU'
210
+ | 'XBA'
211
+ | 'XBB'
212
+ | 'XBC'
213
+ | 'XBD'
214
+ | 'XCD'
215
+ | 'XDR'
216
+ | 'XFU'
217
+ | 'XOF'
218
+ | 'XPD'
219
+ | 'XPF'
220
+ | 'XPT'
221
+ | 'XTS'
222
+ | 'YER'
223
+ | 'ZAR'
224
+ | 'ZMK'
225
+ | 'ZMW'
226
+ | 'ZWD'
227
+ | 'ZWL'
228
+ | 'ZWN'
229
+ | 'ZWR';
230
+ id?: string;
231
+ /**
232
+ * This field will be true if this object exists in the live environment or false
233
+ * if it exists in the test environment.
234
+ */
235
+ live_mode?: boolean;
236
+ /**
237
+ * Additional data represented as key-value pairs. Both the key and value must be
238
+ * strings.
239
+ */
240
+ metadata?: Record<string, string>;
241
+ /**
242
+ * A nickname for the account.
243
+ */
244
+ name?: string | null;
245
+ object?: string;
246
+ /**
247
+ * The address associated with the owner or null.
248
+ */
249
+ party_address?: InternalAccount.PartyAddress | null;
250
+ /**
251
+ * The legal name of the entity which owns the account.
252
+ */
253
+ party_name?: string;
254
+ /**
255
+ * Either individual or business.
256
+ */
257
+ party_type?: 'business' | 'individual' | null;
258
+ /**
259
+ * An array of routing detail objects.
260
+ */
261
+ routing_details?: Array<InternalAccount.RoutingDetails>;
262
+ updated_at?: string;
263
+ }
264
+ export declare namespace InternalAccount {
265
+ interface PartyAddress {
266
+ /**
267
+ * Country code conforms to [ISO 3166-1 alpha-2]
268
+ */
269
+ country?: string | null;
270
+ created_at?: string;
271
+ id?: string;
272
+ line1?: string | null;
273
+ line2?: string | null;
274
+ /**
275
+ * This field will be true if this object exists in the live environment or false
276
+ * if it exists in the test environment.
277
+ */
278
+ live_mode?: boolean;
279
+ /**
280
+ * Locality or City.
281
+ */
282
+ locality?: string | null;
283
+ object?: string;
284
+ /**
285
+ * The postal code of the address.
286
+ */
287
+ postal_code?: string | null;
288
+ /**
289
+ * Region or State.
290
+ */
291
+ region?: string | null;
292
+ updated_at?: string;
293
+ }
294
+ interface AccountDetails {
295
+ account_number?: string;
296
+ /**
297
+ * Supports iban and clabe, otherwise other if the bank account number is in a
298
+ * generic format.
299
+ */
300
+ account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
301
+ created_at?: string;
302
+ discarded_at?: string | null;
303
+ id?: string;
304
+ /**
305
+ * This field will be true if this object exists in the live environment or false
306
+ * if it exists in the test environment.
307
+ */
308
+ live_mode?: boolean;
309
+ object?: string;
310
+ updated_at?: string;
311
+ }
312
+ interface RoutingDetails {
313
+ bank_address?: RoutingDetails.BankAddress | null;
314
+ bank_name?: string;
315
+ created_at?: string;
316
+ discarded_at?: string | null;
317
+ id?: string;
318
+ /**
319
+ * This field will be true if this object exists in the live environment or false
320
+ * if it exists in the test environment.
321
+ */
322
+ live_mode?: boolean;
323
+ object?: string;
324
+ /**
325
+ * If the routing detail is to be used for a specific payment type this field will
326
+ * be populated, otherwise null.
327
+ */
328
+ payment_type?:
329
+ | 'ach'
330
+ | 'au_becs'
331
+ | 'bacs'
332
+ | 'book'
333
+ | 'card'
334
+ | 'check'
335
+ | 'eft'
336
+ | 'interac'
337
+ | 'provxchange'
338
+ | 'rtp'
339
+ | 'sen'
340
+ | 'sepa'
341
+ | 'signet'
342
+ | 'wire'
343
+ | null;
344
+ /**
345
+ * The routing number of the bank.
346
+ */
347
+ routing_number?: string;
348
+ routing_number_type?:
349
+ | 'aba'
350
+ | 'swift'
351
+ | 'au_bsb'
352
+ | 'ca_cpa'
353
+ | 'cnaps'
354
+ | 'gb_sort_code'
355
+ | 'in_ifsc'
356
+ | 'my_branch_code'
357
+ | 'br_codigo';
358
+ updated_at?: string;
359
+ }
360
+ namespace RoutingDetails {
361
+ interface BankAddress {
362
+ /**
363
+ * Country code conforms to [ISO 3166-1 alpha-2]
364
+ */
365
+ country?: string | null;
366
+ created_at?: string;
367
+ id?: string;
368
+ line1?: string | null;
369
+ line2?: string | null;
370
+ /**
371
+ * This field will be true if this object exists in the live environment or false
372
+ * if it exists in the test environment.
373
+ */
374
+ live_mode?: boolean;
375
+ /**
376
+ * Locality or City.
377
+ */
378
+ locality?: string | null;
379
+ object?: string;
380
+ /**
381
+ * The postal code of the address.
382
+ */
383
+ postal_code?: string | null;
384
+ /**
385
+ * Region or State.
386
+ */
387
+ region?: string | null;
388
+ updated_at?: string;
389
+ }
390
+ }
391
+ interface Connection {
392
+ created_at?: string;
393
+ discarded_at?: string | null;
394
+ id?: string;
395
+ /**
396
+ * This field will be true if this object exists in the live environment or false
397
+ * if it exists in the test environment.
398
+ */
399
+ live_mode?: boolean;
400
+ object?: string;
401
+ updated_at?: string;
402
+ /**
403
+ * The identifier of the vendor bank.
404
+ */
405
+ vendor_customer_id?: string | null;
406
+ /**
407
+ * The identifier of the vendor bank.
408
+ */
409
+ vendor_id?: string;
410
+ /**
411
+ * The name of the vendor bank.
412
+ */
413
+ vendor_name?: string;
414
+ }
415
+ }
416
+ export interface InternalAccountCreateParams {
417
+ /**
418
+ * The identifier of the financial institution the account belongs to.
419
+ */
420
+ connection_id: string;
421
+ /**
422
+ * Either "USD" or "CAD". Internal accounts created at Increase only supports
423
+ * "USD".
424
+ */
425
+ currency: 'USD' | 'CAD';
426
+ /**
427
+ * The nickname of the account.
428
+ */
429
+ name: string;
430
+ /**
431
+ * The legal name of the entity which owns the account.
432
+ */
433
+ party_name: string;
434
+ /**
435
+ * The identifier of the entity at Increase which owns the account.
436
+ */
437
+ entity_id?: string;
438
+ }
439
+ export interface InternalAccountUpdateParams {
440
+ /**
441
+ * Additional data in the form of key-value pairs. Pairs can be removed by passing
442
+ * an empty string or `null` as the value.
443
+ */
444
+ metadata?: Record<string, string>;
445
+ /**
446
+ * The nickname for the internal account.
447
+ */
448
+ name?: string;
449
+ }
450
+ export interface InternalAccountListParams extends PageParams {
451
+ /**
452
+ * The currency associated with the internal account.
453
+ */
454
+ currency?:
455
+ | 'AED'
456
+ | 'AFN'
457
+ | 'ALL'
458
+ | 'AMD'
459
+ | 'ANG'
460
+ | 'AOA'
461
+ | 'ARS'
462
+ | 'AUD'
463
+ | 'AWG'
464
+ | 'AZN'
465
+ | 'BAM'
466
+ | 'BBD'
467
+ | 'BCH'
468
+ | 'BDT'
469
+ | 'BGN'
470
+ | 'BHD'
471
+ | 'BIF'
472
+ | 'BMD'
473
+ | 'BND'
474
+ | 'BOB'
475
+ | 'BRL'
476
+ | 'BSD'
477
+ | 'BTC'
478
+ | 'BTN'
479
+ | 'BWP'
480
+ | 'BYN'
481
+ | 'BYR'
482
+ | 'BZD'
483
+ | 'CAD'
484
+ | 'CDF'
485
+ | 'CHF'
486
+ | 'CLF'
487
+ | 'CLP'
488
+ | 'CNH'
489
+ | 'CNY'
490
+ | 'COP'
491
+ | 'CRC'
492
+ | 'CUC'
493
+ | 'CUP'
494
+ | 'CVE'
495
+ | 'CZK'
496
+ | 'DJF'
497
+ | 'DKK'
498
+ | 'DOP'
499
+ | 'DZD'
500
+ | 'EEK'
501
+ | 'EGP'
502
+ | 'ERN'
503
+ | 'ETB'
504
+ | 'EUR'
505
+ | 'FJD'
506
+ | 'FKP'
507
+ | 'GBP'
508
+ | 'GBX'
509
+ | 'GEL'
510
+ | 'GGP'
511
+ | 'GHS'
512
+ | 'GIP'
513
+ | 'GMD'
514
+ | 'GNF'
515
+ | 'GTQ'
516
+ | 'GYD'
517
+ | 'HKD'
518
+ | 'HNL'
519
+ | 'HRK'
520
+ | 'HTG'
521
+ | 'HUF'
522
+ | 'IDR'
523
+ | 'ILS'
524
+ | 'IMP'
525
+ | 'INR'
526
+ | 'IQD'
527
+ | 'IRR'
528
+ | 'ISK'
529
+ | 'JEP'
530
+ | 'JMD'
531
+ | 'JOD'
532
+ | 'JPY'
533
+ | 'KES'
534
+ | 'KGS'
535
+ | 'KHR'
536
+ | 'KMF'
537
+ | 'KPW'
538
+ | 'KRW'
539
+ | 'KWD'
540
+ | 'KYD'
541
+ | 'KZT'
542
+ | 'LAK'
543
+ | 'LBP'
544
+ | 'LKR'
545
+ | 'LRD'
546
+ | 'LSL'
547
+ | 'LTL'
548
+ | 'LVL'
549
+ | 'LYD'
550
+ | 'MAD'
551
+ | 'MDL'
552
+ | 'MGA'
553
+ | 'MKD'
554
+ | 'MMK'
555
+ | 'MNT'
556
+ | 'MOP'
557
+ | 'MRO'
558
+ | 'MRU'
559
+ | 'MTL'
560
+ | 'MUR'
561
+ | 'MVR'
562
+ | 'MWK'
563
+ | 'MXN'
564
+ | 'MYR'
565
+ | 'MZN'
566
+ | 'NAD'
567
+ | 'NGN'
568
+ | 'NIO'
569
+ | 'NOK'
570
+ | 'NPR'
571
+ | 'NZD'
572
+ | 'OMR'
573
+ | 'PAB'
574
+ | 'PEN'
575
+ | 'PGK'
576
+ | 'PHP'
577
+ | 'PKR'
578
+ | 'PLN'
579
+ | 'PYG'
580
+ | 'QAR'
581
+ | 'RON'
582
+ | 'RSD'
583
+ | 'RUB'
584
+ | 'RWF'
585
+ | 'SAR'
586
+ | 'SBD'
587
+ | 'SCR'
588
+ | 'SDG'
589
+ | 'SEK'
590
+ | 'SGD'
591
+ | 'SHP'
592
+ | 'SKK'
593
+ | 'SLL'
594
+ | 'SOS'
595
+ | 'SRD'
596
+ | 'SSP'
597
+ | 'STD'
598
+ | 'SVC'
599
+ | 'SYP'
600
+ | 'SZL'
601
+ | 'THB'
602
+ | 'TJS'
603
+ | 'TMM'
604
+ | 'TMT'
605
+ | 'TND'
606
+ | 'TOP'
607
+ | 'TRY'
608
+ | 'TTD'
609
+ | 'TWD'
610
+ | 'TZS'
611
+ | 'UAH'
612
+ | 'UGX'
613
+ | 'USD'
614
+ | 'UYU'
615
+ | 'UZS'
616
+ | 'VEF'
617
+ | 'VES'
618
+ | 'VND'
619
+ | 'VUV'
620
+ | 'WST'
621
+ | 'XAF'
622
+ | 'XAG'
623
+ | 'XAU'
624
+ | 'XBA'
625
+ | 'XBB'
626
+ | 'XBC'
627
+ | 'XBD'
628
+ | 'XCD'
629
+ | 'XDR'
630
+ | 'XFU'
631
+ | 'XOF'
632
+ | 'XPD'
633
+ | 'XPF'
634
+ | 'XPT'
635
+ | 'XTS'
636
+ | 'YER'
637
+ | 'ZAR'
638
+ | 'ZMK'
639
+ | 'ZMW'
640
+ | 'ZWD'
641
+ | 'ZWL'
642
+ | 'ZWN'
643
+ | 'ZWR';
644
+ /**
645
+ * The direction of payments that can be made by internal account.
646
+ */
647
+ payment_direction?: 'credit' | 'debit';
648
+ /**
649
+ * The type of payment that can be made by the internal account.
650
+ */
651
+ payment_type?:
652
+ | 'ach'
653
+ | 'au_becs'
654
+ | 'bacs'
655
+ | 'book'
656
+ | 'card'
657
+ | 'check'
658
+ | 'eft'
659
+ | 'interac'
660
+ | 'provxchange'
661
+ | 'rtp'
662
+ | 'sen'
663
+ | 'sepa'
664
+ | 'signet'
665
+ | 'wire';
666
+ }
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+ // File generated from our OpenAPI spec by Stainless.
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+ exports.InternalAccountsPage = exports.InternalAccounts = void 0;
5
+ const resource_1 = require('../resource');
6
+ const core_1 = require('../core');
7
+ const pagination_1 = require('../pagination');
8
+ class InternalAccounts extends resource_1.APIResource {
9
+ create(body, options) {
10
+ return this.post('/api/internal_accounts', Object.assign({ body }, options));
11
+ }
12
+ retrieve(id, options) {
13
+ return this.get(`/api/internal_accounts/${id}`, options);
14
+ }
15
+ update(id, body = {}, options) {
16
+ if ((0, core_1.isRequestOptions)(body)) {
17
+ return this.update(id, {}, body);
18
+ }
19
+ return this.patch(`/api/internal_accounts/${id}`, Object.assign({ body }, options));
20
+ }
21
+ list(query = {}, options) {
22
+ if ((0, core_1.isRequestOptions)(query)) {
23
+ return this.list({}, query);
24
+ }
25
+ return this.getAPIList('/api/internal_accounts', InternalAccountsPage, Object.assign({ query }, options));
26
+ }
27
+ }
28
+ exports.InternalAccounts = InternalAccounts;
29
+ class InternalAccountsPage extends pagination_1.Page {}
30
+ exports.InternalAccountsPage = InternalAccountsPage;
31
+ //# sourceMappingURL=internal-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-accounts.js","sourceRoot":"","sources":["../../../resources/internal-accounts.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,yCAAyC;AACzC,iCAA0C;AAC1C,6CAAgD;AAEhD,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,wBAAwB,kBAAI,IAAI,IAAK,OAAO,EAAG,CAAC;IACnE,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAQD,MAAM,CACJ,EAAU,EACV,OAA0D,EAAE,EAC5D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,EAAE,kBAAI,IAAI,IAAK,OAAO,EAAG,CAAC;IAC1E,CAAC;IAOD,IAAI,CACF,QAAyD,EAAE,EAC3D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,wBAAwB,EAAE,oBAAoB,kBAAI,KAAK,IAAK,OAAO,EAAG,CAAC;IAChG,CAAC;CACF;AA7CD,4CA6CC;AAED,MAAa,oBAAqB,SAAQ,iBAAqB;CAAG;AAAlE,oDAAkE"}