Skip to main content

Transaction Notification Webhook

(Built by MERCHANT)

⚠️ Difference from other B2B API groups: QRPay/QRGlobal requires Merchant to reply with code = 100 (not code = 0) to confirm successful webhook receipt. If returning code = 0, Baokim will not record success and will continue retrying.

Process​

Payment Flow​

Baokim calls this webhook (operation = QR_PAYMENT_TRANS) after receiving payment result from NAPAS. Merchant does not call any API in this flow — only receives notifications.

Refund Flow​

Baokim calls this webhook (operation = QR_REFUND_TRANS) with final refund result after Merchant has called Refund API previously.

  • Baokim calls webhook API built by MERCHANT to send notifications when payment result or refund request result occurs.
  • MERCHANT distinguishes notification type using the operation field: QR_PAYMENT_TRANS (payment) / QR_REFUND_TRANS (refund).
  • Webhook notifies both success (status = 1) and failure (status = 2) results for both payment and refund transactions.
  • Retry mechanism follows Webhook Mechanism section.

API Information​

Method: POST

URL: Provided by Merchant

Header:

  • Content-Type: application/json
  • Signature: Baokim signs the request body with digital signature, Merchant verifies using Baokim's public key

Request​

(Baokim sends to Merchant)

Main Parameters​

No.Field NameData TypeRequiredDescription
1request_idString(100)✅Unique ID for each Request from Baokim to MERCHANT
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
5store_codeString❌Store code
6branch_codeString❌Branch code
7staff_codeString❌Staff code
8operationString✅Notification type: QR_PAYMENT_TRANS = payment / QR_REFUND_TRANS = refund
9transactionObject✅Transaction information
10qr_infoObject✅QR code and NAPAS transaction information

Transaction Information​

No.Field NameData TypeRequiredDescription
1idInteger✅Baokim transaction code
2order_idInteger✅Baokim order code
3mrc_order_idString✅Merchant order code
4origin_transaction_idInteger❌Original payment transaction code at Baokim. Only provided when operation = QR_REFUND_TRANS
5sub_merchant_feeInteger✅Sub merchant fee
6master_merchant_feeInteger✅Master merchant fee
7user_feeInteger✅User fee
8total_amountInteger✅QR_PAYMENT_TRANS: total amount payer needs to pay. QR_REFUND_TRANS: total amount payer receives back
9amountInteger✅QR_PAYMENT_TRANS: total amount MRC actually receives. QR_REFUND_TRANS: total amount deducted from MRC
10descriptionString✅Transaction description
11statusInteger✅Transaction status: 1 = Success, 2 = Failed
12completed_atDatetime✅Transaction completion time
13created_atDatetime✅Transaction creation time
14updated_atDatetime✅Transaction update time

QR Information​

No.Field NameData TypeRequiredDescription
1qr_typeInteger✅QR 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 original payment transaction. Only provided when operation = QR_REFUND_TRANS
4payer_nameString❌Payer / account holder name
5contentString❌Transfer 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

Request Example — Payment (QR_PAYMENT_TRANS)​

{
"request_id": "BK050015588WH001",
"request_time": "2026-06-10 14:45:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"store_code": null,
"branch_code": null,
"staff_code": null,
"operation": "QR_PAYMENT_TRANS",
"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"
}
}

Request Example — Refund (QR_REFUND_TRANS)​

{
"request_id": "BK050015588WH025",
"request_time": "2026-06-10 17:05:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"store_code": null,
"branch_code": null,
"staff_code": null,
"operation": "QR_REFUND_TRANS",
"transaction": {
"id": 5567399,
"order_id": 1870436,
"mrc_order_id": "ORD_123456789",
"origin_transaction_id": 5567261,
"sub_merchant_fee": 0,
"master_merchant_fee": 0,
"user_fee": 0,
"total_amount": 100000,
"amount": 100000,
"description": "Hoan tien giao dich",
"status": 1,
"completed_at": "2026-06-10 17:04:40",
"created_at": "2026-06-10 16:20:05",
"updated_at": "2026-06-10 17:04:40"
},
"qr_info": {
"qr_type": 1,
"transaction_reference": "6A01BKIMA2CKFRK4",
"origin_transaction_reference": "6077BIDCA2CERVHE",
"payer_name": "NGUYEN VAN A",
"content": "Hoan tien giao dich",
"currency_code": "704",
"system_trace": "669512",
"settlement_status": "ACSP"
}
}

Response​

(Merchant's reply to Baokim)

⚠️ Note: unlike other webhooks, QRPay/QRGlobal requires the Merchant to return code = 100 to confirm success (see the note at the top of this page).

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1codeInteger✅Result code. 100 = Success (required, do not use 0)
2messageString✅Processing result message
3dataObject❌Returned data (if any)

Response Example​

{
"code": 100,
"message": "Successfully",
"data": null
}