Create VA
Process
API Information
Method: POST
URL: /api/merchant-hosted/bank-transfer/create
Request
(Parameters sent by the partner)
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(50) | ✅ | Unique request ID. Suggested format: MerchantCode+YYYYMMDDHHIISS+UniqueId |
| 2 | request_time | Datetime | ✅ | Request sent time. Format: YYYY-MM-DD H:m:s |
| 3 | merchant_code | String(30) | ✅ | Partner merchant code |
| 4 | acc_name | String(50) | ✅ | Account name |
| 5 | acc_type | Integer | ✅ | VA type: 1 = Dynamic, 2 = Static |
| 6 | store_code | String(50) | ❌ | Store code |
| 7 | staff_code | String(50) | ❌ | Staff code |
| 8 | bank_code | String | ❌ | Bank code to create VA account (default null) |
| 9 | collect_amount_min | Integer | ❌ | Minimum collection amount (minimum 2,000 VND). acc_type=1: min=max / acc_type=2: null |
| 10 | collect_amount_max | Integer | ✅ | Maximum collection amount (unlimited) |
| 11 | mrc_order_id | String(25) | ✅ | Unique merchant order code |
| 12 | expire_date | Datetime | ❌ | Payment expiration date. Format: YYYY-MM-DD H:m:s. acc_type=1: default 24h / acc_type=2: required |
| 13 | memo | String(255) | ❌ | Transfer memo |
Request Example
{
"request_id": "MERCHANT123_20250717104530_0001",
"request_time": "2025-07-17 10:45:30",
"merchant_code": "MERCHANT123",
"store_code": "STORE001",
"staff_code": "NV001",
"bank_code": null,
"acc_name": "Nguyen Van A",
"acc_type": 1,
"collect_amount_min": 30000000,
"collect_amount_max": 30000000,
"mrc_order_id": "ORD123456789",
"expire_date": "2025-07-20 23:59:59",
"memo": "Thanh toan don hang ORD123456789"
}
Response
(Parameters returned by Baokim)
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Integer(3) | ✅ | Baokim error code |
| 2 | message | String(100) | ✅ | Error code description |
| 3 | data | Object | ✅ | Data returned |
Data Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | mrc_order_id | String(25) | ✅ | Merchant order code sent by partner |
| 2 | acc_type | Integer | ✅ | VA type: 1 = Dynamic, 2 = Static |
| 3 | collect_amount_min | Integer | ✅ | Minimum collection amount (minimum 2,000 VND) |
| 4 | collect_amount_max | Integer | ✅ | Maximum collection amount (unlimited) |
| 5 | expire_date | Datetime | ✅ | Payment expiration date. Format: YYYY-MM-DD H:m:s |
| 6 | bank_name | String(100) | ✅ | Bank name |
| 7 | bank_branch | String(100) | ✅ | Bank branch |
| 8 | acc_no | String(22) | ✅ | Account number |
| 9 | acc_name | String(50) | ✅ | Account holder name |
| 10 | qr_string | Text | ✅ | QR string |
| 11 | qr_path | String(100) | ✅ | QR image path |
| 12 | order_id | Integer | ✅ | Baokim transaction code |
Response Example
{
"code": 0,
"message": "Success",
"data": {
"mrc_order_id": "ORD123456789",
"order_id": 1111313,
"acc_type": 1,
"collect_amount_min": 30000000,
"collect_amount_max": 30000000,
"expire_date": "2025-07-20 23:59:59",
"bank_name": "Ngân hàng TMCP Ngoại Thương Việt Nam (Vietcombank)",
"bank_branch": "Chi nhánh Hà Nội",
"acc_no": "0123456789012",
"acc_name": "Nguyen Van A",
"qr_string": "00020101021238550010A0000007270123000697040300000000000020386304C3A4",
"qr_path": "https://sandbox.Baokim.vn/qr/BK1234567890.png"
}
}
Error Codes
| code | message |
|---|---|
| 100 | Success |
| 101 | System error |
| 102 | Provider error |
| 104 | JWT authentication error |
| 105 | Invalid digital signature |
| 106 | Order amount is insufficient for refund |
| 107 | Order cannot be refunded |
| 108 | Order cannot be cancelled |
| 109 | Order does not exist |
| 110 | Merchant order code already exists |
| 422 | Validation error |