Create QRPay/QRGlobal QR Code
Process
- MERCHANT calls API to create QRPay/QRGlobal QR code to Baokim system.
- Baokim verifies the request (JWT, digital signature), looks up SUB MERCHANT information to retrieve payment point identifiers (
card_acceptor_id, MCC code, etc.). - Baokim system generates QR string according to VietQR/EMVCo standards and initializes the order.
- Baokim returns the result (
qr_string,qr_url) to MERCHANT for displaying to the payer. - The same QR code accepts both domestic payment (QRPay) and cross-border payment (QRGlobal); the transaction type is differentiated via the
qr_typefield in the transaction notification webhook.
API Information
Method: POST
URL: /b2b/core/api/ext/mm/qr/create
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) | ✅ | Merchant order code, unique per SUB MERCHANT. For static QR (acc_type = 2): serves as the QR code identifier |
| 6 | acc_type | Integer | ✅ | QR code type: 1 = Dynamic, 2 = Static |
| 7 | amount | Integer | ⚠️ | Payment amount (VND, integer). Required when acc_type = 1 (Dynamic QR), fixed per order.Static QR: not sent (NULL), payer enters amount when scanning |
| 8 | memo | String(25) | ✅ | Payment description displayed when scanning QR (max 25 characters, no accents) |
| 9 | post_code | String(10) | ✅ | Postal code of the payment acceptance point |
| 10 | store_code | String | ❌ | Store code |
| 11 | branch_code | String | ❌ | Branch code |
| 12 | staff_code | String | ❌ | Staff code |
Request Example
{
"request_id": "MERCHANT050015588QR001",
"request_time": "2026-06-10 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"mrc_order_id": "ORD_123456789",
"acc_type": 1,
"amount": 200000,
"memo": "Thanh toan don hang",
"post_code": "100000",
"store_code": null,
"branch_code": null,
"staff_code": null
}
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 | order_id | Integer | ✅ | Baokim order code |
| 2 | mrc_order_id | String | ✅ | Merchant order code |
| 3 | acc_type | Integer | ✅ | QR code type: 1 = Dynamic, 2 = Static |
| 4 | amount | Integer | ❌ | Payment amount. NULL for static QR |
| 5 | qr_string | Text | ✅ | QR string according to EMVCo standard, used by Merchant to generate QR image |
| 6 | qr_url | String | ✅ | URL to QR code image |
| 7 | created_at | Datetime | ✅ | Order creation time |
| 8 | updated_at | Datetime | ✅ | Order update time |
Response Example
{
"code": 100,
"message": "Successfully",
"data": {
"order_id": 1870436,
"mrc_order_id": "ORD_123456789",
"acc_type": 1,
"amount": 200000,
"qr_string": "00020101021238550010A0000007270123000697040300000000000020386304C3A4",
"qr_url": "https://sandbox.baokim.vn/qr/BK1234567890.png",
"created_at": "2026-06-10 14:41:05",
"updated_at": "2026-06-10 14:41:05"
}
}
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 |
| 707 | Order ID already exists |
| 709 | Master Merchant cannot create transactions directly |
| 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 |
| 717 | Service code does not exist |
| 718 | Service code is inactive |
| 720 | Token is invalid |
| 724 | Fee configuration not found |