Query Transaction
Process
- MERCHANT calls this API to query transaction information by order code in Baokim system. Baokim returns transaction details directly in the response.
- Current version supports querying dynamic QR transactions (one
mrc_order_idcorresponds to one transaction). Querying by static QR will be expanded in future versions. - Recommended use: when webhook transaction is not received, need to reconcile order status, or handle suspected TimeOut transactions.
API Information
Method: POST
URL: /b2b/core/api/ext/mm/qr/inquiry
Security: Bearer JWT (Authorization header)
Request
Main Parameters
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique ID for each Request from MERCHANT to Baokim |
| 2 | request_time | String(20) | ✅ | Request send 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 | String(50) | ✅ | Order code to query |
Request Example
{
"request_id": "MERCHANT050015588IQ001",
"request_time": "2026-06-11 09:00:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"mrc_order_id": "ORD_123456789"
}
Response
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 | mrc_order_id | String | ✅ | Queried order code |
| 2 | transaction | Object | ❌ | Transaction details. NULL if no transaction has occurred for this order |
| 3 | qr_info | Object | ❌ | NAPAS transaction information. NULL if no transaction has occurred for this order |
Transaction Information
Same structure as Webhook transaction notification — transaction Information.
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | id | Integer | ✅ | Baokim transaction code |
| 2 | order_id | Integer | ✅ | Baokim order code |
| 3 | mrc_order_id | String | ✅ | Merchant order code |
| 4 | origin_transaction_id | Integer | ❌ | Original payment transaction code at Baokim. Only returned when operation = QR_REFUND_TRANS |
| 5 | sub_merchant_fee | Integer | ✅ | Sub merchant fee |
| 6 | master_merchant_fee | Integer | ✅ | Master merchant fee |
| 7 | user_fee | Integer | ✅ | User fee |
| 8 | total_amount | Integer | ✅ | QR_PAYMENT_TRANS: total amount user needs to pay. QR_REFUND_TRANS: total amount user receives back |
| 9 | amount | Integer | ✅ | QR_PAYMENT_TRANS: total amount MRC actually receives. QR_REFUND_TRANS: total amount deducted from MRC |
| 10 | description | String | ✅ | Transaction description |
| 11 | status | Integer | ✅ | Transaction status: 1 = Success, 2 = Failed |
| 12 | completed_at | Datetime | ✅ | Transaction completion time |
| 13 | created_at | Datetime | ✅ | Transaction creation time |
| 14 | updated_at | Datetime | ✅ | Transaction update time |
QR Information
Same structure as Webhook transaction notification — qr_info Information.
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | qr_type | Integer | ✅ | QR transaction type: 1 = QRPay (domestic), 2 = QRGlobal (cross-border) |
| 2 | transaction_reference | String(16) | ✅ | Transaction code at NAPAS, used for inquiry/reconciliation |
| 3 | origin_transaction_reference | String(16) | ❌ | NAPAS transaction code of the original payment transaction. Only returned when operation = QR_REFUND_TRANS |
| 4 | payer_name | String | ❌ | Payer / account holder name |
| 5 | content | String | ❌ | Transfer content from payer side |
| 6 | currency_code | String(3) | ❌ | Transaction currency code (ISO 4217 numeric). 704 = VND. QRGlobal may differ from 704 |
| 7 | system_trace | String(6) | ❌ | NAPAS transaction tracing code |
| 8 | settlement_status | String(4) | ❌ | NAPAS settlement status: ACSP = Settled, RJCT = Rejected, PNDG = Pending reconciliation |
Response Example
{
"code": 100,
"message": "Successfully",
"data": {
"mrc_order_id": "ORD_123456789",
"transaction": {
"id": 5567261,
"order_id": 1870436,
"mrc_order_id": "ORD_123456789",
"origin_transaction_id": null,
"sub_merchant_fee": 2200,
"master_merchant_fee": 1100,
"user_fee": 0,
"total_amount": 200000,
"amount": 200000,
"description": "Thanh toan don hang",
"status": 1,
"completed_at": "2026-06-10 14:45:00",
"created_at": "2026-06-10 14:41:05",
"updated_at": "2026-06-10 14:45:00"
},
"qr_info": {
"qr_type": 1,
"transaction_reference": "6077BIDCA2CERVHE",
"origin_transaction_reference": null,
"payer_name": "NGUYEN VAN A",
"content": "NGUYEN VAN A chuyen tien",
"currency_code": "704",
"system_trace": "669445",
"settlement_status": "ACSP"
}
}
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 103 | Signature verification error |
| 104 | JWT authentication error |
| 422 | Invalid data (incorrect format, missing required fields) |
| 504 | Timeout |
| 710 | Sub Merchant does not exist |
| 711 | Master Merchant does not exist |
| 712 | Sub Merchant is inactive |
| 713 | Master Merchant is inactive |
| 714 | Sub Merchant does not belong to Master Merchant |