Skip to main content

Create Virtual Account (VA)

Process​

Description:

  • CashPlus calls this API to create a virtual account (VA) and VietQR code for an order. Customer transfers money into the VA, Baokim sends Collection Webhook to CashPlus.
  • Each OrderId has only 1 VA. Calling again with an already created OrderId → Baokim returns ResponseCode=200 with the previously created VA information, does not create new VA.
  • Static QR: if OrderId contains QRTINH → QR code is not embedded with amount and VA has no expiration (ignores ExpireDate).
  • Dynamic QR by amount: when CollectAmountMin = CollectAmountMax, QR code is embedded with this amount. When different, QR code is not embedded with amount.

API Information​

Method: POST

URL: {BASE_URL}/collection/{env}/v1

  • {env}: live (production) or sanbox (test)

Header: Signature — RSA-SHA1 signature of raw body (see Security).

Request​

Main Parameter Table​

Field NameData TypeRequiredDescription
RequestIdString✅Request ID, unique. Max 50 characters, alphanumeric and _, ., -
RequestTimeDatetime✅Request time. Format: YYYY-MM-DD HH:mm:ss. Time difference must not exceed 10 minutes from Baokim time
PartnerCodeString✅Partner code provided by Baokim
OperationString✅Always 9001
CreateTypeInteger✅Always 2
AccNameString✅Display name of the VA. Max 50 characters, letters (with diacritics), digits, spaces, ., -, _
SubMerchantString❌Sub merchant code registered with Baokim
StoreCodeString❌Store code. Required if sub merchant uses multi-store model
CollectAmountMinInteger✅Minimum collect amount (VND), integer, within Baokim's limit for partner
CollectAmountMaxInteger✅Maximum collect amount (VND), integer, ≥ CollectAmountMin
OrderIdString✅Order ID from CashPlus side. Max 25 characters, no spaces or special characters
ExpireDateDatetime❌VA expiration time. Format: YYYY-MM-DD HH:mm:ss. If not provided → VA has no expiration
MemoString❌Memo attached to QR code. Baokim converts to non-diacritical and removes special characters

Request Example​

{
"RequestId": "CP20250115103000",
"RequestTime": "2025-01-15 10:30:00",
"PartnerCode": "CASHPLUS",
"Operation": "9001",
"CreateType": 2,
"AccName": "Store A",
"SubMerchant": "SHOP123",
"StoreCode": "STORE001",
"CollectAmountMin": 15000,
"CollectAmountMax": 15000,
"OrderId": "ORD202501150001",
"ExpireDate": "2025-01-16 10:30:00",
"Memo": "Order payment"
}

Response​

note

HTTP 200 - Success

Main Parameter Table​

Field NameData TypeRequiredDescription
ResponseCodeInteger✅200 = success
ResponseMessageString✅Response message
PartnerCodeString❌Always BAOKIM. Only present when successful
OrderIdString❌Order ID
CollectAmountMinInteger❌Minimum collect amount
CollectAmountMaxInteger❌Maximum collect amount
ExpireDateDatetime❌VA expiration time
AccountInfoObject❌VA information. See AccountInfo table

AccountInfo.BANK​

Field NameData TypeDescription
BankNameStringBank name of the VA
BankShortNameStringBank short name (e.g. BIDV, MSB, VPBANK)
BankBranchStringBranch
AccNoStringVirtual account number
AccNameStringVirtual account name
QrStringVietQR code string. CashPlus uses this string to display the QR code themselves. Can be null
QrPathStringQR code image path. Can be null

Response Example​

{
"ResponseCode": 200,
"ResponseMessage": "Success",
"PartnerCode": "BAOKIM",
"OrderId": "ORD202501150001",
"CollectAmountMin": 15000,
"CollectAmountMax": 15000,
"ExpireDate": "2025-01-16 10:30:00",
"AccountInfo": {
"BANK": {
"BankName": "Joint Stock Commercial Bank for Investment and Development of Vietnam",
"BankShortName": "BIDV",
"BankBranch": "Ha Noi",
"AccNo": "9620000123456",
"AccName": "Store A",
"Qr": "00020101021238570010A000000727012700069704180113962000012345602...",
"QrPath": "https://{QR_DOMAIN}/qr/ORD202501150001.png"
}
}
}

Error Response Example​

{
"ResponseCode": 109,
"ResponseMessage": "CollectAmount is invalid"
}

Error Codes​

Error CodeDescription
200Success (including retry with already created OrderId)
11Error during Baokim processing
103Operation is invalid (not 9001)
104RequestId or RequestTime is invalid (wrong format, duplicate RequestId, or time difference exceeds 10 minutes)
105Partner code is invalid
106AccName is invalid
109CollectAmount is invalid (missing, not integer, out of limits, or Min > Max)
110ExpireDate is invalid
120Signature is invalid
122OrderId is invalid
123CreateType is invalid (not 2)
124SubMerchant is invalid
125StoreCode is invalid