Last Updated: 21 November 2024 | Change Log

Store a card only

Create a customer agreement to store card details for future customer initiated transactions (CIT). No initial payment is being made. Either using API only or our Checkout SDK for low PCI hosted card.

The request must contain:

  • customerAgreement.type = cardOnFile - used to indicate the customer has agreed to storing their card for the purpose of future merchant initiated transactions (MIT)
  • customerAgreement.storedCardUsage = first
  • instruction.value.amount - Set to 0 - A card verification to check the card details is performed instead of a full payment request.

If PSD2/SCA or other regional mandates apply you should follow the steps for enabling 3DS

Optionally:

  • tokenCreation.type = worldpay - include if you're storing the card as a Worldpay Token

Whilst you can Use a Network Token, its not yet possible to create a network token as part of the payments API flow. You can create a network token using a separate request to the Access Tokens API as well as provision the network token cryptogram each time its used.


Collect the card details and send an API request with these details to the Payments resource.

Request

{
    "transactionReference": "Memory265-13/08/1876",
    "merchant": {
        "entity": "default"
    },
    "instruction": {
        "method": "card",
        "paymentInstrument": {
            "type": "plain",
            "cardNumber": "4000000000001091",
                "expiryDate": {
                "month": 5,
                "year": 2035
            }
        },
        "tokenCreation": {
            "type": "worldpay"
        },
        "customerAgreement": {
            "type": "cardOnFile",
            "storedCardUsage":"first"
        },
        "narrative": {
            "line1": "trading name"
        },
        "value": {
            "currency": "GBP",
            "amount": 0
        }
    }
}

Enable additional features

Feature
Description
Details
Fraud assessmentPrevent fraudulent transactions.How to enable
3DS authenticationShift Liability to the issuer / for EEA countries this is required as part of SCA compliance.How to enable
Auto SettlementRequest that payment authorizations are automatically sent for settlement (sometimes referred to as "capture").How to enable
Financial Services
(MCC 6012 / 6051)
If you provide financial services, debt repayment, or consumer bill payments, you should supply additional details in the authorization request for compliance reasons.How to enable

Response

Flow differences

API responses differ based on the features you have enabled:

  • If 3DS is enabled you will receive a 3dsDeviceDataRequired outcome and additionally, if prompted by the card issuer, a 3dsChallenged response.

  • If FraudSight is enabled, you can receive a fraudHighRisk response, stopping the transaction.

  • If settlement.auto is set to true, the outcome will be sentForSettlement. If set to false it will be authorized with an addtional settlement action required.

    • If any of the AVS/CVC response riskFactors are marked as notMatched the payment will be sentForCancellation automatically.

See sequence diagrams to get a clear overview.

Payment response

The payment response contains the following details:

  • riskFactors (avs/cvc) - if billing address & cvc are provided, these details are checked against the customer's issuing bank
  • refusal code and description which gives additional context on the refusal
  • 3DS authentication details - details on the 3DS authentication outcome (e.g. challenged)
  • fraud assessment details - details on the fraud assessment outcome (e.g. lowRisk, review)
  • Worldpay token creation - details of the card tokenized and the token href itself
  • paymentInstrument - details of the paymentInstrument used