Alipay+ DocsAlipay+ Docs

Cancel a payment

The Acquiring Service Provider can call the cancelPayment interface to cancel a payment in one of the following scenarios:

  • The merchant/Acquiring Service Provider cannot receive the payment result from Alipay+ for a long time, or cannot obtain the payment result via the inquiryPayment interface.
  • The transaction is not completed after exceeding the maximum number of inquiries.

The payment can be canceled within the agreed cancellable period, which is from the time when the transaction is initiated to 00:15 UTC+8 of T+1 day, regardless of the payment status.

The following figure illustrates the flow of payment cancellation initiated by the Acquiring Service Provider:


Figure 1. Payment cancellation flow initiated by the Acquiring Service Provider

The payment cancellation initiated by the Acquiring Service Provider contains the following steps:

  1. The Acquiring Service Provider submits the cancellation request to Alipay+ (step 1).
  2. Alipay+ returns the cancellation result to the Acquiring Service Provider (step 1.1).

Processing logic

  • The cancelPayment request only works on the payment, and cannot be used on refund.
  • Before canceling the transaction, it is recommended that you use the inquiryPayment interface to inquire the payment result at least once. For more information about inquiryPayment, see inquiryPayment.
  • After you request a cancelation, you cannot change the order status to status other than canceled. If payment notification comes later than the cancellation response, the Acquiring Service Provider handles the payment result based on the cancellation response. If the cancellation fails, you need to retry the cancelPayment request until the cancellation succeeds.
  • You might receive different results from Alipay+, follow instructions below to handle the result:



Cancellation status

Further Actions



Cancellation succeeds

The merchant can reinitiate a payment request.



Cancellation fails

Take actions according to the error message in result.resultCode.

Note: If the result.resultCode value returns as

CANCEL_WINDOW_EXCEED, call the refund interface.




Use the same parameter to retry the cancelPayment request.

  • In the first 60 seconds, you can retry the request with an interval of 5 to 10 seconds.
  • After 60 seconds, you can retry the request at least 10 times, with an interval of 5 minutes.
  • If keep receiving the result that indicates the status is U, contact

No result received after trying several times




Sample request:


Sample response:

 "acquirerId": "1111088000000000002",
 "result": {

For more information about how to use the cancelPayment interface (such as the field description), see cancelPayment.