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_nameStringVA account name
6acc_typeIntegerVA type: 1 = Dynamic, 2 = Static
7store_codeStringStore code
8branch_codeStringBranch code
9staff_codeStringStaff code
10mrc_order_idStringMerchant order ID
11bank_codeStringBank to create VA (default: NULL)
12collect_amount_minIntegerMinimum amount (2,000 VND). acc_type = 1: min = max; acc_type = 2: NULL
13collect_amount_maxIntegerMaximum amount
14expire_dateStringVA expiration date. acc_type = 1: default NULL; acc_type = 2: required
15memoStringTransfer 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
3dataObjectData returned by Baokim

Data Information

No.Field NameData TypeRequiredDescription
1order_idIntegerBaokim order ID
2mrc_order_idStringMerchant order ID
3acc_typeIntegerVA type: 1 = Dynamic, 2 = Static
4collect_amount_minIntegerMinimum amount
5collect_amount_maxIntegerMaximum amount
6expire_dateStringVA expiration date: acc_type = 1, default = NULL / acc_type = 2: required
7bank_nameStringVA bank name
8bank_branchStringBranch
9acc_noStringVA account number
10acc_nameStringVA account name
11qr_stringTextQR code string
12qr_pathStringQR 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