Skip to main content
Version: 1.0.0

Token payments

caution

Whilst we do have an API to collect and tokenise card details, this requires PCI DSS certification. Please utilise our Hosted Payment Page to collect payment details for tokenisation. Contact us for more information if you do have PCI DSS certification.

info

This guide relies on information presented in Hosted Payment.

Overview​

You can take card, PayTo, and bank payments by API call. Use our Hosted Payment Page for secure tokenisation, then charge the token with our /v2/payments and /v2/proxies API endpoints.

Tokenisation​

See Hosted Payment for how to implement the Hosted Payment Page and for details about tokenisation.

  • Load the Hosted Payment Page using mode: 1.

  • When the payer enters their payment details, a payload (callback and/or webhook) is returned with a token.

  • You can store this token in a secure database against a customer or other identifiable entity, or use it immediately.

Check token status and pricing​

  • To check token status or get fee pricing (to display any fees that are passed on to the payer), use the /v2/proxies API.

  • You can also use the API to check PayTo mandate status. See the PayTo Guide for more details.

Example response

GET /v2/proxies/{token}

{
"accountType": "Card",
"cardHolderName": "Test Card",
"cardNumber": "555555XXXXXX4444",
"cardExpiry": "1230",
"cardType": "MasterCard"
}
  • To get the fees for a token and a given amount, see the example below.

Example response

GET /v2/proxies/{token}/pricing?paymentAmount=384.26

{
"pricing": {
"customerFee": 38.43,
"merchantFee": 0,
"processingAmount": 422.69,
"paymentAmount": 384.26
}
}

Make payments​

Once you have the token, charge it using the /v2/payments API.

caution

customerEmail, customerName, and merchantUniquePaymentId are listed as optional for POST /v2/payments. Treat all three as required to avoid payment issues in the future.

info

Whilst both will work for card tokens, we strongly recommend using paymentAccountProxy instead of cardProxy to pass tokens via API to cover bank and PayTo tokens as well.

  • Pass the payment token using paymentAccountProxy, along with customer details and payment amount, as a POST to /v2/payments.

Example response

POST /v2/payments

{
"paymentReference": "101994",
"customerName": "Bolvar Fordragon",
"customerReference": "CR-MKV4IG3D-JJM",
"paymentStatus": "Successful",
"baseAmount": 53.24,
"fundsToMerchant": 53.24,
"customerFee": 5.32,
"merchantFee": 0,
"paymentAmount": 58.56,
"accountOrCardNo": "555555XXXXXX4444",
"paymentAccount": "Card",
"processingDate": "2026-01-26T23:08:10.6705202",
"settlementDate": "2026-01-28T00:00:00",
"processorReference": "fdf7281d280072bc4aa3",
"isPaymentSettledToMerchant": false,
"paymentCard": "MasterCard",
"additionalReference": "API Example Test",
"merchantName": "Menethil",
"merchantCode": "1337",
"merchantUniquePaymentId": "PAY-1769429288200",
"isPaymentRetryScheduled": false,
"isPaymentRecalled": false,
"isPaymentRefunded": false,
"transactionType": 1,
"transactionTypeDisplay": "Charge",
"isPaymentChargeBacked": false,
"paymentSourceDisplay": "Api Tokenised Payment",
"customerCode": "TR16553015"
}
  • For more information on the paymentStatus codes, see our Status Codes.

  • For more information on collecting payment information from API OR Hosted Payment Page payments, see our Reconciliation Guide.

  • For more information on charging a CML linked Customer entity (an entity that has a customer account with Zenith payments), see Linked Customers.