Skip to main content

Refund Order

Flow​

Description:

  • Merchant calls the order refund API.
  • If Baokim returns error code 116 (original transaction was paid from electronic wallet), please call this API again with the bank account information to receive the refund.

API Information​

Method: POST

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

Request​

Main Parameters Table​

Field NameData TypeRequiredDescription
request_idString✅Request ID
request_timeDatetime✅Request time. Format: YYYY-MM-DD H:m:s
merchant_codeString✅Merchant code provided by Baokim
mrc_order_idString✅Merchant's order ID
descriptionString✅Refund content
amountInteger❌Amount to refund if partial refund
account_noString❌Bank account to receive refund (when error code = 116)
bank_noString(6)❌Bank code to receive refund (when error code = 116)
installmentObject❌Installment cancellation information

Installment Information​

Field NameData TypeRequiredDescription
only_cancel_installmentInteger✅0 = Cancel full, 1 = Cancel conversion

Request Example​

{
"request_id": "RQID0001",
"request_time": "2023-08-18 10:00:00",
"merchant_code": "MERCHANTCODE",
"mrc_order_id": "BK_24121706176582",
"description": null,
"amount": 10000,
"account_no": 1903000000000018,
"bank_no": 970407,
"installment": null
}

Response​

note

HTTP 200 - Success

Main Parameters Table​

Field NameData TypeRequiredDescription
codeInteger✅Result code
messageString✅Message
data.orderObject✅Order information
data.transactionObject✅Refund transaction information

Order Information (data.order)​

Field NameData TypeRequiredDescription
idInteger✅Baokim order ID
mrc_order_idString✅Merchant's order ID
total_amountInteger✅Order amount
statusInteger✅Order status (0–9)
completed_atDatetime✅Success time
created_atDatetime✅Creation time
updated_atDatetime✅Last update time

Transaction Information (data.transaction)​

Field NameData TypeRequiredDescription
idInteger✅Baokim transaction ID
order_idInteger✅Baokim order ID
mrc_order_idString(50)✅Merchant's order ID
typeInteger✅Transaction type
payment_methodInteger✅Payment method
merchant_feeInteger✅Merchant fee
user_feeInteger✅User fee
promotion_amountInteger✅Promotion amount
total_amountInteger✅Total transaction amount (amount + user_fee)
amountInteger✅Order amount
descriptionString(255)✅Transaction description
statusInteger✅Status: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending
periodInteger❌Period (null if not applicable)
completed_atDatetime✅Completion time
created_atDatetime✅Creation time
updated_atDatetime✅Last update time

Response Example​

{
"code": 200,
"message": "Success",
"data": {
"order": {
"id": 4412312,
"mrc_order_id": "BK_021_ANC",
"total_amount": 10000,
"status": 1,
"completed_at": "2023-08-02 08:15:30",
"created_at": "2023-08-02 08:13:30",
"updated_at": "2023-08-02 08:15:30"
},
"transaction": [
{
"id": 112344,
"order_id": 4412312,
"mrc_order_id": "BK_021_ANC",
"type": 1,
"payment_method": 1,
"merchant_fee": 0,
"user_fee": 1000,
"promotion_amount": 0,
"total_amount": 11000,
"amount": 10000,
"description": "Payment for order",
"status": 1,
"period": null,
"completed_at": "2023-08-02 08:15:30",
"created_at": "2023-08-02 08:13:30",
"updated_at": "2023-08-02 08:15:30"
}
]
}
}

Error Codes​

Error CodeDescription
102Provider error
104Authentication error
105Invalid digital signature
106Insufficient amount
107Order cannot be refunded
109Order not found