Skip to main content

Cancel payment

Cancels payment by payment_details_id.

Endpoint​

POST /payments/cancel

Query Parameters​

  • version (string, required) - API contract version. Use exactly 2024-10-01.
  • diagnostics (boolean, optional) - Non-production docs only. Set true to include extra diagnostic metadata (for example observed_client_ip).

Header Parameters​

  • PW-subscription-key (string, required)
  • PW-origin-country (string, required)
  • PW-request-date (string, required) - UTC request timestamp formatted as YYYY-MM-DD HH:mm:ss.
  • PW-ip-address (string, required)
  • User-Agent (string, required)

Header Constraints​

KeyDescriptionExampleData typeRequirementField Length
PW-subscription-keyDeveloper key available after portal registration. Production key is shared on request.eed0d85c530c4b26a91d09b783d8fab3stringmandatory32
PW-origin-countryISO Alpha-2 country code where the transaction is created.TTstringmandatory2
PW-request-dateCurrent request timestamp. Format: YYYY-MM-DD HH:mm:ss (UTC).2014-10-08 16:01:31stringmandatory19
PW-ip-addressFixed institution IP used for PayWise network-level validation.255.255.255.255stringconditional8-16
User-AgentIn programmable environments, this avoids running into Cloudflare issues.Mozilla/5.0 (Windows NT 10.0; Win64; x64)stringmandatory255

Request Body​

Schema-defined JSON body (no concrete example provided).

Responses​

200 - Wrapper-normalized response envelope (success cases).​

Example: success​

{
"status": "success",
"code": 200,
"message": "Payment cancelled successfully",
"request_id": "45edfc0e-bf7d-4a30-bd40-22c40c10a235",
"timestamp": "2026-02-11T03:59:45.734Z",
"transaction_request": {
"id": "checkout_demo_20260326_0001",
"status": "cancelled"
},
"payment_details": {
"id": "paydet_demo_20260326_0001",
"status": "cancelled"
},
"observed_client_ip": {
"request_ip": "172.64.80.1",
"socket_remote_address": "172.64.80.1"
}
}

400 - Wrapper-normalized response envelope (400)​

Example: error​

{
"status": "error",
"code": 400,
"message": "payment_details_id is required",
"request_id": "f1297691-052b-485d-8474-045b40ea29f9",
"timestamp": "2026-02-11T03:59:45.739Z",
"observed_client_ip": {
"request_ip": "172.64.80.1",
"socket_remote_address": "172.64.80.1"
}
}

Notes​

This endpoint page is generated from openapi/pw-wrappers.2024-10-01.yaml.