Query Order
Flow
Description:
- Merchant calls this API to query detailed information of an order.
API Information
Method: POST
URL: /b2b/core/api/ext/order/get-order
Request
Main Parameters Table
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| request_id | String | ✅ | Request ID |
| request_time | Datetime | ✅ | Request time. Format: YYYY-MM-DD HH:mm:ss |
| merchant_code | String | ✅ | Merchant code provided by Baokim |
| mrc_order_id | String | ✅ | Merchant's order ID |
Request Example
{
"request_id": "7T53RI2IDS5JWAF",
"request_time": "2023-08-18 10:00:00",
"merchant_code": "MERCHANTCODE",
"mrc_order_id": "24121706176582"
}
Response
note
HTTP 200 - Success
Order Information (data.order)
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim order ID |
| mrc_order_id | String | ✅ | Merchant's order ID (NULL if payment from static VA) |
| total_amount | Integer | ✅ | Order amount |
| status | Integer | ✅ | Order status |
| completed_at | Datetime | ✅ | Success time |
| created_at | Datetime | ✅ | Creation time |
| updated_at | Datetime | ✅ | Last update time |
Order Status (status)
| Value | Status |
|---|---|
| 0 | Initiated |
| 1 | Successful |
| 2 | Rejected |
| 3 | Pending approval |
| 4 | Awaiting currency conversion |
| 5 | Processing |
| 6 | Awaiting prepayment |
| 7 | Expired |
| 8 | Refunding |
| 9 | Refunded |
Transaction Information (data.transaction - array)
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| id | Integer | ✅ | Baokim transaction ID |
| order_id | Integer | ✅ | Baokim order ID |
| mrc_order_id | String | ✅ | Merchant's order ID |
| type | Integer | ✅ | Transaction type: 1 = Payment, 2 = Refund |
| payment_method | Integer | ✅ | Payment method: 1 = VA, 2 = BNPL, 3 = Card, 4 = Installment, 5 = ATM, 6 = VNPayQR |
| merchant_fee | Integer | ✅ | Merchant fee |
| user_fee | Integer | ✅ | User fee |
| promotion_amount | Integer | ✅ | Promotion amount |
| total_amount | Integer | ✅ | Total transaction amount after fee |
| amount | Integer | ✅ | Amount affecting merchant balance |
| description | String | ✅ | Transaction description |
| status | Integer | ✅ | Status: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending |
| period | Integer | ❌ | Period |
| completed_at | Datetime | ✅ | Success time |
| created_at | Datetime | ✅ | Creation time |
| updated_at | Datetime | ✅ | Last update time |
Response Example
{
"code": 0,
"message": [],
"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": "Thanh toan don hang",
"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 |
| 109 | Order not found |