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_idStringRequest ID
request_timeDatetimeRequest time. Format: YYYY-MM-DD HH:mm:ss
merchant_codeStringMerchant code provided by Baokim
mrc_order_idStringMerchant'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 NameData TypeRequiredDescription
idIntegerBaokim order ID
mrc_order_idStringMerchant's order ID (NULL if payment from static VA)
total_amountIntegerOrder amount
statusIntegerOrder status
completed_atDatetimeSuccess time
created_atDatetimeCreation time
updated_atDatetimeLast 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
idIntegerBaokim transaction ID
order_idIntegerBaokim order ID
mrc_order_idStringMerchant's order ID
typeIntegerTransaction type: 1 = Payment, 2 = Refund
payment_methodIntegerPayment method: 1 = VA, 2 = BNPL, 3 = Card, 4 = Installment, 5 = ATM, 6 = VNPayQR
merchant_feeIntegerMerchant fee
user_feeIntegerUser fee
promotion_amountIntegerPromotion amount
total_amountIntegerTotal transaction amount after fee
amountIntegerAmount affecting merchant balance
descriptionStringTransaction description
statusIntegerStatus: 0 = Initiated, 1 = Successful, 2 = Failed, 3 = Pending
periodIntegerPeriod
completed_atDatetimeSuccess time
created_atDatetimeCreation time
updated_atDatetimeLast 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