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
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| request_id | String | ✅ | Request ID | RQID0001 |
| request_time | Integer | ✅ | Request time | 2023-08-18T10:00:00.000Z |
| master_merchant_code | String (max 50) | ✅ | Master merchant code provided by Baokim | BAOKIMMASTERMERCHANT |
| sub_merchant_code | String (max 50) | ✅ | Sub merchant code provided by Baokim | BAOKIMSUBMERCHANT |
| mrc_order_id | String | ✅ | Order ID to refund | BK_24121706176582 |
| description | String | ✅ | Refund content | |
| amount | Integer | ❌ | Amount to refund if partial refund | 10000 |
| account_no | String | ❌ | Bank account to receive refund (when error code = 116) | 1903000000000018 |
| bank_no | String (max 6) | ❌ | Bank code to receive refund (when error code = 116) | 970407 |
| installment | Object | ❌ | Installment cancellation information | null |
Installment Information
| Parameter | Type | Description |
|---|---|---|
| only_cancel_installment | Integer | 0-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
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | Integer | ✅ | |
| message | String | ❌ | |
| data | Object | ✅ |
Order Information (data.order)
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim order ID |
| mrc_order_id | String | ✅ | Merchant's order ID |
| total_amount | Integer | ✅ | Order amount |
| payment_method | Integer | ✅ | Payment method |
| status | Integer | ✅ | Order status (see table below) |
| completed_at | DateTime | ✅ | Success time |
| created_at | DateTime | ✅ | Creation time |
| updated_at | DateTime | ✅ | Last update time |
Order Status (data.order.status)
| Value | Status |
|---|---|
| 0 | Initialized |
| 1 | Success |
| 2 | Rejected |
| 3 | Pending approval |
| 4 | Waiting for installment conversion |
| 5 | Processing |
| 6 | Waiting for down payment |
| 7 | Expired |
| 8 | Refunding |
| 9 | Refunded |
Transaction Information (data.transactions)
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim transaction ID |
| type | Integer | ✅ | Transaction type: 1-Payment, 2-Refund |
| payment_method | Integer | ✅ | Payment method |
| sub_merchant_fee | Integer | ✅ | Sub merchant fee charged |
| master_merchant_fee | Integer | ✅ | Master merchant fee charged |
| master_merchant_model | Integer | ✅ | Master merchant model |
| user_fee | Integer | ✅ | User fee charged |
| total_amount | Integer | ✅ | Total customer payment after fees |
| amount | Integer | ✅ | Amount changing sub merchant balance |
| description | String | ✅ | Transaction content |
| status | Integer | ✅ | Status: 0-Initialized, 1-Success, 2-Failed, 3-Pending |
| bnpl | Object | ❌ | BNPL information (if any) |
| installment | Object | ❌ | Installment information (if any) |
| completed_at | DateTime | ✅ | Success time |
| created_at | DateTime | ✅ | Creation time |
| updated_at | DateTime | ✅ | Last update time |
BNPL Information (data.transactions.bnpl)
| Parameter | Type | Required | Description |
|---|---|---|---|
| payment_per_month | Integer | ❌ | |
| paylater_amount | Integer | ❌ | |
| down_payment | Integer | ❌ | |
| provider | Integer | ❌ |
Installment Information (data.transactions.installment)
| Parameter | Type | Required | Description |
|---|---|---|---|
| card_brand | Integer | ❌ | |
| period | Integer | ❌ | |
| payment_per_period | Integer | ❌ | |
| bank_code | Integer | ❌ |