# token

From **Stripe API**.

Tokenization is the process Stripe uses to collect sensitive card or bank
account details, or personally identifiable information (PII), directly from
your customers in a secure manner. A token representing this information is
returned to your server to use. You should use our
[recommended payments integrations](https://stripe.com/docs/payments) to perform this process
client-side. This ensures that no sensitive card data touches your server,
and allows your integration to operate in a PCI-compliant way.

If you cannot use client-side tokenization, you can also create tokens using
the API with either your publishable or secret API key. Keep in mind that if
your integration uses this method, you are responsible for any PCI compliance
that may be required, and you must keep your secret API key safe. Unlike with
client-side tokenization, your customer's information is not sent directly to
Stripe, so we cannot determine how it is handled or stored.

Tokens cannot be stored or used more than once. To store card or bank account
information for later use, you can create [Customer](https://stripe.com/docs/api#customers)
objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that
[Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,
performs best with integrations that use client-side tokenization.

Related guide: [Accept a payment](https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token)

- Type: `object`

## Properties

### `bank_account`

- Required: false
- Type: `object`

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).

### `card`

- Required: false
- Type: `object`

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://stripe.com/docs/sources/cards).

### `client_ip`

- Required: false
- Type: `string`
- Nullable: true
- maxLength: `5000`

IP address of the client that generated the token.

### `created`

- Required: true
- Type: `integer`
- Format: `unix-time`

Time at which the object was created. Measured in seconds since the Unix epoch.

### `id`

- Required: true
- Type: `string`
- maxLength: `5000`

Unique identifier for the object.

### `livemode`

- Required: true
- Type: `boolean`

Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

### `object`

- Required: true
- Type: `string`
- Allowed values: `"token"`

String representing the object's type. Objects of the same type share the same value.

### `type`

- Required: true
- Type: `string`
- maxLength: `5000`

Type of the token: `account`, `bank_account`, `card`, or `pii`.

### `used`

- Required: true
- Type: `boolean`

Whether this token has already been used (tokens can be used only once).

## JSON Schema

```json
{"description":"Tokenization is the process Stripe uses to collect sensitive card or bank\naccount details, or personally identifiable information (PII), directly from\nyour customers in a secure manner. A token representing this information is\nreturned to your server to use. You should use our\n[recommended payments integrations](https://stripe.com/docs/payments) to perform this process\nclient-side. This ensures that no sensitive card data touches your server,\nand allows your integration to operate in a PCI-compliant way.\n\nIf you cannot use client-side tokenization, you can also create tokens using\nthe API with either your publishable or secret API key. Keep in mind that if\nyour integration uses this method, you are responsible for any PCI compliance\nthat may be required, and you must keep your secret API key safe. Unlike with\nclient-side tokenization, your customer's information is not sent directly to\nStripe, so we cannot determine how it is handled or stored.\n\nTokens cannot be stored or used more than once. To store card or bank account\ninformation for later use, you can create [Customer](https://stripe.com/docs/api#customers)\nobjects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that\n[Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,\nperforms best with integrations that use client-side tokenization.\n\nRelated guide: [Accept a payment](https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token)","properties":{"bank_account":{"$ref":"#/components/schemas/bank_account"},"card":{"$ref":"#/components/schemas/card"},"client_ip":{"description":"IP address of the client that generated the token.","maxLength":5000,"nullable":true,"type":"string"},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["token"],"type":"string"},"type":{"description":"Type of the token: `account`, `bank_account`, `card`, or `pii`.","maxLength":5000,"type":"string"},"used":{"description":"Whether this token has already been used (tokens can be used only once).","type":"boolean"}},"required":["created","id","livemode","object","type","used"],"title":"Token","type":"object","x-expandableFields":["bank_account","card"],"x-resourceId":"token"}
```
