Skip to main content

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 NameData TypeRequiredDescription
request_idString✅Request ID
request_timeDatetime✅Request time. Format: YYYY-MM-DD HH:mm:ss
merchant_codeString✅Merchant code provided by Baokim
mrc_order_idString✅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

Main Parameters Table​

Field NameData TypeRequiredDescription
codeNumber(3)✅Baokim error code
messageString(200)✅Error code message
dataObject✅Data returned by Baokim

Order Information (data.order)​

Field NameData TypeRequiredDescription
idInteger✅Baokim order ID
mrc_order_idString✅Merchant's order ID (NULL if payment from static VA)
total_amountInteger✅Order amount
statusInteger✅Order status
completed_atDatetime✅Success time
created_atDatetime✅Creation time
updated_atDatetime✅Last update time

Order Status (status)​

ValueStatus
0Initiated
1Successful
2Rejected
3Pending approval
4Awaiting currency conversion
5Processing
6Awaiting prepayment
7Expired
8Refunding
9Refunded

Transaction Information (data.transaction - array)​

Field NameData TypeRequiredDescription
idInteger✅Baokim transaction ID
order_idInteger✅Baokim order ID
mrc_order_idString✅Merchant's order ID
typeInteger✅Transaction type: 1 = Payment, 2 = Refund
payment_methodInteger✅Payment method: 1 = VA, 2 = BNPL, 3 = Card, 4 = Installment, 5 = ATM, 6 = VNPayQR
merchant_feeInteger✅Merchant fee
user_feeInteger✅User fee
promotion_amountInteger✅Promotion amount
total_amountInteger✅Total transaction amount after fee
amountInteger✅Amount affecting merchant balance
descriptionString✅Transaction description
statusInteger✅Status: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending
periodInteger❌Period
completed_atDatetime✅Success time
created_atDatetime✅Creation time
updated_atDatetime✅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 CodeDescription
102Provider error
104Authentication error
105Invalid digital signature
109Order not found