Back to all terms
Payment
Paymentsbasic

Tokenization (Card Data)

Replacing sensitive card numbers with non-sensitive token identifiers that reference the card data stored securely by the payment processor, keeping your systems out of PCI scope.

Also known as: card tokenization, payment tokens, PaymentMethod tokens, card vaulting

Description

Tokenization replaces sensitive cardholder data (the 16-digit PAN, CVV, and expiration date) with a non-reversible token identifier that has no exploitable value if compromised. When a customer enters their card details into Stripe Elements or Checkout, Stripe's client-side JavaScript transmits the data directly to Stripe's servers and returns a PaymentMethod ID (pm_...) or a legacy Token (tok_...) to your application. Your backend only ever handles these token identifiers, never the raw card data, which dramatically reduces your PCI compliance burden.

Stripe's tokenization model operates at multiple levels. A PaymentMethod (pm_) represents a customer's payment instrument and can be attached to a Customer object for reuse. A SetupIntent flow securely collects and tokenizes a card for future use without an immediate charge, useful for saving cards during registration or for free trial signups. The PaymentMethod stores card metadata (brand, last4, exp_month, exp_year, fingerprint) that your application can safely display and store, while the actual card number remains in Stripe's PCI Level 1 compliant vault.

The card fingerprint is a particularly useful token for fraud detection and deduplication. Stripe generates a deterministic fingerprint for each unique card number, so the same physical card always produces the same fingerprint regardless of which Customer it's attached to. You can use fingerprints to detect when a single card is being used across multiple accounts, enforce one-trial-per-card policies, or flag suspicious patterns.

Prompt Snippet

Collect card details exclusively through Stripe.js's confirmSetup() or confirmPayment() flows, which tokenize card data client-side and return a PaymentMethod ID (pm_...) that your server stores. Use SetupIntents (stripe.setupIntents.create) for saving cards without an immediate charge, passing the resulting PaymentMethod to stripe.paymentMethods.attach() to bind it to a Customer. Store the PaymentMethod ID, card.last4, card.brand, card.exp_month, card.exp_year, and card.fingerprint in your database for display and deduplication purposes. Use the card fingerprint to enforce unique-card constraints across accounts by adding a UNIQUE index on (fingerprint, policy_scope).

Tags

tokenizationsecuritypcicard-datastripepayment-method