Sample - Stripe API
POST/v1/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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

8 body fields
accountobjectoptional
Information for the account this token represents.
bank_accountobjectoptional
The bank account this token will represent.
cardobjectoptional
The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below.
customerstringoptional
Create a token for the customer, which is owned by the application's account. You can only use this with an [OAuth access token](https://docs.stripe.com/connect/standard-accounts) or [Stripe-Account header](https://docs.stripe.com/connect/authentication). Learn more about [cloning saved payment methods](https://docs.stripe.com/connect/cloning-saved-payment-methods).
cvc_updateobjectoptional
The updated CVC value this token represents.
expandarray<string>optional
Specifies which fields in the response should be expanded.
personobjectoptional
Information for the person this token represents.
piiobjectoptional
The PII this token represents.

2 status codes
200Successful response.
bank_accountobjectoptional
These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](/payments/bank-debits-transfers)
cardobjectoptional
You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://docs.stripe.com/sources/cards)
client_ipstringoptional
IP address of the client that generates the token.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:token
typestringrequired
Type of the token: `account`, `bank_account`, `card`, or `pii`.
usedbooleanrequired
Determines if you have already used this token (you can only use tokens once).
defaultError response.
errorobjectrequired

Error handling

Any other status is an error: Error response.