1 | import {Card} from './cards';
|
2 | import {BankAccount} from './bank-accounts';
|
3 | import {JapanAddressParam, MetadataParam} from './shared';
|
4 |
|
5 | /**
|
6 | * The Token object.
|
7 | */
|
8 | export interface Token {
|
9 | /**
|
10 | * Unique identifier for the object.
|
11 | */
|
12 | id: string;
|
13 |
|
14 | /**
|
15 | * String representing the object's type. Objects of the same type share the same value.
|
16 | */
|
17 | object: 'token';
|
18 |
|
19 | bank_account?: BankAccount;
|
20 |
|
21 | card?: Card;
|
22 |
|
23 | /**
|
24 | * IP address of the client that generated the token.
|
25 | */
|
26 | client_ip: string | null;
|
27 |
|
28 | /**
|
29 | * Time at which the object was created. Measured in seconds since the Unix epoch.
|
30 | */
|
31 | created: number;
|
32 |
|
33 | /**
|
34 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
35 | */
|
36 | livemode: boolean;
|
37 |
|
38 | /**
|
39 | * Type of the token: `account`, `bank_account`, `card`, or `pii`.
|
40 | */
|
41 | type: string;
|
42 |
|
43 | /**
|
44 | * Whether this token has already been used (tokens can be used only once).
|
45 | */
|
46 | used: boolean;
|
47 | }
|
48 |
|
49 | export namespace TokenCreateParams {
|
50 | export interface Account {
|
51 | /**
|
52 | * The business type.
|
53 | */
|
54 | business_type?: Account.BusinessType;
|
55 |
|
56 | /**
|
57 | * Information about the company or business.
|
58 | */
|
59 | company?: Account.Company;
|
60 |
|
61 | /**
|
62 | * Information about the person represented by the account.
|
63 | */
|
64 | individual?: Account.Individual;
|
65 |
|
66 | /**
|
67 | * Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`.
|
68 | */
|
69 | tos_shown_and_accepted?: boolean;
|
70 | }
|
71 |
|
72 | export namespace Account {
|
73 | export type BusinessType =
|
74 | | 'company'
|
75 | | 'government_entity'
|
76 | | 'individual'
|
77 | | 'non_profit';
|
78 |
|
79 | export interface Company {
|
80 | /**
|
81 | * The company's primary address.
|
82 | */
|
83 | address?: Company.Address;
|
84 |
|
85 | /**
|
86 | * The Kana variation of the company's primary address (Japan only).
|
87 | */
|
88 | address_kana?: JapanAddressParam;
|
89 |
|
90 | /**
|
91 | * The Kanji variation of the company's primary address (Japan only).
|
92 | */
|
93 | address_kanji?: JapanAddressParam;
|
94 |
|
95 | /**
|
96 | * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
|
97 | */
|
98 | directors_provided?: boolean;
|
99 |
|
100 | /**
|
101 | * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.
|
102 | */
|
103 | executives_provided?: boolean;
|
104 |
|
105 | /**
|
106 | * The company's legal name.
|
107 | */
|
108 | name?: string;
|
109 |
|
110 | /**
|
111 | * The Kana variation of the company's legal name (Japan only).
|
112 | */
|
113 | name_kana?: string;
|
114 |
|
115 | /**
|
116 | * The Kanji variation of the company's legal name (Japan only).
|
117 | */
|
118 | name_kanji?: string;
|
119 |
|
120 | /**
|
121 | * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.
|
122 | */
|
123 | owners_provided?: boolean;
|
124 |
|
125 | /**
|
126 | * The company's phone number (used for verification).
|
127 | */
|
128 | phone?: string;
|
129 |
|
130 | /**
|
131 | * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
|
132 | */
|
133 | structure?: Company.Structure | null;
|
134 |
|
135 | /**
|
136 | * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
|
137 | */
|
138 | tax_id?: string;
|
139 |
|
140 | /**
|
141 | * The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
|
142 | */
|
143 | tax_id_registrar?: string;
|
144 |
|
145 | /**
|
146 | * The VAT number of the company.
|
147 | */
|
148 | vat_id?: string;
|
149 |
|
150 | /**
|
151 | * Information on the verification state of the company.
|
152 | */
|
153 | verification?: Company.Verification;
|
154 | }
|
155 |
|
156 | export namespace Company {
|
157 | export interface Address {
|
158 | /**
|
159 | * City, district, suburb, town, or village.
|
160 | */
|
161 | city?: string;
|
162 |
|
163 | /**
|
164 | * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
165 | */
|
166 | country?: string;
|
167 |
|
168 | /**
|
169 | * Address line 1 (e.g., street, PO Box, or company name).
|
170 | */
|
171 | line1?: string;
|
172 |
|
173 | /**
|
174 | * Address line 2 (e.g., apartment, suite, unit, or building).
|
175 | */
|
176 | line2?: string;
|
177 |
|
178 | /**
|
179 | * ZIP or postal code.
|
180 | */
|
181 | postal_code?: string;
|
182 |
|
183 | /**
|
184 | * State, county, province, or region.
|
185 | */
|
186 | state?: string;
|
187 | }
|
188 |
|
189 | export type Structure =
|
190 | | 'government_instrumentality'
|
191 | | 'governmental_unit'
|
192 | | 'incorporated_non_profit'
|
193 | | 'limited_liability_partnership'
|
194 | | 'multi_member_llc'
|
195 | | 'private_company'
|
196 | | 'private_corporation'
|
197 | | 'private_partnership'
|
198 | | 'public_company'
|
199 | | 'public_corporation'
|
200 | | 'public_partnership'
|
201 | | 'sole_proprietorship'
|
202 | | 'tax_exempt_government_instrumentality'
|
203 | | 'unincorporated_association'
|
204 | | 'unincorporated_non_profit';
|
205 |
|
206 | export interface Verification {
|
207 | /**
|
208 | * A document verifying the business.
|
209 | */
|
210 | document?: Verification.Document;
|
211 | }
|
212 |
|
213 | export namespace Verification {
|
214 | export interface Document {
|
215 | /**
|
216 | * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
217 | */
|
218 | back?: string;
|
219 |
|
220 | /**
|
221 | * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
222 | */
|
223 | front?: string;
|
224 | }
|
225 | }
|
226 | }
|
227 |
|
228 | export interface Individual {
|
229 | /**
|
230 | * The individual's primary address.
|
231 | */
|
232 | address?: Individual.Address;
|
233 |
|
234 | /**
|
235 | * The Kana variation of the the individual's primary address (Japan only).
|
236 | */
|
237 | address_kana?: JapanAddressParam;
|
238 |
|
239 | /**
|
240 | * The Kanji variation of the the individual's primary address (Japan only).
|
241 | */
|
242 | address_kanji?: JapanAddressParam;
|
243 |
|
244 | /**
|
245 | * The individual's date of birth.
|
246 | */
|
247 | dob?: Individual.Dob | null;
|
248 |
|
249 | /**
|
250 | * The individual's email address.
|
251 | */
|
252 | email?: string;
|
253 |
|
254 | /**
|
255 | * The individual's first name.
|
256 | */
|
257 | first_name?: string;
|
258 |
|
259 | /**
|
260 | * The Kana variation of the the individual's first name (Japan only).
|
261 | */
|
262 | first_name_kana?: string;
|
263 |
|
264 | /**
|
265 | * The Kanji variation of the individual's first name (Japan only).
|
266 | */
|
267 | first_name_kanji?: string;
|
268 |
|
269 | /**
|
270 | * The individual's gender (International regulations require either "male" or "female").
|
271 | */
|
272 | gender?: string;
|
273 |
|
274 | /**
|
275 | * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
|
276 | */
|
277 | id_number?: string;
|
278 |
|
279 | /**
|
280 | * The individual's last name.
|
281 | */
|
282 | last_name?: string;
|
283 |
|
284 | /**
|
285 | * The Kana varation of the individual's last name (Japan only).
|
286 | */
|
287 | last_name_kana?: string;
|
288 |
|
289 | /**
|
290 | * The Kanji varation of the individual's last name (Japan only).
|
291 | */
|
292 | last_name_kanji?: string;
|
293 |
|
294 | /**
|
295 | * The individual's maiden name.
|
296 | */
|
297 | maiden_name?: string;
|
298 |
|
299 | /**
|
300 | * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
301 | */
|
302 | metadata?: MetadataParam | null;
|
303 |
|
304 | /**
|
305 | * The individual's phone number.
|
306 | */
|
307 | phone?: string;
|
308 |
|
309 | /**
|
310 | * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
|
311 | */
|
312 | political_exposure?: Individual.PoliticalExposure;
|
313 |
|
314 | /**
|
315 | * The last four digits of the individual's Social Security Number (U.S. only).
|
316 | */
|
317 | ssn_last_4?: string;
|
318 |
|
319 | /**
|
320 | * The individual's verification document information.
|
321 | */
|
322 | verification?: Individual.Verification;
|
323 | }
|
324 |
|
325 | export namespace Individual {
|
326 | export interface Address {
|
327 | /**
|
328 | * City, district, suburb, town, or village.
|
329 | */
|
330 | city?: string;
|
331 |
|
332 | /**
|
333 | * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
334 | */
|
335 | country?: string;
|
336 |
|
337 | /**
|
338 | * Address line 1 (e.g., street, PO Box, or company name).
|
339 | */
|
340 | line1?: string;
|
341 |
|
342 | /**
|
343 | * Address line 2 (e.g., apartment, suite, unit, or building).
|
344 | */
|
345 | line2?: string;
|
346 |
|
347 | /**
|
348 | * ZIP or postal code.
|
349 | */
|
350 | postal_code?: string;
|
351 |
|
352 | /**
|
353 | * State, county, province, or region.
|
354 | */
|
355 | state?: string;
|
356 | }
|
357 |
|
358 | export interface Dob {
|
359 | /**
|
360 | * The day of birth, between 1 and 31.
|
361 | */
|
362 | day: number;
|
363 |
|
364 | /**
|
365 | * The month of birth, between 1 and 12.
|
366 | */
|
367 | month: number;
|
368 |
|
369 | /**
|
370 | * The four-digit year of birth.
|
371 | */
|
372 | year: number;
|
373 | }
|
374 |
|
375 | export type PoliticalExposure = 'none' | 'existing';
|
376 |
|
377 | export interface Verification {
|
378 | /**
|
379 | * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
|
380 | */
|
381 | additional_document?: Verification.AdditionalDocument;
|
382 |
|
383 | /**
|
384 | * An identifying document, either a passport or local ID card.
|
385 | */
|
386 | document?: Verification.Document;
|
387 | }
|
388 |
|
389 | export namespace Verification {
|
390 | export interface AdditionalDocument {
|
391 | /**
|
392 | * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
393 | */
|
394 | back?: string;
|
395 |
|
396 | /**
|
397 | * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
398 | */
|
399 | front?: string;
|
400 | }
|
401 |
|
402 | export interface Document {
|
403 | /**
|
404 | * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
405 | */
|
406 | back?: string;
|
407 |
|
408 | /**
|
409 | * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
410 | */
|
411 | front?: string;
|
412 | }
|
413 | }
|
414 | }
|
415 | }
|
416 |
|
417 | export interface Person {
|
418 | /**
|
419 | * The person's address.
|
420 | */
|
421 | address?: Person.Address;
|
422 |
|
423 | /**
|
424 | * The Kana variation of the person's address (Japan only).
|
425 | */
|
426 | address_kana?: JapanAddressParam;
|
427 |
|
428 | /**
|
429 | * The Kanji variation of the person's address (Japan only).
|
430 | */
|
431 | address_kanji?: JapanAddressParam;
|
432 |
|
433 | /**
|
434 | * The person's date of birth.
|
435 | */
|
436 | dob?: Person.Dob | null;
|
437 |
|
438 | /**
|
439 | * The person's email address.
|
440 | */
|
441 | email?: string;
|
442 |
|
443 | /**
|
444 | * The person's first name.
|
445 | */
|
446 | first_name?: string;
|
447 |
|
448 | /**
|
449 | * The Kana variation of the person's first name (Japan only).
|
450 | */
|
451 | first_name_kana?: string;
|
452 |
|
453 | /**
|
454 | * The Kanji variation of the person's first name (Japan only).
|
455 | */
|
456 | first_name_kanji?: string;
|
457 |
|
458 | /**
|
459 | * The person's gender (International regulations require either "male" or "female").
|
460 | */
|
461 | gender?: string;
|
462 |
|
463 | /**
|
464 | * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data).
|
465 | */
|
466 | id_number?: string;
|
467 |
|
468 | /**
|
469 | * The person's last name.
|
470 | */
|
471 | last_name?: string;
|
472 |
|
473 | /**
|
474 | * The Kana variation of the person's last name (Japan only).
|
475 | */
|
476 | last_name_kana?: string;
|
477 |
|
478 | /**
|
479 | * The Kanji variation of the person's last name (Japan only).
|
480 | */
|
481 | last_name_kanji?: string;
|
482 |
|
483 | /**
|
484 | * The person's maiden name.
|
485 | */
|
486 | maiden_name?: string;
|
487 |
|
488 | /**
|
489 | * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
490 | */
|
491 | metadata?: MetadataParam | null;
|
492 |
|
493 | /**
|
494 | * The person's phone number.
|
495 | */
|
496 | phone?: string;
|
497 |
|
498 | /**
|
499 | * The relationship that this person has with the account's legal entity.
|
500 | */
|
501 | relationship?: Person.Relationship;
|
502 |
|
503 | /**
|
504 | * The last 4 digits of the person's social security number.
|
505 | */
|
506 | ssn_last_4?: string;
|
507 |
|
508 | /**
|
509 | * The person's verification status.
|
510 | */
|
511 | verification?: Person.Verification;
|
512 | }
|
513 |
|
514 | export namespace Person {
|
515 | export interface Address {
|
516 | /**
|
517 | * City, district, suburb, town, or village.
|
518 | */
|
519 | city?: string;
|
520 |
|
521 | /**
|
522 | * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
523 | */
|
524 | country?: string;
|
525 |
|
526 | /**
|
527 | * Address line 1 (e.g., street, PO Box, or company name).
|
528 | */
|
529 | line1?: string;
|
530 |
|
531 | /**
|
532 | * Address line 2 (e.g., apartment, suite, unit, or building).
|
533 | */
|
534 | line2?: string;
|
535 |
|
536 | /**
|
537 | * ZIP or postal code.
|
538 | */
|
539 | postal_code?: string;
|
540 |
|
541 | /**
|
542 | * State, county, province, or region.
|
543 | */
|
544 | state?: string;
|
545 | }
|
546 |
|
547 | export interface Dob {
|
548 | /**
|
549 | * The day of birth, between 1 and 31.
|
550 | */
|
551 | day: number;
|
552 |
|
553 | /**
|
554 | * The month of birth, between 1 and 12.
|
555 | */
|
556 | month: number;
|
557 |
|
558 | /**
|
559 | * The four-digit year of birth.
|
560 | */
|
561 | year: number;
|
562 | }
|
563 |
|
564 | export interface Relationship {
|
565 | /**
|
566 | * Whether the person is a director of the account's legal entity. Currently only required for accounts in the EU. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
|
567 | */
|
568 | director?: boolean;
|
569 |
|
570 | /**
|
571 | * Whether the person has significant responsibility to control, manage, or direct the organization.
|
572 | */
|
573 | executive?: boolean;
|
574 |
|
575 | /**
|
576 | * Whether the person is an owner of the account's legal entity.
|
577 | */
|
578 | owner?: boolean;
|
579 |
|
580 | /**
|
581 | * The percent owned by the person of the account's legal entity.
|
582 | */
|
583 | percent_ownership?: number | null;
|
584 |
|
585 | /**
|
586 | * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.
|
587 | */
|
588 | representative?: boolean;
|
589 |
|
590 | /**
|
591 | * The person's title (e.g., CEO, Support Engineer).
|
592 | */
|
593 | title?: string;
|
594 | }
|
595 |
|
596 | export interface Verification {
|
597 | /**
|
598 | * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
|
599 | */
|
600 | additional_document?: Verification.AdditionalDocument;
|
601 |
|
602 | /**
|
603 | * An identifying document, either a passport or local ID card.
|
604 | */
|
605 | document?: Verification.Document;
|
606 | }
|
607 |
|
608 | export namespace Verification {
|
609 | export interface AdditionalDocument {
|
610 | /**
|
611 | * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
612 | */
|
613 | back?: string;
|
614 |
|
615 | /**
|
616 | * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
617 | */
|
618 | front?: string;
|
619 | }
|
620 |
|
621 | export interface Document {
|
622 | /**
|
623 | * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
624 | */
|
625 | back?: string;
|
626 |
|
627 | /**
|
628 | * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.
|
629 | */
|
630 | front?: string;
|
631 | }
|
632 | }
|
633 | }
|
634 | }
|