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_codeStringStore code
6branch_codeStringBranch code
7staff_codeStringStaff code
8operationStringNotification type: QR_PAYMENT_TRANS = payment / QR_REFUND_TRANS = refund
9transactionObjectTransaction information
10qr_infoObjectQR code and NAPAS transaction information

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 provided when operation = QR_REFUND_TRANS
5sub_merchant_feeIntegerSub merchant fee
6master_merchant_feeIntegerMaster merchant fee
7user_feeIntegerUser fee
8total_amountIntegerQR_PAYMENT_TRANS: total amount payer needs to pay. QR_REFUND_TRANS: total amount payer 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

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 original payment transaction. Only provided 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

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 returns to Baokim)

Main Parameters

No.Field NameData TypeRequiredDescription
1codeString(3)Confirmation code: 100 = success
2messageString(200)Message returned to Baokim
3dataObjectResponse data from Merchant if any

Response Example

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