Refund Transaction
Process
Merchant calls the refund/cancel API when customer requests return, service cancellation, etc.
Caution
If the refund transaction API response returns error code 116 (original transaction was paid from e-wallet), please call this API again with bank account information to receive the refund.
API Information
Method: POST
URL: /b2b/core/api/ext/mm/refund/send
Request
(Parameters sent by merchant)
Main Parameters
| No | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique request ID from merchant to Baokim |
| 2 | request_time | String(20) | ✅ | Request time. Format: YYYY-MM-DD H:i:s |
| 3 | master_merchant_code | String(50) | ✅ | Unique identifier for master merchant |
| 4 | sub_merchant_code | String(50) | ✅ | Unique identifier for sub merchant |
| 5 | mrc_order_id | Integer | ✅ | Merchant order ID |
| 6 | amount | Number | ❌ | Refund amount (for partial refund) |
| 7 | description | Text | ❌ | Reason for refund |
| 8 | account_no | String | ❌ | Account number to receive refund |
| 9 | bank_no | String | ❌ | Bank code to receive refund |
Request Example
{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"order_code": "VLAD_1753867524",
"order_id": 1870436,
"refund_amount": null,
"reason": "Customer requests return"
}
Response
(Parameters returned by Baokim to merchant)
Main Parameters
| No | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number(3) | ✅ | Baokim error code |
| 2 | message | String(200) | ✅ | Baokim error message |
| 3 | data | Object | ✅ | Data returned by Baokim |
Data Information
| No | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | id | Integer | ✅ | Baokim refund transaction ID |
| 2 | order_id | Integer | ✅ | Baokim order ID |
| 3 | sub_merchant_fee | Integer | ✅ | Sub merchant fee |
| 4 | master_merchant_fee | Integer | ✅ | Master merchant fee |
| 5 | master_merchant_model | Integer | ✅ | Master merchant model |
| 6 | user_fee | Integer | ✅ | User fee |
| 7 | total_amount | Integer | ✅ | Total amount user receives |
| 8 | amount | Integer | ✅ | Amount merchant receives |
| 9 | description | String | ✅ | Transaction content |
| 10 | status | Integer | ✅ | Transaction status |
| 11 | completed_at | Datetime | ✅ | Transaction completion time |
| 12 | created_at | Datetime | ✅ | Transaction creation time |
| 13 | updated_at | Datetime | ✅ | Transaction update time |
Response Example
{
"code": 0,
"message": "Success",
"data": {
"id": 5567261,
"order_id": 1870436,
"sub_merchant_fee": 2200,
"master_merchant_fee": 1100,
"master_merchant_model": 1,
"user_fee": 0,
"total_amount": 200000,
"amount": 200000,
"description": "Refund transaction",
"status": 1,
"completed_at": "2020-08-11 14:41:00",
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
}
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 103 | Signature authentication error |
| 104 | JWT authentication error |
| 422 | Invalid data |
| 710 | Sub merchant does not exist |
| 711 | Master merchant does not exist |
| 712 | Sub merchant is inactive |
| 713 | Master merchant is inactive |