Skip to main content

Refund Order

Process​

Description:

  • Merchant calls the API to refund an order.
  • If Baokim returns error code 116 (Original transaction paid from E-wallet), please call the API again with bank account information to receive the refund.

API Information​

Method: POST

URL: /b2b/core/api/ext/mm/refund/send

Request​

Main Parameters Table​

ParameterTypeRequiredDescriptionExample
request_idString✅Request IDRQID0001
request_timeInteger✅Request time2023-08-18T10:00:00.000Z
master_merchant_codeString (max 50)✅Master merchant code provided by BaokimBAOKIMMASTERMERCHANT
sub_merchant_codeString (max 50)✅Sub merchant code provided by BaokimBAOKIMSUBMERCHANT
mrc_order_idString✅Order ID to refundBK_24121706176582
descriptionString✅Refund content
amountInteger❌Amount to refund if partial refund10000
account_noString❌Bank account to receive refund (when error code = 116)1903000000000018
bank_noString (max 6)❌Bank code to receive refund (when error code = 116)970407
installmentObject❌Installment cancellation informationnull

Installment Information​

ParameterTypeDescription
only_cancel_installmentInteger0-Cancel all / 1-Cancel installment only

Request Example​

{
"request_id": "RQID0001",
"request_time": "2023-08-18T10:00:00.000Z",
"master_merchant_code": "BAOKIMMASTERMERCHANT",
"sub_merchant_code": "BAOKIMSUBMERCHANT",
"mrc_order_id": "BK_24121706176582",
"description": null,
"amount": 10000,
"account_no": 1903000000000018,
"bank_no": 970407,
"installment": null
}

Response​

Main Parameters Table​

ParameterTypeRequiredDescription
codeInteger✅
messageString❌
dataObject✅

Order Information (data.order)​

ParameterTypeRequiredDescription
idInteger✅Baokim order ID
mrc_order_idString✅Merchant's order ID
total_amountInteger✅Order amount
payment_methodInteger✅Payment method
statusInteger✅Order status (see table below)
completed_atDateTime✅Success time
created_atDateTime✅Creation time
updated_atDateTime✅Last update time

Order Status (data.order.status)​

ValueStatus
0Initialized
1Success
2Rejected
3Pending approval
4Waiting for installment conversion
5Processing
6Waiting for down payment
7Expired
8Refunding
9Refunded

Transaction Information (data.transactions)​

ParameterTypeRequiredDescription
idInteger✅Baokim transaction ID
typeInteger✅Transaction type: 1-Payment, 2-Refund
payment_methodInteger✅Payment method
sub_merchant_feeInteger✅Sub merchant fee charged
master_merchant_feeInteger✅Master merchant fee charged
master_merchant_modelInteger✅Master merchant model
user_feeInteger✅User fee charged
total_amountInteger✅Total customer payment after fees
amountInteger✅Amount changing sub merchant balance
descriptionString✅Transaction content
statusInteger✅Status: 0-Initialized, 1-Success, 2-Failed, 3-Pending
bnplObject❌BNPL information (if any)
installmentObject❌Installment information (if any)
completed_atDateTime✅Success time
created_atDateTime✅Creation time
updated_atDateTime✅Last update time

BNPL Information (data.transactions.bnpl)​

ParameterTypeRequiredDescription
payment_per_monthInteger❌
paylater_amountInteger❌
down_paymentInteger❌
providerInteger❌

Installment Information (data.transactions.installment)​

ParameterTypeRequiredDescription
card_brandInteger❌
periodInteger❌
payment_per_periodInteger❌
bank_codeInteger❌

Response Example​

{
"code": 100,
"message": "Success",
"data": {
"order": {
"id": 4412312,
"mrc_order_id": "BK_021_ANC",
"total_amount": 10000,
"payment_method": 1,
"status": 9,
"completed_at": "2023-08-02 08:15:30",
"created_at": "2023-08-02 08:13:30",
"updated_at": "2023-08-02 08:15:30"
},
"transactions": [
{
"id": 112344,
"type": 2,
"payment_method": 1,
"sub_merchant_fee": 0,
"master_merchant_fee": 0,
"master_merchant_model": 1,
"user_fee": 0,
"total_amount": 10000,
"amount": 10000,
"description": "Refund for order",
"status": 1,
"bnpl": null,
"installment": null,
"completed_at": "2023-08-02 08:20:30",
"created_at": "2023-08-02 08:20:00",
"updated_at": "2023-08-02 08:20:30"
}
]
}
}