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 Name | Data Type | Required | Description |
|---|---|---|---|
| request_id | String | ✅ | Request ID |
| request_time | Datetime | ✅ | Request time. Format: YYYY-MM-DD H:m:s |
| merchant_code | String | ✅ | Merchant code provided by Baokim |
| mrc_order_id | String | ✅ | Merchant's order ID |
| description | String | ✅ | Refund content |
| amount | Integer | ❌ | Amount to refund if partial refund |
| account_no | String | ❌ | Bank account to receive refund (when error code = 116) |
| bank_no | String(6) | ❌ | Bank code to receive refund (when error code = 116) |
| installment | Object | ❌ | Installment cancellation information |
Installment Information
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| only_cancel_installment | Integer | ✅ | 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 Name | Data Type | Required | Description |
|---|---|---|---|
| code | Integer | ✅ | Result code |
| message | String | ✅ | Message |
| data.order | Object | ✅ | Order information |
| data.transaction | Object | ✅ | Refund transaction information |
Order Information (data.order)
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim order ID |
| mrc_order_id | String | ✅ | Merchant's order ID |
| total_amount | Integer | ✅ | Order amount |
| status | Integer | ✅ | Order status (0–9) |
| completed_at | Datetime | ✅ | Success time |
| created_at | Datetime | ✅ | Creation time |
| updated_at | Datetime | ✅ | Last update time |
Transaction Information (data.transaction)
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim transaction ID |
| order_id | Integer | ✅ | Baokim order ID |
| mrc_order_id | String(50) | ✅ | Merchant's order ID |
| type | Integer | ✅ | Transaction type |
| payment_method | Integer | ✅ | Payment method |
| merchant_fee | Integer | ✅ | Merchant fee |
| user_fee | Integer | ✅ | User fee |
| promotion_amount | Integer | ✅ | Promotion amount |
| total_amount | Integer | ✅ | Total transaction amount (amount + user_fee) |
| amount | Integer | ✅ | Order amount |
| description | String(255) | ✅ | Transaction description |
| status | Integer | ✅ | Status: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending |
| period | Integer | ❌ | Period (null if not applicable) |
| completed_at | Datetime | ✅ | Completion time |
| created_at | Datetime | ✅ | Creation time |
| updated_at | Datetime | ✅ | 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 Code | Description |
|---|---|
| 102 | Provider error |
| 104 | Authentication error |
| 105 | Invalid digital signature |
| 106 | Insufficient amount |
| 107 | Order cannot be refunded |
| 109 | Order not found |