Last Updated: 19 March 2024 | Change Log

The Payments API is for preview only and will be released soon.

Card payment & store a card

Provide the card details in an API request or use our Checkout SDK for low PCI hosted card fields. Save those card details for a future transaction.

Main objects for this scenario:

  • customerAgreement - used to indicate the customer has agreed to storing their card for the purpose of future customer initiated transactions
    • type = cardOnFile
    • storedCardUsage = first
  • tokenCreation - include if you're storing the card as a Worldpay Token

"type": "cardOnFile", "storedCardUsage":"first"

Important: You must have agreement from your customer to store their card details.

  1. API only
  2. Checkout SDK

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

Request

  1. Card Plain
  2. Recommended Key-values
{
    "transactionReference": "Memory265-13/08/1876",
    "merchant": {
        "entity": "default"
    },
    "instruction": {
        "tokenCreation": {
            "type": "WorldPay"
        },
        "customerAgreement": {
            "type": "cardOnFile",
            "storedCardUsage":"first"
        },
        "method": "card",
        "paymentInstrument": {
            "type": "plain",
            "cardNumber": "4000000000001091",
                "expiryDate": {
                "month": 5,
                "year": 2035
            }
        },
        "narrative": {
            "line1": "trading name"
        },
        "value": {
            "currency": "GBP",
            "amount": 42
        }
    }
}

Enable additional features

Fraud assessmentPrevent fraudulent transactions.
3DS authenticationShift Liability to the issuer / for EEA countries this is required as part of SCA compliance.
Auto SettlementRequest that payment authorizations are automatically sent for settlement (sometimes referred to as "capture").
Set instruction.settlement.auto to true in the payments request.

Response

For responses see the API reference.