Antom, leading provider of tailored payment solutions

Card-on-File (COF) transactions

COF (Card-on-File) refers to a card that the buyer has previously used for payment and stored at the merchant's site during a transaction. With the buyer’s authorization, you can either store the card information yourself or have Antom store it on your behalf. When your buyer makes a payment using the stored card information, it is strongly recommended that you mark the transaction as a stored card payment in the request. Using stored card payments can effectively reduce the decline rate from card schemes and issuing banks, and improve the payment success rate. This article introduces how to enable COF.
Payment Element integration

How to enable

When the buyer initiates a payment using a stored card, you need to set availablePaymentMethod.paymentMethodMetaData.isCardOnFile to true in the createPaymentSession (One-time Payments) API to identify the transaction as a stored card payment.
The following is a sample code for initiating a subsequent transaction where the card information is stored by Antom, and the cardToken information provided by Antom is used:
json
{
  ...
    "availablePaymentMethod": {
        "paymentMethodMetaData": {
            "isCardOnFile": true
        }
    },  
  "savedPaymentMethods": [
        {
            "paymentMethodType": "CARD",
            "paymentMethodId": "ALIPAYEfG2DFbGx2Eh739qU+VMnCPEe7MfRKfMfC5k7k/IFASWpAh/vCxHV3dPYpbkGz1iyWCloE4MwfmN48sP8+rSPQ=="
        }
    ]
  ...
}
Hosted card integration

How to enable

When the buyer initiates a payment using a stored card, you need to set paymentMethod.paymentMethodMetaData.isCardOnFile to true in the pay (One-time Payments) API to identify the transaction as a stored card payment.
The following is a sample code for initiating a subsequent transaction where the card information is stored by Antom, and the cardToken information provided by Antom is used:
json
"paymentMethod":
    {
        "paymentMethodMetaData":
        {
            "isCardOnFile": true
        },
        "paymentMethodType": "CARD",
        "paymentMethodId": "ALIPAYgzViZ*********RWZIU31kU+2avs5dAgkzss/NrTymfnc/0+xI0ssHmyU3VyWCloE4MwfmN48sP1+rSPQ=="
    }
Server-to-server card integration

How to enable

When the buyer initiates a payment using a stored card, you need to set paymentMethod.paymentMethodMetaData.isCardOnFile to true in the pay (One-time Payments) API to identify the transaction as a stored card payment.

Antom stores card information Recommended

It is recommended that you let Antom store the card information on your behalf, and use the cardToken information provided by Antom to initiate subsequent transactions. Data shows that using card information stored by Antom and initiating subsequent transactions with a token results in a significantly higher success rate compared to storing card information yourself.
The following is a sample code for initiating a subsequent transaction using the cardToken information provided by Antom:
json
"paymentMethod":
    {
        "paymentMethodMetaData":
        {
            "isCardOnFile": true
        },
        "paymentMethodType": "CARD",
        "paymentMethodId": "AL****************PQ=="
    }

Manually store card information

If you choose to store the card information yourself, you need to specify the cardNo, expiryYear, expiryMonth, cardholderName, and isCardOnFile parameters in subsequent transactions. Note that cvv is not required in subsequent transactions.
The following is a sample code for initiating a subsequent transaction using the card information stored by yourself:
json
"paymentMethod":
    {
        "paymentMethodMetaData":
        {
            "cardholderName":
            {
                "firstName": "Tom",
                "lastName": "Jerry"
            },
            "expiryMonth": "11",
            "expiryYear": "28",
            "cardNo": "41************54",
            "isCardOnFile": true
        },
        "paymentMethodType": "CARD"
    },
Checkout Page (CKP) integration

How to enable

When the buyer initiates a payment using a stored card, you need to set availablePaymentMethod.paymentMethodMetaData.isCardOnFile to true in the createPaymentSession (One-time Payments) API to identify the transaction as a stored card payment.
The following is a sample code for initiating a subsequent transaction where the card information is stored by Antom, and the cardToken information provided by Antom is used:
json
{
  ...
    "availablePaymentMethod": {
        "paymentMethodMetaData": {
            "isCardOnFile": true
        }
    },  
  "savedPaymentMethods": [
        {
            "paymentMethodType": "CARD",
            "paymentMethodId": "ALIPAYEfG2DFbGx2Eh739qU+VMnCPEe7MfRKfMfC5k7k/IFASWpAh/vCxHV3dPYpbkGz1iyWCloE4MwfmN48sP8+rSPQ=="
        }
    ]
  ...
}
Note: In COF (Card-on-File) transactions, the payment may fail if the buyer’s card has expired. In such cases, Antom will return the error code INVALID_EXPIRATION_DATE. We recommend guiding the buyer to bind the card again to update the card information.