What Is Tokenization in Payments?

Category: PrestaShop & eCommerce ยท Updated 2026-11-15

Tokenization in payments is the process of replacing a customer's actual card number with a randomly generated substitute value, called a token, that is meaningless outside the system that created it. Your store stores and reuses the token for things like repeat purchases or refunds, while the real card number stays locked away in the payment processor's secure vault. If a token is ever stolen, it cannot be used to make a charge anywhere else.

How tokenization works, step by step

  1. A customer enters their card number on a payment form, usually one hosted or embedded by a payment gateway rather than your own server.
  2. The gateway sends the real card number directly to its own secure vault or to the card network, never storing it on your store's database.
  3. The vault returns a token, a string of characters that has no mathematical relationship to the original card number.
  4. Your store saves the token against the customer's account instead of the card number.
  5. For a later charge, refund or subscription renewal, your store sends the token back to the gateway, which looks up the real card details internally and processes the transaction.

Tokenization vs. encryption

Both techniques protect card data, but they work differently. Encryption transforms the card number into unreadable ciphertext that can be decrypted back into the original number using a key. Tokenization replaces the number with a value that has no reversible relationship to it at all; the original number is never derivable from the token itself, only from a secure lookup at the vault that issued it. This is why a leaked token is far less dangerous than leaked encrypted data combined with its key.

EncryptionTokenization
Can the original be recovered?Yes, with the decryption keyOnly by the vault that issued the token
FormatOften changes length and formatCan be designed to look like a card number
Typical useProtecting data in storage or transitReplacing stored card numbers for reuse

Why it matters for PCI scope and recurring billing

Tokenization is one of the main reasons small merchants can avoid the heaviest PCI DSS requirements. If your server only ever sees and stores a token, not a real card number, you are generally not storing cardholder data, which keeps your required compliance questionnaire much simpler. It also makes recurring billing practical: a subscription box or SaaS product can charge a customer every month by resending the saved token, without ever asking the customer to re-enter their card or without the store keeping a live card number on file.

Gateway tokens vs. network tokens

  • Gateway or processor tokens: issued by your payment gateway (such as a major processor's vault) and only usable through that specific gateway's systems.
  • Network tokens: issued by the card network itself (Visa, Mastercard and similar), tied to the actual card and able to update automatically when a card is reissued or its expiration date changes, which can reduce failed recurring payments.

Most small and mid-size stores interact only with gateway tokens through their payment provider's checkout or API, without needing to manage the distinction directly.

Where you will encounter tokenization

You don't usually build tokenization yourself. It happens automatically when you use a payment gateway's hosted checkout, embedded card fields or "save this card for later" feature. Common everyday examples include a saved card on file for one-click checkout, a stored payment method for a monthly subscription, and the token your store passes back to a gateway to issue a refund without ever handling the original card number.

Frequently asked questions

What is tokenization in simple terms?

Tokenization replaces a real credit card number with a random substitute value, called a token, that your store can safely store and reuse without ever holding the actual card number.

Is a payment token the same as encrypted card data?

No. Encrypted data can be decrypted back to the original number with the right key. A token has no mathematical link to the original card number and can only be matched back to it inside the vault that created it.

Does tokenization make my store automatically PCI compliant?

Not automatically, but it significantly reduces what you need to do. If your server never touches the real card number, you usually qualify for the simplest compliance questionnaire, though you still need to complete it and keep your site secure.

Can a stolen token be used to make a purchase elsewhere?

Generally no. A token issued by one gateway's vault is normally meaningless outside that specific system, so stealing it does not let an attacker charge the card through a different processor or store.

Do I need tokenization for a subscription or recurring billing store?

Yes, in practice. Tokenization is what lets a store charge a customer again later without asking them to re-enter their card or storing the real card number yourself.

Who provides tokenization for an online store?

Your payment gateway or processor provides it as part of their checkout or API, such as a hosted payment page, embedded card field widget, or a "save card" feature built into their service.

Related topics