> For the complete documentation index, see [llms.txt](https://wallee.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wallee.gitbook.io/documentation/payments/integrations/features/tokenization.md).

# Tokenization

A **token** is a secure reference to stored payment information inside the platform. Instead of asking your customer for their payment details again, you reuse the token — in a [charge flow](/documentation/payments/integrations/features/charge-flows.md), a [subscription](/documentation/payments/integrations/subscriptions.md) or a direct transaction.

The main use case is storing credit card information, which may only be kept inside PCI certified environments — see [PCI DSS](/documentation/payments/overview/transaction-states/pci-dss.md). Tokens are also useful whenever the information is sensitive or unstructured and you do not want to hold it yourself.

You can find detailed information in our documentation here:\
<https://{inject-platform-url}/en/doc/payment/tokenization>

**In short:**

* **Tokenization** saves sensitive payment data securely.
* **One-click payment** makes repeat purchases faster and smoother.
* Both boost your conversion rate and improve the customer experience.

### Which payment methods support tokens?

Not all payment methods support tokenization. You can create a token for every connector that supports it. To check:

1. Open the [connector list](https://{inject-platform-url}/space/select?target=/payment/connector-configuration/list) in your space.
2. Open the desired payment method (connector).
3. Check the features section to see whether **tokenization** is supported.

{% hint style="warning" %}
Subscriptions rely on tokenization, so a connector without it cannot be used for recurring billing.
{% endhint %}

### How to create a token

Tokens can be created automatically during a payment — for example for recurring payments — or manually via the Token Service of the [Web Service API](/documentation/developer-tools/api-reference/web-service-api.md).

**Example request to create a token:**

```json
{
  "customerEmailAddress": "test@email.com",
  "enabledForOneClickPayment": true,
  "externalId": "1",
  "state": "ACTIVE",
  "tokenReference": "test-customer"
}
```

### How to use a token in a payment

There are two main ways to use a token:

* **With the iFrame or payment page** — the customer chooses their saved payment method. See [Payment Page](/documentation/payments/integrations/integrations/wallee-payment-page.md) and [iFrame](/documentation/payments/integrations/integrations/iframe-integration.md).
* **Direct charge** — you include the token ID in the payment request and charge directly.

**Example request using a token:**

```json
{
  "billingAddress": {
    "city": "Zurich",
    "country": "Switzerland",
    "familyName": "Test",
    "givenName": "Customer",
    "street": "Teststreet 4"
  },
  "currency": "chf",
  "lineItems": [
    {
      "amountIncludingTax": "15",
      "name": "Test",
      "quantity": "1",
      "type": "PRODUCT",
      "uniqueId": "12354"
    }
  ],
  "token": {
    "id": 1572
  }
}
```

### Enabling one-click checkout

To allow one-click payments, make sure the following requirements are met:

* The payment method supports tokenization.
* You provide a `customerId` in the transaction.
* One-click mode is activated in the payment method settings.

**One-click payment modes:**

| Mode                   | Behaviour                                           |
| ---------------------- | --------------------------------------------------- |
| **Disabled** (default) | No token is created.                                |
| **Force Storage**      | A token is always stored.                           |
| **Allow Storage**      | The customer can choose whether to save their data. |

### How it works for customers

1. The customer makes a payment.
2. A token is stored securely.
3. For future orders, the system recognizes the customer via the customer ID.
4. The customer can pay with one click or choose a different method.
5. You can also charge the token directly — for example for a re-order taken by phone.

### Related topics

* [Charge Flows](/documentation/payments/integrations/features/charge-flows.md) — charging a stored token when the customer is not present.
* [Subscriptions](/documentation/payments/integrations/subscriptions.md) — recurring billing built on tokens.
