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.
- package/.eslintrc.js +10 -0
- package/.prettierrc +6 -0
- package/LICENSE +7 -0
- package/README.md +198 -0
- package/build +10 -0
- package/core.ts +746 -0
- package/dist/cjs/core.d.ts +215 -0
- package/dist/cjs/core.js +815 -0
- package/dist/cjs/core.js.map +1 -0
- package/dist/cjs/index.d.ts +118 -0
- package/dist/cjs/index.js +128 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/pagination.d.ts +14 -0
- package/dist/cjs/pagination.js +22 -0
- package/dist/cjs/pagination.js.map +1 -0
- package/dist/cjs/resource.d.ts +11 -0
- package/dist/cjs/resource.js +16 -0
- package/dist/cjs/resource.js.map +1 -0
- package/dist/cjs/resources/counterparties.d.ts +500 -0
- package/dist/cjs/resources/counterparties.js +57 -0
- package/dist/cjs/resources/counterparties.js.map +1 -0
- package/dist/cjs/resources/documents.d.ts +66 -0
- package/dist/cjs/resources/documents.js +23 -0
- package/dist/cjs/resources/documents.js.map +1 -0
- package/dist/cjs/resources/events.d.ts +53 -0
- package/dist/cjs/resources/events.js +22 -0
- package/dist/cjs/resources/events.js.map +1 -0
- package/dist/cjs/resources/expected-payments.d.ts +928 -0
- package/dist/cjs/resources/expected-payments.js +31 -0
- package/dist/cjs/resources/expected-payments.js.map +1 -0
- package/dist/cjs/resources/external-accounts.d.ts +597 -0
- package/dist/cjs/resources/external-accounts.js +51 -0
- package/dist/cjs/resources/external-accounts.js.map +1 -0
- package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
- package/dist/cjs/resources/incoming-payment-details.js +35 -0
- package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +15 -0
- package/dist/cjs/resources/index.js +46 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/internal-accounts.d.ts +666 -0
- package/dist/cjs/resources/internal-accounts.js +31 -0
- package/dist/cjs/resources/internal-accounts.js.map +1 -0
- package/dist/cjs/resources/line-items.d.ts +90 -0
- package/dist/cjs/resources/line-items.js +38 -0
- package/dist/cjs/resources/line-items.js.map +1 -0
- package/dist/cjs/resources/paper-items.d.ts +279 -0
- package/dist/cjs/resources/paper-items.js +25 -0
- package/dist/cjs/resources/paper-items.js.map +1 -0
- package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
- package/dist/cjs/resources/payment-orders/index.js +33 -0
- package/dist/cjs/resources/payment-orders/index.js.map +1 -0
- package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
- package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
- package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
- package/dist/cjs/resources/payment-orders/reversals.js +23 -0
- package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
- package/dist/cjs/resources/returns.d.ts +487 -0
- package/dist/cjs/resources/returns.js +31 -0
- package/dist/cjs/resources/returns.js.map +1 -0
- package/dist/cjs/resources/top-level.d.ts +3 -0
- package/dist/cjs/resources/top-level.js +4 -0
- package/dist/cjs/resources/top-level.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +377 -0
- package/dist/cjs/resources/transactions.js +31 -0
- package/dist/cjs/resources/transactions.js.map +1 -0
- package/dist/cjs/resources/validations.d.ts +97 -0
- package/dist/cjs/resources/validations.js +16 -0
- package/dist/cjs/resources/validations.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +31 -0
- package/dist/cjs/resources/webhooks.js +44 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
- package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/documents.test.js +78 -0
- package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/events.test.js +100 -0
- package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
- package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
- package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
- package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
- package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
- package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
- package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/returns.test.js +116 -0
- package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
- package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
- package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/validations.test.js +62 -0
- package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
- package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
- package/dist/cjs/tests/form.test.d.ts +1 -0
- package/dist/cjs/tests/form.test.js +61 -0
- package/dist/cjs/tests/form.test.js.map +1 -0
- package/dist/cjs/tests/index.test.d.ts +1 -0
- package/dist/cjs/tests/index.test.js +57 -0
- package/dist/cjs/tests/index.test.js.map +1 -0
- package/dist/cjs/tests/responses.test.d.ts +1 -0
- package/dist/cjs/tests/responses.test.js +60 -0
- package/dist/cjs/tests/responses.test.js.map +1 -0
- package/index.ts +175 -0
- package/jest.config.js +8 -0
- package/package.json +47 -0
- package/pagination.ts +36 -0
- package/resource.ts +22 -0
- package/resources/counterparties.ts +666 -0
- package/resources/documents.ts +97 -0
- package/resources/events.ts +86 -0
- package/resources/expected-payments.ts +1016 -0
- package/resources/external-accounts.ts +762 -0
- package/resources/incoming-payment-details.ts +592 -0
- package/resources/index.ts +16 -0
- package/resources/internal-accounts.ts +774 -0
- package/resources/line-items.ts +138 -0
- package/resources/paper-items.ts +317 -0
- package/resources/payment-orders/index.ts +3 -0
- package/resources/payment-orders/payment-orders.ts +2486 -0
- package/resources/payment-orders/reversals.ts +72 -0
- package/resources/returns.ts +545 -0
- package/resources/top-level.ts +5 -0
- package/resources/transactions.ts +441 -0
- package/resources/validations.ts +115 -0
- package/resources/webhooks.ts +48 -0
- package/tests/api-resources/counterparties.test.ts +237 -0
- package/tests/api-resources/documents.test.ts +40 -0
- package/tests/api-resources/events.test.ts +62 -0
- package/tests/api-resources/expected-payments.test.ts +138 -0
- package/tests/api-resources/external-accounts.test.ts +210 -0
- package/tests/api-resources/incoming-payment-details.test.ts +92 -0
- package/tests/api-resources/internal-accounts.test.ts +103 -0
- package/tests/api-resources/line-items.test.ts +85 -0
- package/tests/api-resources/paper-items.test.ts +58 -0
- package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
- package/tests/api-resources/returns.test.ts +78 -0
- package/tests/api-resources/top-level.test.ts +21 -0
- package/tests/api-resources/transactions.test.ts +96 -0
- package/tests/api-resources/validations.test.ts +24 -0
- package/tests/api-resources/webhooks.test.ts +102 -0
- package/tests/form.test.ts +27 -0
- package/tests/index.test.ts +62 -0
- package/tests/responses.test.ts +25 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import * as Core from '~/core';
|
|
4
|
+
import { APIResource } from '~/resource';
|
|
5
|
+
import { isRequestOptions } from '~/core';
|
|
6
|
+
import { Page, PageParams } from '~/pagination';
|
|
7
|
+
|
|
8
|
+
export class ExternalAccounts extends APIResource {
|
|
9
|
+
create(
|
|
10
|
+
body: ExternalAccountCreateParams,
|
|
11
|
+
options?: Core.RequestOptions,
|
|
12
|
+
): Promise<Core.APIResponse<ExternalAccount>> {
|
|
13
|
+
return this.post('/api/external_accounts', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<ExternalAccount>> {
|
|
17
|
+
return this.get(`/api/external_accounts/${id}`, options);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
update(
|
|
21
|
+
id: string,
|
|
22
|
+
body?: ExternalAccountUpdateParams,
|
|
23
|
+
options?: Core.RequestOptions,
|
|
24
|
+
): Promise<Core.APIResponse<ExternalAccount>>;
|
|
25
|
+
update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<ExternalAccount>>;
|
|
26
|
+
update(
|
|
27
|
+
id: string,
|
|
28
|
+
body: ExternalAccountUpdateParams | Core.RequestOptions = {},
|
|
29
|
+
options?: Core.RequestOptions,
|
|
30
|
+
): Promise<Core.APIResponse<ExternalAccount>> {
|
|
31
|
+
if (isRequestOptions(body)) {
|
|
32
|
+
return this.update(id, {}, body);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return this.patch(`/api/external_accounts/${id}`, { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
list(
|
|
39
|
+
query?: ExternalAccountListParams,
|
|
40
|
+
options?: Core.RequestOptions,
|
|
41
|
+
): Core.PagePromise<ExternalAccountsPage>;
|
|
42
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ExternalAccountsPage>;
|
|
43
|
+
list(
|
|
44
|
+
query: ExternalAccountListParams | Core.RequestOptions = {},
|
|
45
|
+
options?: Core.RequestOptions,
|
|
46
|
+
): Core.PagePromise<ExternalAccountsPage> {
|
|
47
|
+
if (isRequestOptions(query)) {
|
|
48
|
+
return this.list({}, query);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return this.getAPIList('/api/external_accounts', ExternalAccountsPage, { query, ...options });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
del(id: string, options?: Core.RequestOptions): Promise<void> {
|
|
55
|
+
return this.delete(`/api/external_accounts/${id}`, {
|
|
56
|
+
...options,
|
|
57
|
+
headers: { Accept: '', ...options?.headers },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
completeVerification(
|
|
62
|
+
id: string,
|
|
63
|
+
body?: ExternalAccountCompleteVerificationParams,
|
|
64
|
+
options?: Core.RequestOptions,
|
|
65
|
+
): Promise<Core.APIResponse<ExternalAccount>>;
|
|
66
|
+
completeVerification(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<ExternalAccount>>;
|
|
67
|
+
completeVerification(
|
|
68
|
+
id: string,
|
|
69
|
+
body: ExternalAccountCompleteVerificationParams | Core.RequestOptions = {},
|
|
70
|
+
options?: Core.RequestOptions,
|
|
71
|
+
): Promise<Core.APIResponse<ExternalAccount>> {
|
|
72
|
+
if (isRequestOptions(body)) {
|
|
73
|
+
return this.completeVerification(id, {}, body);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return this.post(`/api/external_accounts/${id}/complete_verification`, { body, ...options });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
verify(
|
|
80
|
+
id: string,
|
|
81
|
+
body: ExternalAccountVerifyParams,
|
|
82
|
+
options?: Core.RequestOptions,
|
|
83
|
+
): Promise<Core.APIResponse<ExternalAccount>> {
|
|
84
|
+
return this.post(`/api/external_accounts/${id}/verify`, { body, ...options });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class ExternalAccountsPage extends Page<ExternalAccount> {}
|
|
89
|
+
|
|
90
|
+
export interface ExternalAccount {
|
|
91
|
+
account_details?: Array<ExternalAccount.AccountDetails>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Can be `checking`, `savings` or `other`.
|
|
95
|
+
*/
|
|
96
|
+
account_type?: 'checking' | 'other' | 'savings';
|
|
97
|
+
|
|
98
|
+
contact_details?: Array<ExternalAccount.ContactDetails>;
|
|
99
|
+
|
|
100
|
+
counterparty_id?: string | null;
|
|
101
|
+
|
|
102
|
+
created_at?: string;
|
|
103
|
+
|
|
104
|
+
discarded_at?: string | null;
|
|
105
|
+
|
|
106
|
+
id?: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This field will be true if this object exists in the live environment or false
|
|
110
|
+
* if it exists in the test environment.
|
|
111
|
+
*/
|
|
112
|
+
live_mode?: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
116
|
+
* strings.
|
|
117
|
+
*/
|
|
118
|
+
metadata?: Record<string, string>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* A nickname for the external account. This is only for internal usage and won't
|
|
122
|
+
* affect any payments
|
|
123
|
+
*/
|
|
124
|
+
name?: string | null;
|
|
125
|
+
|
|
126
|
+
object?: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The address associated with the owner or `null`.
|
|
130
|
+
*/
|
|
131
|
+
party_address?: ExternalAccount.PartyAddress | null;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The legal name of the entity which owns the account.
|
|
135
|
+
*/
|
|
136
|
+
party_name?: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Either `individual` or `business`.
|
|
140
|
+
*/
|
|
141
|
+
party_type?: 'business' | 'individual' | null;
|
|
142
|
+
|
|
143
|
+
routing_details?: Array<ExternalAccount.RoutingDetails>;
|
|
144
|
+
|
|
145
|
+
updated_at?: string;
|
|
146
|
+
|
|
147
|
+
verification_status?: 'pending_verification' | 'unverified' | 'verified';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export namespace ExternalAccount {
|
|
151
|
+
export interface PartyAddress {
|
|
152
|
+
/**
|
|
153
|
+
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
154
|
+
*/
|
|
155
|
+
country?: string | null;
|
|
156
|
+
|
|
157
|
+
created_at?: string;
|
|
158
|
+
|
|
159
|
+
id?: string;
|
|
160
|
+
|
|
161
|
+
line1?: string | null;
|
|
162
|
+
|
|
163
|
+
line2?: string | null;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* This field will be true if this object exists in the live environment or false
|
|
167
|
+
* if it exists in the test environment.
|
|
168
|
+
*/
|
|
169
|
+
live_mode?: boolean;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Locality or City.
|
|
173
|
+
*/
|
|
174
|
+
locality?: string | null;
|
|
175
|
+
|
|
176
|
+
object?: string;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The postal code of the address.
|
|
180
|
+
*/
|
|
181
|
+
postal_code?: string | null;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Region or State.
|
|
185
|
+
*/
|
|
186
|
+
region?: string | null;
|
|
187
|
+
|
|
188
|
+
updated_at?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface AccountDetails {
|
|
192
|
+
account_number?: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Supports iban and clabe, otherwise other if the bank account number is in a
|
|
196
|
+
* generic format.
|
|
197
|
+
*/
|
|
198
|
+
account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
|
|
199
|
+
|
|
200
|
+
created_at?: string;
|
|
201
|
+
|
|
202
|
+
discarded_at?: string | null;
|
|
203
|
+
|
|
204
|
+
id?: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* This field will be true if this object exists in the live environment or false
|
|
208
|
+
* if it exists in the test environment.
|
|
209
|
+
*/
|
|
210
|
+
live_mode?: boolean;
|
|
211
|
+
|
|
212
|
+
object?: string;
|
|
213
|
+
|
|
214
|
+
updated_at?: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface RoutingDetails {
|
|
218
|
+
bank_address?: RoutingDetails.BankAddress | null;
|
|
219
|
+
|
|
220
|
+
bank_name?: string;
|
|
221
|
+
|
|
222
|
+
created_at?: string;
|
|
223
|
+
|
|
224
|
+
discarded_at?: string | null;
|
|
225
|
+
|
|
226
|
+
id?: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* This field will be true if this object exists in the live environment or false
|
|
230
|
+
* if it exists in the test environment.
|
|
231
|
+
*/
|
|
232
|
+
live_mode?: boolean;
|
|
233
|
+
|
|
234
|
+
object?: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* If the routing detail is to be used for a specific payment type this field will
|
|
238
|
+
* be populated, otherwise null.
|
|
239
|
+
*/
|
|
240
|
+
payment_type?:
|
|
241
|
+
| 'ach'
|
|
242
|
+
| 'au_becs'
|
|
243
|
+
| 'bacs'
|
|
244
|
+
| 'book'
|
|
245
|
+
| 'card'
|
|
246
|
+
| 'check'
|
|
247
|
+
| 'eft'
|
|
248
|
+
| 'interac'
|
|
249
|
+
| 'provxchange'
|
|
250
|
+
| 'rtp'
|
|
251
|
+
| 'sen'
|
|
252
|
+
| 'sepa'
|
|
253
|
+
| 'signet'
|
|
254
|
+
| 'wire'
|
|
255
|
+
| null;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The routing number of the bank.
|
|
259
|
+
*/
|
|
260
|
+
routing_number?: string;
|
|
261
|
+
|
|
262
|
+
routing_number_type?:
|
|
263
|
+
| 'aba'
|
|
264
|
+
| 'swift'
|
|
265
|
+
| 'au_bsb'
|
|
266
|
+
| 'ca_cpa'
|
|
267
|
+
| 'cnaps'
|
|
268
|
+
| 'gb_sort_code'
|
|
269
|
+
| 'in_ifsc'
|
|
270
|
+
| 'my_branch_code'
|
|
271
|
+
| 'br_codigo';
|
|
272
|
+
|
|
273
|
+
updated_at?: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export namespace RoutingDetails {
|
|
277
|
+
export interface BankAddress {
|
|
278
|
+
/**
|
|
279
|
+
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
280
|
+
*/
|
|
281
|
+
country?: string | null;
|
|
282
|
+
|
|
283
|
+
created_at?: string;
|
|
284
|
+
|
|
285
|
+
id?: string;
|
|
286
|
+
|
|
287
|
+
line1?: string | null;
|
|
288
|
+
|
|
289
|
+
line2?: string | null;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* This field will be true if this object exists in the live environment or false
|
|
293
|
+
* if it exists in the test environment.
|
|
294
|
+
*/
|
|
295
|
+
live_mode?: boolean;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Locality or City.
|
|
299
|
+
*/
|
|
300
|
+
locality?: string | null;
|
|
301
|
+
|
|
302
|
+
object?: string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The postal code of the address.
|
|
306
|
+
*/
|
|
307
|
+
postal_code?: string | null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Region or State.
|
|
311
|
+
*/
|
|
312
|
+
region?: string | null;
|
|
313
|
+
|
|
314
|
+
updated_at?: string;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface ContactDetails {
|
|
319
|
+
contact_identifier?: string;
|
|
320
|
+
|
|
321
|
+
contact_identifier_type?: 'email' | 'phone_number';
|
|
322
|
+
|
|
323
|
+
created_at?: string;
|
|
324
|
+
|
|
325
|
+
discarded_at?: string | null;
|
|
326
|
+
|
|
327
|
+
id?: string;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* This field will be true if this object exists in the live environment or false
|
|
331
|
+
* if it exists in the test environment.
|
|
332
|
+
*/
|
|
333
|
+
live_mode?: boolean;
|
|
334
|
+
|
|
335
|
+
object?: string;
|
|
336
|
+
|
|
337
|
+
updated_at?: string;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface ExternalAccountCreateParams {
|
|
342
|
+
counterparty_id: string | null;
|
|
343
|
+
|
|
344
|
+
account_details?: Array<ExternalAccountCreateParams.AccountDetails>;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Can be `checking`, `savings` or `other`.
|
|
348
|
+
*/
|
|
349
|
+
account_type?: 'checking' | 'other' | 'savings';
|
|
350
|
+
|
|
351
|
+
contact_details?: Array<ExternalAccountCreateParams.ContactDetails>;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
355
|
+
* strings.
|
|
356
|
+
*/
|
|
357
|
+
metadata?: Record<string, string>;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* A nickname for the external account. This is only for internal usage and won't
|
|
361
|
+
* affect any payments
|
|
362
|
+
*/
|
|
363
|
+
name?: string | null;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Required if receiving wire payments.
|
|
367
|
+
*/
|
|
368
|
+
party_address?: ExternalAccountCreateParams.PartyAddress;
|
|
369
|
+
|
|
370
|
+
party_identifier?: string;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* If this value isn't provided, it will be inherited from the counterparty's name.
|
|
374
|
+
*/
|
|
375
|
+
party_name?: string;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Either `individual` or `business`.
|
|
379
|
+
*/
|
|
380
|
+
party_type?: 'business' | 'individual' | null;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
|
|
384
|
+
* you can pass the processor token in this field.
|
|
385
|
+
*/
|
|
386
|
+
plaid_processor_token?: string;
|
|
387
|
+
|
|
388
|
+
routing_details?: Array<ExternalAccountCreateParams.RoutingDetails>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export namespace ExternalAccountCreateParams {
|
|
392
|
+
export interface PartyAddress {
|
|
393
|
+
/**
|
|
394
|
+
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
395
|
+
*/
|
|
396
|
+
country?: string | null;
|
|
397
|
+
|
|
398
|
+
line1?: string | null;
|
|
399
|
+
|
|
400
|
+
line2?: string | null;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Locality or City.
|
|
404
|
+
*/
|
|
405
|
+
locality?: string | null;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The postal code of the address.
|
|
409
|
+
*/
|
|
410
|
+
postal_code?: string | null;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Region or State.
|
|
414
|
+
*/
|
|
415
|
+
region?: string | null;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export interface AccountDetails {
|
|
419
|
+
account_number: string;
|
|
420
|
+
|
|
421
|
+
account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export interface RoutingDetails {
|
|
425
|
+
routing_number: string;
|
|
426
|
+
|
|
427
|
+
routing_number_type:
|
|
428
|
+
| 'aba'
|
|
429
|
+
| 'swift'
|
|
430
|
+
| 'au_bsb'
|
|
431
|
+
| 'ca_cpa'
|
|
432
|
+
| 'cnaps'
|
|
433
|
+
| 'gb_sort_code'
|
|
434
|
+
| 'in_ifsc'
|
|
435
|
+
| 'my_branch_code'
|
|
436
|
+
| 'br_codigo';
|
|
437
|
+
|
|
438
|
+
payment_type?:
|
|
439
|
+
| 'ach'
|
|
440
|
+
| 'au_becs'
|
|
441
|
+
| 'bacs'
|
|
442
|
+
| 'book'
|
|
443
|
+
| 'card'
|
|
444
|
+
| 'check'
|
|
445
|
+
| 'eft'
|
|
446
|
+
| 'interac'
|
|
447
|
+
| 'provxchange'
|
|
448
|
+
| 'rtp'
|
|
449
|
+
| 'sen'
|
|
450
|
+
| 'sepa'
|
|
451
|
+
| 'signet'
|
|
452
|
+
| 'wire';
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
export interface ContactDetails {
|
|
456
|
+
contact_identifier?: string;
|
|
457
|
+
|
|
458
|
+
contact_identifier_type?: 'email' | 'phone_number';
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface ExternalAccountUpdateParams {
|
|
463
|
+
/**
|
|
464
|
+
* Can be `checking`, `savings` or `other`.
|
|
465
|
+
*/
|
|
466
|
+
account_type?: 'checking' | 'other' | 'savings';
|
|
467
|
+
|
|
468
|
+
counterparty_id?: string | null;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Additional data in the form of key-value pairs. Pairs can be removed by passing
|
|
472
|
+
* an empty string or `null` as the value.
|
|
473
|
+
*/
|
|
474
|
+
metadata?: Record<string, string>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* A nickname for the external account. This is only for internal usage and won't
|
|
478
|
+
* affect any payments
|
|
479
|
+
*/
|
|
480
|
+
name?: string | null;
|
|
481
|
+
|
|
482
|
+
party_address?: ExternalAccountUpdateParams.PartyAddress;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* If this value isn't provided, it will be inherited from the counterparty's name.
|
|
486
|
+
*/
|
|
487
|
+
party_name?: string;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Either `individual` or `business`.
|
|
491
|
+
*/
|
|
492
|
+
party_type?: 'business' | 'individual' | null;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export namespace ExternalAccountUpdateParams {
|
|
496
|
+
export interface PartyAddress {
|
|
497
|
+
/**
|
|
498
|
+
* Country code conforms to [ISO 3166-1 alpha-2]
|
|
499
|
+
*/
|
|
500
|
+
country?: string | null;
|
|
501
|
+
|
|
502
|
+
line1?: string | null;
|
|
503
|
+
|
|
504
|
+
line2?: string | null;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Locality or City.
|
|
508
|
+
*/
|
|
509
|
+
locality?: string | null;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* The postal code of the address.
|
|
513
|
+
*/
|
|
514
|
+
postal_code?: string | null;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Region or State.
|
|
518
|
+
*/
|
|
519
|
+
region?: string | null;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface ExternalAccountListParams extends PageParams {
|
|
524
|
+
counterparty_id?: string;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* For example, if you want to query for records with metadata key `Type` and value
|
|
528
|
+
* `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
|
|
529
|
+
* parameters.
|
|
530
|
+
*/
|
|
531
|
+
metadata?: Record<string, string>;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Searches the ExternalAccount's party_name AND the Counterparty's party_name
|
|
535
|
+
*/
|
|
536
|
+
party_name?: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export interface ExternalAccountCompleteVerificationParams {
|
|
540
|
+
amounts?: Array<number>;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface ExternalAccountVerifyParams {
|
|
544
|
+
/**
|
|
545
|
+
* The ID of the internal account where the micro-deposits originate from. Both
|
|
546
|
+
* credit and debit capabilities must be enabled.
|
|
547
|
+
*/
|
|
548
|
+
originating_account_id: string;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Both ach and eft are supported payment types.
|
|
552
|
+
*/
|
|
553
|
+
payment_type:
|
|
554
|
+
| 'ach'
|
|
555
|
+
| 'au_becs'
|
|
556
|
+
| 'bacs'
|
|
557
|
+
| 'book'
|
|
558
|
+
| 'card'
|
|
559
|
+
| 'check'
|
|
560
|
+
| 'eft'
|
|
561
|
+
| 'interac'
|
|
562
|
+
| 'provxchange'
|
|
563
|
+
| 'rtp'
|
|
564
|
+
| 'sen'
|
|
565
|
+
| 'sepa'
|
|
566
|
+
| 'signet'
|
|
567
|
+
| 'wire';
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Defaults to the currency of the originating account.
|
|
571
|
+
*/
|
|
572
|
+
currency?:
|
|
573
|
+
| 'AED'
|
|
574
|
+
| 'AFN'
|
|
575
|
+
| 'ALL'
|
|
576
|
+
| 'AMD'
|
|
577
|
+
| 'ANG'
|
|
578
|
+
| 'AOA'
|
|
579
|
+
| 'ARS'
|
|
580
|
+
| 'AUD'
|
|
581
|
+
| 'AWG'
|
|
582
|
+
| 'AZN'
|
|
583
|
+
| 'BAM'
|
|
584
|
+
| 'BBD'
|
|
585
|
+
| 'BCH'
|
|
586
|
+
| 'BDT'
|
|
587
|
+
| 'BGN'
|
|
588
|
+
| 'BHD'
|
|
589
|
+
| 'BIF'
|
|
590
|
+
| 'BMD'
|
|
591
|
+
| 'BND'
|
|
592
|
+
| 'BOB'
|
|
593
|
+
| 'BRL'
|
|
594
|
+
| 'BSD'
|
|
595
|
+
| 'BTC'
|
|
596
|
+
| 'BTN'
|
|
597
|
+
| 'BWP'
|
|
598
|
+
| 'BYN'
|
|
599
|
+
| 'BYR'
|
|
600
|
+
| 'BZD'
|
|
601
|
+
| 'CAD'
|
|
602
|
+
| 'CDF'
|
|
603
|
+
| 'CHF'
|
|
604
|
+
| 'CLF'
|
|
605
|
+
| 'CLP'
|
|
606
|
+
| 'CNH'
|
|
607
|
+
| 'CNY'
|
|
608
|
+
| 'COP'
|
|
609
|
+
| 'CRC'
|
|
610
|
+
| 'CUC'
|
|
611
|
+
| 'CUP'
|
|
612
|
+
| 'CVE'
|
|
613
|
+
| 'CZK'
|
|
614
|
+
| 'DJF'
|
|
615
|
+
| 'DKK'
|
|
616
|
+
| 'DOP'
|
|
617
|
+
| 'DZD'
|
|
618
|
+
| 'EEK'
|
|
619
|
+
| 'EGP'
|
|
620
|
+
| 'ERN'
|
|
621
|
+
| 'ETB'
|
|
622
|
+
| 'EUR'
|
|
623
|
+
| 'FJD'
|
|
624
|
+
| 'FKP'
|
|
625
|
+
| 'GBP'
|
|
626
|
+
| 'GBX'
|
|
627
|
+
| 'GEL'
|
|
628
|
+
| 'GGP'
|
|
629
|
+
| 'GHS'
|
|
630
|
+
| 'GIP'
|
|
631
|
+
| 'GMD'
|
|
632
|
+
| 'GNF'
|
|
633
|
+
| 'GTQ'
|
|
634
|
+
| 'GYD'
|
|
635
|
+
| 'HKD'
|
|
636
|
+
| 'HNL'
|
|
637
|
+
| 'HRK'
|
|
638
|
+
| 'HTG'
|
|
639
|
+
| 'HUF'
|
|
640
|
+
| 'IDR'
|
|
641
|
+
| 'ILS'
|
|
642
|
+
| 'IMP'
|
|
643
|
+
| 'INR'
|
|
644
|
+
| 'IQD'
|
|
645
|
+
| 'IRR'
|
|
646
|
+
| 'ISK'
|
|
647
|
+
| 'JEP'
|
|
648
|
+
| 'JMD'
|
|
649
|
+
| 'JOD'
|
|
650
|
+
| 'JPY'
|
|
651
|
+
| 'KES'
|
|
652
|
+
| 'KGS'
|
|
653
|
+
| 'KHR'
|
|
654
|
+
| 'KMF'
|
|
655
|
+
| 'KPW'
|
|
656
|
+
| 'KRW'
|
|
657
|
+
| 'KWD'
|
|
658
|
+
| 'KYD'
|
|
659
|
+
| 'KZT'
|
|
660
|
+
| 'LAK'
|
|
661
|
+
| 'LBP'
|
|
662
|
+
| 'LKR'
|
|
663
|
+
| 'LRD'
|
|
664
|
+
| 'LSL'
|
|
665
|
+
| 'LTL'
|
|
666
|
+
| 'LVL'
|
|
667
|
+
| 'LYD'
|
|
668
|
+
| 'MAD'
|
|
669
|
+
| 'MDL'
|
|
670
|
+
| 'MGA'
|
|
671
|
+
| 'MKD'
|
|
672
|
+
| 'MMK'
|
|
673
|
+
| 'MNT'
|
|
674
|
+
| 'MOP'
|
|
675
|
+
| 'MRO'
|
|
676
|
+
| 'MRU'
|
|
677
|
+
| 'MTL'
|
|
678
|
+
| 'MUR'
|
|
679
|
+
| 'MVR'
|
|
680
|
+
| 'MWK'
|
|
681
|
+
| 'MXN'
|
|
682
|
+
| 'MYR'
|
|
683
|
+
| 'MZN'
|
|
684
|
+
| 'NAD'
|
|
685
|
+
| 'NGN'
|
|
686
|
+
| 'NIO'
|
|
687
|
+
| 'NOK'
|
|
688
|
+
| 'NPR'
|
|
689
|
+
| 'NZD'
|
|
690
|
+
| 'OMR'
|
|
691
|
+
| 'PAB'
|
|
692
|
+
| 'PEN'
|
|
693
|
+
| 'PGK'
|
|
694
|
+
| 'PHP'
|
|
695
|
+
| 'PKR'
|
|
696
|
+
| 'PLN'
|
|
697
|
+
| 'PYG'
|
|
698
|
+
| 'QAR'
|
|
699
|
+
| 'RON'
|
|
700
|
+
| 'RSD'
|
|
701
|
+
| 'RUB'
|
|
702
|
+
| 'RWF'
|
|
703
|
+
| 'SAR'
|
|
704
|
+
| 'SBD'
|
|
705
|
+
| 'SCR'
|
|
706
|
+
| 'SDG'
|
|
707
|
+
| 'SEK'
|
|
708
|
+
| 'SGD'
|
|
709
|
+
| 'SHP'
|
|
710
|
+
| 'SKK'
|
|
711
|
+
| 'SLL'
|
|
712
|
+
| 'SOS'
|
|
713
|
+
| 'SRD'
|
|
714
|
+
| 'SSP'
|
|
715
|
+
| 'STD'
|
|
716
|
+
| 'SVC'
|
|
717
|
+
| 'SYP'
|
|
718
|
+
| 'SZL'
|
|
719
|
+
| 'THB'
|
|
720
|
+
| 'TJS'
|
|
721
|
+
| 'TMM'
|
|
722
|
+
| 'TMT'
|
|
723
|
+
| 'TND'
|
|
724
|
+
| 'TOP'
|
|
725
|
+
| 'TRY'
|
|
726
|
+
| 'TTD'
|
|
727
|
+
| 'TWD'
|
|
728
|
+
| 'TZS'
|
|
729
|
+
| 'UAH'
|
|
730
|
+
| 'UGX'
|
|
731
|
+
| 'USD'
|
|
732
|
+
| 'UYU'
|
|
733
|
+
| 'UZS'
|
|
734
|
+
| 'VEF'
|
|
735
|
+
| 'VES'
|
|
736
|
+
| 'VND'
|
|
737
|
+
| 'VUV'
|
|
738
|
+
| 'WST'
|
|
739
|
+
| 'XAF'
|
|
740
|
+
| 'XAG'
|
|
741
|
+
| 'XAU'
|
|
742
|
+
| 'XBA'
|
|
743
|
+
| 'XBB'
|
|
744
|
+
| 'XBC'
|
|
745
|
+
| 'XBD'
|
|
746
|
+
| 'XCD'
|
|
747
|
+
| 'XDR'
|
|
748
|
+
| 'XFU'
|
|
749
|
+
| 'XOF'
|
|
750
|
+
| 'XPD'
|
|
751
|
+
| 'XPF'
|
|
752
|
+
| 'XPT'
|
|
753
|
+
| 'XTS'
|
|
754
|
+
| 'YER'
|
|
755
|
+
| 'ZAR'
|
|
756
|
+
| 'ZMK'
|
|
757
|
+
| 'ZMW'
|
|
758
|
+
| 'ZWD'
|
|
759
|
+
| 'ZWL'
|
|
760
|
+
| 'ZWN'
|
|
761
|
+
| 'ZWR';
|
|
762
|
+
}
|