Skip to main content

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​

NoField NameData TypeRequiredDescription
1request_idString(100)✅Unique request ID from merchant to Baokim
2request_timeString(20)✅Request 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
5acc_nameString✅VA account name
6acc_typeInteger✅VA type: 1 = Dynamic, 2 = Static
7store_codeString❌Store code
8branch_codeString❌Branch code
9staff_codeString❌Staff code
10mrc_order_idString✅Merchant order ID
11bank_codeString❌Bank to create VA (default: NULL)
12collect_amount_minInteger❌Minimum amount (2,000 VND). acc_type = 1: min = max; acc_type = 2: NULL
13collect_amount_maxInteger✅Maximum amount
14expire_dateString❌VA expiration date. acc_type = 1: default NULL; acc_type = 2: required
15memoString❌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 NameData TypeRequiredDescription
1codeNumber(3)✅Baokim error code
2messageString(200)✅Baokim error message
3dataObject✅Data returned by Baokim

Data Information​

No.Field NameData TypeRequiredDescription
1order_idInteger✅Baokim order ID
2mrc_order_idString✅Merchant order ID
3acc_typeInteger✅VA type: 1 = Dynamic, 2 = Static
4collect_amount_minInteger❌Minimum amount
5collect_amount_maxInteger✅Maximum amount
6expire_dateString❌VA expiration date: acc_type = 1, default = NULL / acc_type = 2: required
7bank_nameString✅VA bank name
8bank_branchString❌Branch
9acc_noString✅VA account number
10acc_nameString✅VA account name
11qr_stringText✅QR code string
12qr_pathString✅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 CodeDescription
100Success
11Failed
101Baokim system error
103Signature authentication error
104JWT authentication error
422Invalid data
710Sub merchant does not exist
711Master merchant does not exist
712Sub merchant is inactive
713Master merchant is inactive