Skip to main content
POST
/
s2s
/
payments
/
{payment_id}
/
cancel
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/s2s/payments/{payment_id}/cancel \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "reason": "Customer requested cancellation"
}'
{
  "payment_id": "pay_8Ks3Jq1tZxPjYVhRQW2r5",
  "status": "CANCELLED",
  "receiptId": "receipt_abc123",
  "channel": "web",
  "cancelled_at": 1728128280000
}
Cancels a pending payment.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

payment_id
string
required

Unique payment identifier

Body

application/json

Cancel Payment Request

reason
string

Reason for cancellation

Example:

"Customer requested cancellation"

Response

Payment cancelled successfully

payment_id
string
Example:

"pay_8Ks3Jq1tZxPjYVhRQW2r5"

status
enum<string>
Available options:
CANCELLED
Example:

"CANCELLED"

receiptId
string
Example:

"receipt_abc123"

channel
string
Example:

"web"

cancelled_at
integer

Epoch timestamp in milliseconds of when payment was cancelled

Example:

1728128280000