Sample - Adyen Checkout API
POST/storedPaymentMethods

Create a token to store payment details

Creates a token to store the shopper's payment details. This token can be used for the shopper's future payments.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
Idempotency-Keystringoptional
A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
merchantAccountstringrequired
The merchant account identifier, with which you want to process the transaction.
paymentMethodobjectrequired
Contains the information required to store a payment method.
recurringProcessingModelstringrequired
Defines a recurring payment type. Required when creating a token to store payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount.
Allowed:CardOnFileSubscriptionUnscheduledCardOnFile
shopperEmailstringoptional
The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.
shopperIPstringoptional
The IP address of a shopper.
shopperReferencestringrequired
A unique identifier for the shopper (for example, user ID or account ID).

1 status code
201Created - the request has been fulfilled and has resulted in one or more new resources being created.
aliasstringoptional
The alias of the credit card number. Applies only to recurring contracts storing credit card details
aliasTypestringoptional
The alias type of the credit card number. Applies only to recurring contracts storing credit card details.
brandstringoptional
The brand of the card.
cardBinstringoptional
The bank identification number (BIN) of the card.
expiryMonthstringoptional
The month the card expires.
expiryYearstringoptional
The last two digits of the year the card expires. For example, **22** for the year 2022.
externalResponseCodestringoptional
The response code returned by an external system (for example after a provisioning operation).
externalTokenReferencestringoptional
The token reference of a linked token in an external system (for example a network token reference).
holderNamestringoptional
The unique payment method code.
ibanstringoptional
The IBAN of the bank account.
idstringoptional
A unique identifier of this stored payment method.
issuerNamestringoptional
The name of the issuer of token or card.
lastFourstringoptional
The last four digits of the PAN.
mandateobjectoptional
Mandate details for the stored payment method.
namestringoptional
The display name of the stored payment method.
networkTxReferencestringoptional
Returned in the response if you are not tokenizing with Adyen and are using the Merchant-initiated transactions (MIT) framework from Mastercard or Visa. This contains either the Mastercard Trace ID or the Visa Transaction ID.
ownerNamestringoptional
The name of the bank account holder.
shopperEmailstringoptional
The shopper’s email address.
shopperReferencestringoptional
Your reference to uniquely identify this shopper, for example user ID or account ID. The value is case-sensitive and must be at least three characters. > Your reference must not include personally identifiable information (PII) such as name or email address.
supportedRecurringProcessingModelsarray<string>optional
Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount.
typestringoptional
The type of payment method.