Token de-duplication

When saving a card or bank account returns the token you already have, and when Preczn creates a new one.

When you save a card or bank account that your platform has already saved, Preczn returns the existing multi-use token instead of creating a new one. This works whether you save the payment method on a transaction or create the token directly, so you can match a returning payment method to a customer you already know.

flowchart TD
    A["You save a card or bank account"] --> B{"Saved before with the<br/>same details and scope?"}
    B -- "Yes" --> C["Existing token"]
    B -- "No" --> D["New token"]
    classDef step fill:#2563eb,stroke:#1d4ed8,color:#ffffff
    classDef check fill:#4013be,stroke:#300e90,color:#ffffff
    classDef same fill:#059669,stroke:#047857,color:#ffffff
    classDef fresh fill:#0891b2,stroke:#0e7490,color:#ffffff
    class A step
    class B check
    class C same
    class D fresh

What counts as the same payment method

Preczn returns the existing token when every value in the row matches a payment method already saved with the same scope:

Payment methodValues that must match
CardCard number and expiration date
Bank accountRouting number, account number, account type, and bank country

Scope decides where Preczn looks for a match. A platform token matches for every merchant on your platform. A merchant token matches only for the merchant it belongs to. For how scope is set, see Choosing a Token Scope.


When Preczn creates a new token

Preczn creates a new token in the following cases:

  • A different expiration date. A card saved with a new expiration date gets a new token. The earlier token doesn't change.
  • A different account type or bank country. A bank account saved with a different type or bankCountry gets a new token.
  • The other scope. A card that already has a platform token gets a separate merchant token when you save it with merchantToken=true, and the reverse. The existing token doesn't change.
  • A single-use token. Preczn never matches single-use tokens. Each request for one returns a new single-use token.

What changes on a match

When you save a payment method that matches an existing token, the token ID stays the same. Preczn updates the billing information saved with the token with the values you send and keeps the values you leave out. For which values Preczn stores, see Storing Billing Information.

For the request that saves a payment method, see Save a card for later use.


Did this page help you?