This page shows how to perform cancel payments using xpresspay's APIs
This endpoint /v1/payments/cancel
is called when a transaction is to be cancelled. See how to do that below.
Live https://api.xpresspayonline.com/v1/payments/cancel
Sandbox https://xpresspayonlineapisandbox.xpresspayments.com/v1/payments/cancel
Sample Request:
curl --request POST \
--url https://api.xpresspayonline.com:8689/v1/payments \
--data '{"publicKey": "XPPUBK-ead4d14d9ded04aer5d5b63a0a06d2f-X","transactionId": "926730286022674"}'
JSON
{
"publicKey": "XPPUBK-ead4d14d9ded04aer5d5b63a0a06d2f-X",
"transactionId": "926730286022674"
}
-
publicKey
: This is your merchant public key. -
transactionId
: This is the unique reference generated by merchant.
When you cancel a payment you would get a response that looks like response below:
{
"data": {
"payment": {
"paymentResponseCode": "11",
"paymentStatusMessage": "Transaction Cancelled",
"transactionId": "926730286022674"
}
}
}