CheckoutRecurring

Create a token to store payment details

POST
/storedPaymentMethods

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

Authorization

AuthorizationBasic <token>

In: header

Header Parameters

Idempotency-Key?string

A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).

Request Body

application/json

merchantAccount*string

The merchant account identifier, with which you want to process the transaction.

paymentMethod*

Contains the information required to store a payment method.

recurringProcessingModel*string

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.

Value in

  • "CardOnFile"
  • "Subscription"
  • "UnscheduledCardOnFile"
shopperEmail?string

The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.

shopperIP?string

The IP address of a shopper.

shopperReference*string

A unique identifier for the shopper (for example, user ID or account ID).

Response Body

application/json

curl -X POST "https://example.com/storedPaymentMethods" \  -H "Idempotency-Key: 37ca9c97-d1d1-4c62-89e8-706891a563ed" \  -H "Content-Type: application/json" \  -d '{    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",    "shopperReference": "YOUR_SHOPPER_REFERENCE",    "paymentMethod": {      "type": "scheme",      "encryptedCardNumber": "test_4111111111111111",      "encryptedExpiryMonth": "test_03",      "encryptedExpiryYear": "test_2030",      "encryptedSecurityCode": "test_737",      "holderName": "John Smith"    },    "recurringProcessingModel": "Subscription",    "shopperEmail": "s.hopper@test.com",    "shopperIP": "192.0.2.1"  }'

Example for a successful response to store encrypted card details

{  "expiryMonth": "03",  "expiryYear": "2030",  "holderName": "John Smith",  "id": "KHQC5N7G84BLNK43",  "lastFour": "1111",  "shopperReference": "YOUR_SHOPPER_REFERENCE",  "type": "scheme"}