Skip to main content

Reversal Transaction

Process

Description:

  • Merchant calls the Reversal API to cancel transactions that have been Authorized but not yet Captured.
  • Releases the held amount for the customer.
  • Cannot reverse transactions that have already been Captured — use Refund/Void instead.

API Information

Method: POST

Request — Parameters sent by merchant

Main Parameters Table

No.Field NameData TypeRequiredDescription
1request_idString(100)Unique request ID from Merchant to Baokim
2request_timeString(20)Request send time. Format: YYYY-MM-DD H:i:s
3merchant_codeString(50)Unique merchant identifier
4order_codeString(50)Baokim order code returned from the Authentication step
5reasonString(255)Reason for cancellation
6extendObjectExtended data

Example Request

{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2020-08-11 14:41:00",
"merchant_code": "MERCHANT",
"order_code": "VLAD_1753867524",
"reason": "yêu cầu hủy đơn trả góp",
"extend": {
"billing": {
"firstname": "A",
"lastname": "NGUYEN VAN",
"address": "313 Truong Chinh, Dong Da",
"city": "HANOI",
"state": null,
"country": "VN",
"email": "[email protected]",
"phone": "0394899999",
"postal_code": "100000"
}
}
}

Response

(Parameters returned by Baokim)

Main Parameters Table

No.Field NameData TypeRequiredDescription
1codeNumber(3)Baokim error code
2messageString(200)Error message
3dataObjectData returned

Data Information

No.Field NameData TypeRequiredDescription
1order_codeNumberBaokim order code
2reversal_statusNumberStatus: 0-Reversal Pending / 1-Reversed / 2-Fail
3statusNumberOverall order status of Baokim
4extendObjectExtended data

Example Response

{
"code": 0,
"message": "Success",
"data": {
"order_code": "VLAD_1753867524",
"reversal_status": 1,
"status": 1,
"extend": {}
}
}

Error Code

Error CodeDescription
100Success
11Failed
101Baokim system error
104OAuth authentication error
105Signature authentication error
301Order not found by order_code
302Card issue (does not exist, expired)
303Card declined
304Insufficient card balance
305User cancelled transaction
306Incorrect OTP
308Transaction has not completed Authentication
309Transaction has not completed Authorization
310Transaction already reversed, cannot capture
311Transaction already captured, cannot reverse
313Bank-side processing error
422Validation error: RequestId invalid
422Validation error: RequestTime invalid
422Validation error: PartnerCode invalid
422Card_data invalid
422Amount invalid