Create VA
Process
Merchant calls the API to create a static or dynamic VA for each transaction.
API Information
- URL:
/b2b/core/api/ext/mm/bank-transfer/create - Method: POST
Request
(Parameters sent by merchant)
Main Parameters
| No | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String(100) | ✅ | Unique request ID from merchant to Baokim |
| 2 | request_time | String(20) | ✅ | Request 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 | acc_name | String | ✅ | VA account name |
| 6 | acc_type | Integer | ✅ | VA type: 1 = Dynamic, 2 = Static |
| 7 | store_code | String | ❌ | Store code |
| 8 | branch_code | String | ❌ | Branch code |
| 9 | staff_code | String | ❌ | Staff code |
| 10 | mrc_order_id | String | ✅ | Merchant order ID |
| 11 | bank_code | String | ❌ | Bank to create VA (default: NULL) |
| 12 | collect_amount_min | Integer | ❌ | Minimum amount (2,000 VND). acc_type = 1: min = max; acc_type = 2: NULL |
| 13 | collect_amount_max | Integer | ✅ | Maximum amount |
| 14 | expire_date | String | ❌ | VA expiration date. acc_type = 1: default NULL; acc_type = 2: required |
| 15 | memo | String | ❌ | Transfer content |
Request Example
{
"request_id": "MERCHANT050015588AXE00",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"acc_name": "NGUYEN VAN A",
"acc_type": 1,
"store_code": null,
"branch_code": null,
"staff_code": null,
"mrc_order_id": "ORD_123456789",
"bank_code": null,
"collect_amount_min": 20000,
"collect_amount_max": 20000,
"expire_date": null,
"memo": "Thanh toan don hang"
}
Response
(Parameters returned by Baokim to merchant)
Main Parameters Table
| 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 ID |
| 2 | mrc_order_id | String | ✅ | Merchant order ID |
| 3 | acc_type | Integer | ✅ | VA type: 1 = Dynamic, 2 = Static |
| 4 | collect_amount_min | Integer | ❌ | Minimum amount |
| 5 | collect_amount_max | Integer | ✅ | Maximum amount |
| 6 | expire_date | String | ❌ | VA expiration date: acc_type = 1, default = NULL / acc_type = 2: required |
| 7 | bank_name | String | ✅ | VA bank name |
| 8 | bank_branch | String | ❌ | Branch |
| 9 | acc_no | String | ✅ | VA account number |
| 10 | acc_name | String | ✅ | VA account name |
| 11 | qr_string | Text | ✅ | QR code string |
| 12 | qr_path | String | ✅ | QR code image path |
Example response:
{
"code": 0,
"message": "Success",
"data": {
"order_id": 1870436,
"mrc_order_id": "ORD_123456789",
"acc_type": 1,
"collect_amount_min": 20000,
"collect_amount_max": 20000,
"expire_date": null,
"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": "01234567890123",
"acc_name": "BAOKIM NGUYEN VAN A",
"qr_string": "00020101021238550010A0000007270123000697040300000000000020386304C3A4",
"qr_path": "https://sandbox.baokim.vn/qr/BK1234567890.png"
}
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 101 | Baokim system error |
| 103 | Signature authentication error |
| 104 | JWT authentication error |
| 422 | Invalid data |
| 710 | Sub merchant does not exist |
| 711 | Master merchant does not exist |
| 712 | Sub merchant is inactive |
| 713 | Master merchant is inactive |