Skip to main content

Refund / Cancel

Process

API Information

Method: POST

URL: /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_idIntegerBaokim transaction code
4refund_reasonString(255)Reason for cancelling order
5refund_amountIntegerRefund 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
3dataObjectData returned

Data Information

No.Field NameData TypeRequiredDescription
1order_idString(25)Baokim order code
2mrc_order_idString(25)Merchant order code
3refund_amountIntegerRefund amount
4refund_feeIntegerRefund fee
5refund_timeDatetimeRefund time
6refund_charge_byIntegerWho bears the fee: 1 = Merchant, 2 = User
7statusIntegerRefund 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