Virtual Account
Generate Virtual Account (VA)
Guide to create Virtual Account via Paylabs API.
Request URL
URL: ${ROOT_URL}/payment/v2.3/va/create
HTTPMethod: POST
EndpointUrl: /payment/v2.3/va/create
Generate VA Request Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details please check Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| requestId | String(64) | Yes | Unique identifier on every request |
| merchantId | String(20) | Yes | Unique ID provided by payment gateway to merchant |
| storeId | String(30) | No | Only if using branch ID |
| paymentType | String(20) | Yes | Payment type, see Payment Type |
| amount | Decimal(12,2) | Yes | Amount in Indonesia Rupiah |
| merchantTradeNo | String(32) | Yes | Unique identifier created by merchant for each transaction |
| notifyUrl | String(200) | No | Callback URL on payment success; see Inquiry Order for parameters |
| payer | String(60) | Yes | Name of the payer |
| productName | String(100) | Yes | Product/service name |
| + productInfo | Array<Object>(30) | No | Product/service details |
| - id | String(10) | Yes | Product ID |
| - name | String(32) | Yes | Product Name |
| - price | decimal(12,2) | Yes | Amount in IDR, supports two decimals |
| - type | String(20) | Yes | Product Type |
| - url | String(200) | No | Product URL |
| - quantity | Number(4) | Yes | Product Quantity |
paymentType
| Payment Type | Code |
|---|---|
| VA | SinarmasVA,MaybankVA,DanamonVA,BNCVA,BCAVA,INAVA,BNIVA,PermataVA,MuamalatVA,BSIVA,BRIVA,MandiriVA,CIMBVA,NobuVA,KaltimtaraVA,BTNVA |
Generate VA Response Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details please check Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| requestId | String(64) | Yes | Unique identifier on every request |
| errCode | String(32) | Yes | 0 means success, otherwise see Error Code |
| errCodeDes | String(128) | No | Error description |
| merchantId | String(20) | Yes | Merchant ID |
| storeId | String(30) | No | Only if using branch ID |
| paymentType | String(20) | Yes | Payment type |
| requestAmount | Decimal(12,2) | No | Amount at request |
| amount | Decimal(12,2) | Yes | Amount in IDR, 2 decimals. Fee type OUR adds fee; fractional fees are rounded up (10,000.11 → 10,001.00). |
| merchantTradeNo | String(32) | Yes | Merchant order number |
| createTime | String(16) | No | yyyyMMddHHmmss |
| vaCode | String(32) | No | Virtual Account Number |
| platformTradeNo | String(32) | No | Paylabs platform order number |
| successTime | String(16) | No | yyyyMMddHHmmss |
| expiredTime | String(16) | No | yyyyMMddHHmmss |
| status | String(32) | No | 01 PENDING, 09 FAILED, 02 SUCCEEDED |
| productName | String(100) | Yes | Product/service name |
| + productInfo | Array<Object>(30) | No | Product/service details |
| - id | String(10) | Yes | Product ID |
| - name | String(32) | Yes | Product Name |
| - price | decimal(12,2) | Yes | Amount in IDR, supports two decimals |
| - type | String(20) | Yes | Product Type |
| - url | String(200) | No | Product URL |
| - quantity | Number(4) | Yes | Product Quantity |
| transFeeRate | Decimal(6,6) | No | Transaction Rate, six decimals |
| transFeeAmount | Decimal(12,2) | No | Fees, two decimals |
| totalTransFee | Decimal(12,2) | No | Total transaction fee rate (excluding vatFee), two decimals |
| vatFee | Decimal(12,2) | No | Taxes, two decimals |
| feeType | String(3) | No | Fee deduction type: BEN/OUR. Default BEN. OUR adds fee to order amount automatically. |
| payer | String(60) | No | Actual payer name if supported; otherwise null. Currently supports: INA VA, BNC VA. Not the payer sent when initiating request. |
| accountNo | String(32) | No | Actual payer account number if supported; otherwise null. Currently supports: INA VA, BNC VA. |
Example
Request
POST /payment/v2.3/va/create
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"merchantId":"0010001",
"merchantTradeNo":"100100011649755895582",
"requestId":"200100011649755895582",
"paymentType":"BTNVA",
"amount":"10000.00",
"productName":"Test",
"payer":"test"
}Response
POST /payment/v2.3/va/create
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"amount":"10000.00",
"merchantTradeNo":"100100011649755895582",
"vaCode":"94810003800000626",
"platformTradeNo":"2022041200000000025",
"expiredTime":20220413163136,
"paymentType":"BTNVA",
"createTime":"20220412163136",
"merchantId":"0010001",
"errCode":"0",
"requestId":"200100011649755895582",
"productName":"Test",
"status":"01",
"transFeeRate":"0",
"transFeeAmount":"0",
"totalTransFee":"0",
"vatFee":"0"
}