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. Consumer Presented QR Code Payments (Incomplete Transactions Only)

Use reversal for incomplete consumer-presented code (CPM) payments:
  • 800108: Alipay CPM
  • 800208: WeChat Pay CPM
  • 800708: UnionPay QuickPass CPM
For merchant-presented code payments that support closing an order, use the Close API.

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.

Payment-type support

A payment expiry setting does not imply support for reversal or close. See Payment Types for payment-channel descriptions.

Close API

  • Endpoint: /trade/v1/close
  • Method: POST
  • Supported payment types in the table above: 800201 (WeChat Pay MPM), 800212 (WeChat Pay H5), and 800701 (UnionPay QuickPass MPM).

Request Parameters

*Either the syssn or out_trade_no must be provided.

Response Parameters