lynx   »   [go: up one dir, main page]

Create a bank account token 

Core Resources
Tokens
Create a bank account token

Creates a single-use token that represents a bank account’s details. You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a connected account where controller.requirement_collection is application, which includes Custom accounts.

Parameters

  • bank_accountobject

    The bank account this token will represent.

    • bank_account.account_numberstringRequired

      The account number for the bank account, in string form. Must be a checking account.

    • bank_account.countrystringRequired

      The country in which the bank account is located.

    • bank_account.account_holder_namestring

      The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object.

    • bank_account.account_holder_typestring

      The type of entity that holds the account. It can be company or individual. This field is required when attaching the bank account to a Customer object.

    • bank_account.account_typestring

      The bank account type. This can only be checking or savings in most countries. In Japan, this can only be futsu or toza.

    • bank_account.currencyenum

      The currency the bank account is in. This must be a country/currency pairing that Stripe supports.

    • bank_account.payment_methodstring

      The ID of a Payment Method with a type of us_bank_account. The Payment Method’s bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the bank_account hash. You must include the top-level customer parameter if the Payment Method is attached to a Customer object. If the Payment Method is not attached to a Customer object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with attach_to_self=true.

    • bank_account.routing_numberstring

      The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for account_number, this field is not required.

More parameters

Returns

Returns the created bank account token if it’s successful. Otherwise, this call raises an error.

POST /v1/tokens
curl https://api.stripe.com/v1/tokens \
-u "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2:" \
-d "bank_account[country]"=US \
-d "bank_account[currency]"=usd \
-d "bank_account[account_holder_name]"="Jenny Rosen" \
-d "bank_account[account_holder_type]"=individual \
-d "bank_account[routing_number]"=110000000 \
-d "bank_account[account_number]"=000123456789
Response
{
"id": "tok_1N3T00LkdIwHu7ixt44h1F8k",
"object": "token",
"bank_account": {
"id": "ba_1NWScr2eZvKYlo2C8MgV5Cwn",
"object": "bank_account",
"account_holder_name": "Jenny Rosen",
"account_holder_type": "individual",
"account_type": null,
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "1JWtPxqbdX5Gamtz",
"last4": "6789",
"routing_number": "110000000",
"status": "new"
},
"client_ip": null,
"created": 1689981645,
"livemode": false,
"redaction": null,
"type": "bank_account",
"used": false
}
Лучший частный хостинг