Skip to main content
This page explains how to use the Reversal API to void a transaction. Please note that the behavior of a reversal depends entirely on the payment method (QR Code vs. Credit Card):
  1. QR Code payment flows: Can only void transactions that have not yet been successfully completed. If the original transaction has already succeeded (respcd=0000), you must use the Refund API instead.
  2. Credit Card / Apple Pay flows: Used to void an authorised card transaction. This cancels the transaction directly.
For QR code payments like Alipay and WeChat Pay, a reversal is not a refund. It can only be initiated if the original transaction has not been completed successfully.

Supported Scenarios

The /trade/v1/reversal API currently supports the following payment scenarios. Review the specific behavior below based on your integration type.

1. QR Code Payment Scenarios (Incomplete Transactions Only)

Typically used when a merchant has created an order but the consumer has not completed payment (e.g., consumer scanned the QR code but abandoned the payment, or a consumer-presented code is pending password confirmation).
  • Alipay MPM (Merchant Presented Mode)
    • 800101:Alipay Merchant Presented QR Code Payment in store (MPM) (Overseas Merchants)
    • 801501:Alipay Merchant Presented QR Code (MPM) Payment (HK Merchants)
  • WeChat Pay MPM (Merchant Presented Mode)
    • 800201:WeChat Merchant Presented QR Code Payment (MPM) (Overseas & HK Merchants)
  • Alipay CPM (Consumer Presented Mode)
    • 800108:Alipay Consumer Presented QR Code Payment (CPM) (Overseas & HK Merchants)

2. Online Credit Card / Apple Pay Scenarios (Authorised Transactions)

  • Online Credit Card Payments
    • 802801: Visa/Mastercard
  • Apple Pay
    • 806527: Apple Pay
  • Behavior Description: In these card-based scenarios, executing a reversal acts as a Void on the authorised transaction, canceling the authorisation in real time.
For cancellations involving other wallets, please refer to the Close API or contact QFPay Support for integration guidance.

API Endpoint

  • Endpoint: /trade/v1/reversal
  • Method: POST
A successful reversal will return respcd=0000. For QR code flows, if the transaction has already completed successfully (respcd=0000 in the payment response), it cannot be reversed. Instead, refer to the Refund API.

Request Parameters

*Either syssn or out_trade_no must be provided.

Response Parameters


Code Examples


Sample Response

JSON

Additional Notes

  • A reversal does not guarantee that the user has not been charged. Always verify using Transaction Enquiry.
  • Reversal for QR Code payment is intended for real-time failures only. Do not use it to refund successful transactions.
  • If respcd=1143 or 1145, the reversal is in progress. You should poll the Transaction Enquiry endpoint until the status is confirmed.

The above command returns JSON structured like this:
JSON

Reversal vs Close

Some wallets (e.g. WeChat Pay MPM) support the /trade/v1/close endpoint instead of reversal.

Supported payment flows and PayTypes

WeChat Pay CPM (Consumer Presented Mode)
  • 800008:Consumer Present QR Code Mode (CPM) for WeChat
  • 800208:WeChat Consumer Presented QR Code Payment (CPM) (Overseas & HK Merchants)
  • 801008:WeChat Pay HK Consumer Presented QR Code Payment (CPM) (Direct Settlement, HK Merchants)
Method : GET *If you would like to use this endpoint on a wallet other than Alipay & Wechat Pay please contact us for instructions.

Request Parameters

*Either the syssn or out_trade_no must be provided.

Response Parameters