Process a Transaction Using a Payment Token

You can process payments using credit cards (Card Payments API) or bank accounts (Direct Debit API) that you have stored in the Customer Vault by referring to the paymentToken associated with the card or bank account. In these cases, the payment token replaces all the card or bank account information that otherwise might be included in the request (e.g., card number and expiry date).

  • When you added a card to the profile in a previous example, you got back a paymentToken with the value of CaBP0abDKgROjYU.
  • When you added a bank account to the profile in a previous example, you got back a paymentTokenwith the value of CNjEzMTM4NDg1.

You can process payments using a mobile device, e.g., with Apple Pay, by including the single-use paymentToken that is required for each mobile payment request. Single-use tokens are valid for only 15 minutes and are not consumed by verification. When you created an Apple Pay single-use token in a previous example, you got back a paymentToken with the value of ABC4AFQQBC5UR5H.

To process a credit card purchase transaction using a payment token, you must include it in a POST request to the auths endpoint in the Card Payments API. See the figure below for an overview of the steps.

Overview of Card Purchase Using Payment Token

The following example shows you how to process a credit card request using the paymentToken that represents that card.

Prior to trying the example, you should:

  • Replace the API key (after the -u) with the API key you have received.
  • Replace the account ID with your account ID.
Value Required? Type Description
merchantRefNum Yes string The merchant's own card identification.
amount Yes integer The amount in minor currency units.
card.paymentToken Yes string The payment token representing the card used for the request.
settleWithAuth boolean true when the request is an authorization and settlement.
dupCheck boolean Set to true if this request is not a duplicate.
description string A description of the transaction provided by the merchant.
billingDetails object The request billing details.
merchantDescriptor object The merchant descriptor shown on the customer's card statement.

See our API Reference section for a complete description of the parameters for this request type.

Did you find this page useful?