Skip to main content

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_id corresponds 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 NameData TypeRequiredDescription
1request_idString(100)Unique ID for each Request from MERCHANT to Baokim
2request_timeString(20)Request send time. Format: YYYY-MM-DD H:i:s
3master_merchant_codeString(50)Unique identifier for MASTER MERCHANT
4sub_merchant_codeString(50)Unique identifier for SUB MERCHANT
5mrc_order_idString(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 NameData TypeRequiredDescription
1codeNumber(3)Baokim error code
2messageString(200)Baokim error message
3dataObjectData returned by Baokim

Data Information

No.Field NameData TypeRequiredDescription
1mrc_order_idStringQueried order code
2transactionObjectTransaction details. NULL if no transaction has occurred for this order
3qr_infoObjectNAPAS transaction information. NULL if no transaction has occurred for this order

Transaction Information

Same structure as Webhook transaction notification — transaction Information.

No.Field NameData TypeRequiredDescription
1idIntegerBaokim transaction code
2order_idIntegerBaokim order code
3mrc_order_idStringMerchant order code
4origin_transaction_idIntegerOriginal payment transaction code at Baokim. Only returned when operation = QR_REFUND_TRANS
5sub_merchant_feeIntegerSub merchant fee
6master_merchant_feeIntegerMaster merchant fee
7user_feeIntegerUser fee
8total_amountIntegerQR_PAYMENT_TRANS: total amount user needs to pay. QR_REFUND_TRANS: total amount user receives back
9amountIntegerQR_PAYMENT_TRANS: total amount MRC actually receives. QR_REFUND_TRANS: total amount deducted from MRC
10descriptionStringTransaction description
11statusIntegerTransaction status: 1 = Success, 2 = Failed
12completed_atDatetimeTransaction completion time
13created_atDatetimeTransaction creation time
14updated_atDatetimeTransaction update time

QR Information

Same structure as Webhook transaction notification — qr_info Information.

No.Field NameData TypeRequiredDescription
1qr_typeIntegerQR transaction type: 1 = QRPay (domestic), 2 = QRGlobal (cross-border)
2transaction_referenceString(16)Transaction code at NAPAS, used for inquiry/reconciliation
3origin_transaction_referenceString(16)NAPAS transaction code of the original payment transaction. Only returned when operation = QR_REFUND_TRANS
4payer_nameStringPayer / account holder name
5contentStringTransfer content from payer side
6currency_codeString(3)Transaction currency code (ISO 4217 numeric). 704 = VND. QRGlobal may differ from 704
7system_traceString(6)NAPAS transaction tracing code
8settlement_statusString(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 CodeDescription
100Success
11Failed
101Baokim system error
103Signature verification error
104JWT authentication error
422Invalid data (incorrect format, missing required fields)
504Timeout
710Sub Merchant does not exist
711Master Merchant does not exist
712Sub Merchant is inactive
713Master Merchant is inactive
714Sub Merchant does not belong to Master Merchant