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.
In: header
Header Parameters
A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
Request Body
application/json
The merchant account identifier, with which you want to process the transaction.
Contains the information required to store a payment method.
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"
The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.
The IP address of a shopper.
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"}Get tokens for stored payment details GET
Lists the tokens for stored payment details for the shopper identified in the path, if there are any available. The token ID can be used with payment requests for the shopper's payment. A summary of the stored details is included.
Delete a token for stored payment details DELETE
Deletes the token identified in the path. The token can no longer be used with payment requests.
