Search

Are you looking for test card numbers?

Would you like to contact support?

Online-payment icon

Making payments with tokens

Use tokenized payment information for recurring and subscription payments.

After you have created tokens for your shopper's payment details, you can use the tokens when:

Presenting your shopper's stored card details

You can use our client-side solutions to show stored cards as a payment option in your payment form. For more information, refer to:

If you're using the API-only integration, you need to build your own UI for showing the stored card details. For more information, refer to:

When using our classic Checkout SDK integrations, you can present stored card details with the Web SDK, the iOS SDK, and the Android SDK.

Making a payment with the token and CVV

From your server, make a POST /payments request and include the following parameters.

  • shopperReference: This is the shopperReference that you used the first time when you stored the shopper's card details.
  • shopperInteraction: Set this to ContAuth.
  • recurringProcessingModel: Set this to CardOnFile.
  • paymentMethod: Object that contains the shopper's recurring detail reference and CVV. If you are using Drop-in or Card Component, pass the data returned in the events and send it in this object. For example, send the data.paymentMethod from your iOS Drop-in and Card Component or state.data from your Web Drop-in and Card Component.

    You can also collect the following values with your own UI:

    • type: Set this to scheme to indicate card payment method.
    • recurringDetailReference or storedPaymentMethodId (the id from the /paymentMethods response) for API v49 and above.
    • encryptedSecurityCode: Encrypted card verification code.

If you are implementing 3D Secure for PSD2 SCA compliance, issuing banks might require SCA for ContAuth with CardOnFile transactions. Contact our Support Team to enable 3D Secure.

{
   "amount":{
      "value":2000,
      "currency":"USD"
   },
   "paymentMethod":{
      "type": "scheme",
      "recurringDetailReference":"7219687191761347",
      "encryptedSecurityCode": "adyenjs_0_1_18$MT6ppy0FAMVMLH..."
   },
   "reference":"Your Reference Here",
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "returnUrl":"https://your-company.com/...",
   "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
   "shopperInteraction":"ContAuth",
   "recurringProcessingModel": "CardOnFile"
}

If the payment was successful, you'll receive a resultCode of Authorised.

{
   "pspReference": "8815329842815468",
   "resultCode": "Authorised"
}

If you are implementing 3D Secure for PSD2 SCA compliance and would like to know how the regulation will impact your recurring business model, see SCA requirements based on business model.

Making a subsequent payment for a subscription or contract

Make a POST /payments request and include the following parameters.

  • paymentMethod: Object that contains the shopper's tokenized payment details.

    • recurringDetailReference or storedPaymentMethodId for API v49 and above. This is the recurringDetailReference returned in the response when you created the token.
  • shopperReference: This is the shopperReference that you used the first time when you created the token for the shopper's card details.
  • shopperInteraction: Set this to ContAuth.
  • recurringProcessingModel: Set this to Subscription or UnscheduledCardOnFile depending on your business model. See Recurring transaction types.
{
   "amount":{
      "value":2000,
      "currency":"USD"
   },
   "paymentMethod":{
      "type": "scheme",
      "storedPaymentMethodId":"7219687191761347"
   },
   "reference":"YOUR_ORDER_NUMBER",
   "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
   "returnUrl":"https://your-company.com/...",
   "shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
   "shopperInteraction":"ContAuth",
   "recurringProcessingModel": "Subscription"
}

If the payment was successful, you'll receive a resultCode of Authorised.

{
   "pspReference": "8815329842815468",
   "resultCode": "Authorised"
}

Next steps