Checking access…

Skip to main content
Version: v2
Audience: Consumers, CCG Platform Engineers

Cancel a Payment

When to use this page

Cancel a payment that is still eligible for cancellation. For a completed payment, use a refund flow instead. See Payment Lifecycle for the eligible states.

Cancellation is a server-side Payments API operation. It can stop an eligible payment created through the widget or directly through the Payments API.

Before you start​

  • Have the paymentId and a merchant-scoped access token. Check the current status with Get Payment.
  • Confirm that the status is eligible: the Payment Lifecycle lists PENDING, AUTHORIZED, and ACCEPTED cases. A COMPLETED payment requires a refund instead.
  • Choose a paymentCancellationReason: DUPLICATE, FRAUDULENT, REQUESTED_BY_CUSTOMER, or ABANDONED.

Cancel the payment​

1. Send the cancellation request​

Call PATCH /v2/payments/{paymentId}/cancel from your backend. The JSON body requires paymentCancellationReason; paymentCancellationMessage is optional.

Cancellation request
PATCH /v2/payments/{paymentId}/cancel
Authorization: Bearer <merchant-token>
X-Merchant-Id: <merchant-id>
X-Upstream-Env: <environment>
Content-Type: application/json

{
"paymentCancellationReason": "REQUESTED_BY_CUSTOMER",
"paymentCancellationMessage": "Customer requested cancellation"
}

For the complete header and body contract, see the Cancel Payment API reference.

2. Check the final status​

The API returns 202 Accepted while cancellation is being processed. Track the payment through Get Payment or payment webhooks. CANCEL_INITIALIZED is in progress; verify the final CANCELED or FAILED status before treating the cancellation as finished.

If the request is rejected, check the response against the Cancel Payment API reference and Payment Error Codes. Recheck the payment status before deciding whether to retry or use a refund.