Skip to main content

Refund / Cancel

Process​

API Information​

Method: POST

URL: /b2b/core/api/merchant-hosted/bank-transfer/refund

Request​

(Parameters sent by the partner)

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1request_idString(50)✅Unique request ID. Suggested format: MerchantCode+YYYYMMDDHHIISS+UniqueId
2request_timeString(19)✅Request sent time. Format: YYYY-MM-DD HH:II:SS
3order_idInteger✅Baokim transaction code
4refund_reasonString(255)✅Reason for cancelling order
5refund_amountInteger✅Refund amount (can be partial refund)
6merchant_codeString(30)✅Merchant code
7bank_codeString(30)❌Receiving bank code — used for wallet transfer or when recipient information is not found (error code 5)
8acc_noString(22)❌Receiving account number — used for wallet transfer or when recipient information is not found (error code 5)

Request Example​

{
"request_id": "BK20250717140001",
"request_time": "2025-07-17 14:00:00",
"order_id": 1141313,
"refund_amount": 500000,
"merchant_code": "PARTNER001",
"refund_reason": "Yêu cầu hủy"
}

Response​

(Parameters returned by Baokim)

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1codeInteger(3)✅Baokim error code
2messageString(200)✅Error code message
3dataObject✅Data returned

Data Information​

No.Field NameData TypeRequiredDescription
1order_idString(25)✅Baokim order code
2mrc_order_idString(25)✅Merchant order code
3refund_amountInteger✅Refund amount
4refund_feeInteger✅Refund fee
5refund_timeDatetime✅Refund time
6refund_charge_byInteger❌Who bears the fee: 1 = Merchant, 2 = User
7statusInteger✅Refund status: 1 = Success, 2 = Failure, 3 = Pending

Response Example​

{
"code": 0,
"message": "Success",
"data": {
"order_id": "BK20250717140001",
"mrc_order_id": "ORD123456789",
"refund_amount": 148000,
"refund_fee": 2000,
"refund_charge_by": 2,
"status": 1,
"refund_time": "2025-07-17 14:01:10"
}
}

Error Codes​

codemessage
100Success
101System error
102Provider error
104JWT authentication error
105Invalid digital signature
106Order amount is insufficient for refund
107Order cannot be refunded
108Order cannot be cancelled
109Order does not exist
110Merchant order code already exists
422Validation error