Cancellation
You can cancel a payment intent only if the order has not yet reached a final state. Once a payment intent is cancelled, the order is closed and the customer will no longer be able to complete the payment.
Cancellation Service Information
Item | Details |
---|---|
Cancellation eligibility | Payment Intents can be cancelled only when they have not yet reached a final state. For the complete list of PI statuses, please refer to the PaymentIntent Status Reference |
Cancelable amount | The payment can be cancelled only in the full amount. |
How to Cancel a Payment
Cancel Payment via API
The following sample shows the request and response when you call the Cancel a PaymentIntent endpoint.
Sample Request
curl --location 'https://api-sandbox.uqpaytech.com/api/v2/payment_intents/PI1961262700944166912/cancel' \
--header 'x-on-behalf-of;' \
--header 'x-idempotency-key: f20232c9-82b7-4ce5-a351-6718fc61a3d5' \
--header 'x-client-id: xcH5neaVpPAuN4yLfgCjGh' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-auth-token: Bearer your_bearer_token' \
--data '{
"cancellation_reason": "requested_by_customer"
}'
Sample Response
{
"amount": "0.01",
"available_payment_method_types": null,
"cancel_time": "",
"cancellation_reason": "requested_by_customer",
"captured_amount": "0.01",
"client_secret": "eyJhb****XTg",
"complete_time": "",
"create_time": "2025-08-29T11:00:41+08:00",
"currency": "SGD",
"description": "wechat pay test",
"intent_status": "REQUIRES_CUSTOMER_ACTION",
"latest_payment_attempt": {
"amount": "0.01",
"attempt_id": "PA1961262701099356160",
"attempt_status": "AUTHENTICATION_REDIRECTED",
"captured_amount": "0.01",
"complete_time": "",
"create_time": "2025-08-29T11:00:41+08:00",
"currency": "SGD",
"failure_code": "",
"refunded_amount": "0",
"update_time": "2025-08-29T11:00:41+08:00"
},
"merchant_order_id": "04007403-a2f6-4531-97df-cdc8102f6713",
"metadata": {
"request_id": "b4fc2aea-5300-4ab8-bf48-4c0aa16cb5b7"
},
"next_action": {
"display_qr_code": {
"expires_at": "2025-08-29T11:30:41.061+08:00",
"qr_code": "weixin://wxpay/bizpayurl?pr=1gEb7g3z1",
"qr_code_url": "https://sg-acquiring-bucket-sandbox.s3.ap-southeast-1.amazonaws.com/payment/20250829/qrcode_PA1961262701099356160?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=ASIAY******f987429"
}
},
"payment_intent_id": "PI1961262700944166912",
"return_url": "https://paymentresultpage.com",
"update_time": "2025-08-29T11:01:32+08:00"
}
You can determine whether the cancellation has been successfully processed either by listening to the acquiring.cancel.succeeded
webhook, or by actively querying the payment intent status via the Retrieve a payment intent API.
Cancel Payment via Dashboard
In Dashboard, click the action button next to the order and select Cancel

Updated 3 days ago