forked from stripe/stripe-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BankAccounts.d.ts
342 lines (301 loc) · 14 KB
/
BankAccounts.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
/**
* These bank accounts are payment methods on `Customer` objects.
*
* On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer
* destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts).
* They can be bank accounts or debit cards as well, and are documented in the links above.
*
* Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers)
*/
interface BankAccount {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'bank_account';
/**
* The ID of the account that the bank account is associated with.
*/
account?: string | Stripe.Account | null;
/**
* The name of the person or business that owns the bank account.
*/
account_holder_name: string | null;
/**
* The type of entity that holds the account. This can be either `individual` or `company`.
*/
account_holder_type: string | null;
/**
* The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.
*/
account_type: string | null;
/**
* A set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout.
*/
available_payout_methods?: Array<
BankAccount.AvailablePayoutMethod
> | null;
/**
* Name of the bank associated with the routing number (e.g., `WELLS FARGO`).
*/
bank_name: string | null;
/**
* Two-letter ISO code representing the country the bank account is located in.
*/
country: string;
/**
* Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
*/
currency: string;
/**
* The ID of the customer that the bank account is associated with.
*/
customer?: string | Stripe.Customer | Stripe.DeletedCustomer | null;
/**
* Whether this bank account is the default external account for its currency.
*/
default_for_currency?: boolean | null;
deleted?: void;
/**
* Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
*/
fingerprint: string | null;
/**
* Information about upcoming new requirements for the bank account, including what information needs to be collected.
*/
future_requirements?: BankAccount.FutureRequirements | null;
/**
* The last four digits of the bank account number.
*/
last4: string;
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata?: Stripe.Metadata | null;
/**
* Information about the requirements for the bank account, including what information needs to be collected.
*/
requirements?: BankAccount.Requirements | null;
/**
* The routing transit number for the bank account.
*/
routing_number: string | null;
/**
* For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated.
*
* For external accounts, possible values are `new`, `errored` and `verification_failed`. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
*/
status: string;
}
namespace BankAccount {
type AvailablePayoutMethod = 'instant' | 'standard';
interface FutureRequirements {
/**
* Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
*/
currently_due: Array<string> | null;
/**
* Fields that are `currently_due` and need to be collected again because validation or verification failed.
*/
errors: Array<FutureRequirements.Error> | null;
/**
* Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account.
*/
past_due: Array<string> | null;
/**
* Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`.
*/
pending_verification: Array<string> | null;
}
namespace FutureRequirements {
interface Error {
/**
* The code for the type of error.
*/
code: Error.Code;
/**
* An informative message that indicates the error type and provides additional details about the error.
*/
reason: string;
/**
* The specific user onboarding requirement field (in the requirements hash) that needs to be resolved.
*/
requirement: string;
}
namespace Error {
type Code =
| 'invalid_address_city_state_postal_code'
| 'invalid_dob_age_under_18'
| 'invalid_representative_country'
| 'invalid_street_address'
| 'invalid_tos_acceptance'
| 'invalid_value_other'
| 'verification_directors_mismatch'
| 'verification_document_address_mismatch'
| 'verification_document_address_missing'
| 'verification_document_corrupt'
| 'verification_document_country_not_supported'
| 'verification_document_directors_mismatch'
| 'verification_document_dob_mismatch'
| 'verification_document_duplicate_type'
| 'verification_document_expired'
| 'verification_document_failed_copy'
| 'verification_document_failed_greyscale'
| 'verification_document_failed_other'
| 'verification_document_failed_test_mode'
| 'verification_document_fraudulent'
| 'verification_document_id_number_mismatch'
| 'verification_document_id_number_missing'
| 'verification_document_incomplete'
| 'verification_document_invalid'
| 'verification_document_issue_or_expiry_date_missing'
| 'verification_document_manipulated'
| 'verification_document_missing_back'
| 'verification_document_missing_front'
| 'verification_document_name_mismatch'
| 'verification_document_name_missing'
| 'verification_document_nationality_mismatch'
| 'verification_document_not_readable'
| 'verification_document_not_signed'
| 'verification_document_not_uploaded'
| 'verification_document_photo_mismatch'
| 'verification_document_too_large'
| 'verification_document_type_not_supported'
| 'verification_extraneous_directors'
| 'verification_failed_address_match'
| 'verification_failed_business_iec_number'
| 'verification_failed_document_match'
| 'verification_failed_id_number_match'
| 'verification_failed_keyed_identity'
| 'verification_failed_keyed_match'
| 'verification_failed_name_match'
| 'verification_failed_other'
| 'verification_failed_residential_address'
| 'verification_failed_tax_id_match'
| 'verification_failed_tax_id_not_issued'
| 'verification_missing_directors'
| 'verification_missing_executives'
| 'verification_missing_owners'
| 'verification_requires_additional_memorandum_of_associations';
}
}
interface Requirements {
/**
* Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
*/
currently_due: Array<string> | null;
/**
* Fields that are `currently_due` and need to be collected again because validation or verification failed.
*/
errors: Array<Requirements.Error> | null;
/**
* Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account.
*/
past_due: Array<string> | null;
/**
* Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`.
*/
pending_verification: Array<string> | null;
}
namespace Requirements {
interface Error {
/**
* The code for the type of error.
*/
code: Error.Code;
/**
* An informative message that indicates the error type and provides additional details about the error.
*/
reason: string;
/**
* The specific user onboarding requirement field (in the requirements hash) that needs to be resolved.
*/
requirement: string;
}
namespace Error {
type Code =
| 'invalid_address_city_state_postal_code'
| 'invalid_dob_age_under_18'
| 'invalid_representative_country'
| 'invalid_street_address'
| 'invalid_tos_acceptance'
| 'invalid_value_other'
| 'verification_directors_mismatch'
| 'verification_document_address_mismatch'
| 'verification_document_address_missing'
| 'verification_document_corrupt'
| 'verification_document_country_not_supported'
| 'verification_document_directors_mismatch'
| 'verification_document_dob_mismatch'
| 'verification_document_duplicate_type'
| 'verification_document_expired'
| 'verification_document_failed_copy'
| 'verification_document_failed_greyscale'
| 'verification_document_failed_other'
| 'verification_document_failed_test_mode'
| 'verification_document_fraudulent'
| 'verification_document_id_number_mismatch'
| 'verification_document_id_number_missing'
| 'verification_document_incomplete'
| 'verification_document_invalid'
| 'verification_document_issue_or_expiry_date_missing'
| 'verification_document_manipulated'
| 'verification_document_missing_back'
| 'verification_document_missing_front'
| 'verification_document_name_mismatch'
| 'verification_document_name_missing'
| 'verification_document_nationality_mismatch'
| 'verification_document_not_readable'
| 'verification_document_not_signed'
| 'verification_document_not_uploaded'
| 'verification_document_photo_mismatch'
| 'verification_document_too_large'
| 'verification_document_type_not_supported'
| 'verification_extraneous_directors'
| 'verification_failed_address_match'
| 'verification_failed_business_iec_number'
| 'verification_failed_document_match'
| 'verification_failed_id_number_match'
| 'verification_failed_keyed_identity'
| 'verification_failed_keyed_match'
| 'verification_failed_name_match'
| 'verification_failed_other'
| 'verification_failed_residential_address'
| 'verification_failed_tax_id_match'
| 'verification_failed_tax_id_not_issued'
| 'verification_missing_directors'
| 'verification_missing_executives'
| 'verification_missing_owners'
| 'verification_requires_additional_memorandum_of_associations';
}
}
}
/**
* The DeletedBankAccount object.
*/
interface DeletedBankAccount {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'bank_account';
/**
* Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account.
*/
currency?: string | null;
/**
* Always true for a deleted object
*/
deleted: true;
}
}
}