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

Data Signing Rules

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details please check Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

ParameterTypeRequiredRemarks
requestIdString(64)YesUnique identifier on every request
merchantIdString(20)YesUnique ID provided by payment gateway to merchant
storeIdString(30)NoOnly if using branch ID
paymentTypeString(20)YesPayment type, see Payment Type
amountDecimal(12,2)YesAmount in Indonesia Rupiah
merchantTradeNoString(32)YesUnique identifier created by merchant for each transaction
notifyUrlString(200)NoCallback URL on payment success; see Inquiry Order for parameters
payerString(60)YesName of the payer
productNameString(100)YesProduct/service name
+ productInfoArray<Object>(30)NoProduct/service details
- idString(10)YesProduct ID
- nameString(32)YesProduct Name
- pricedecimal(12,2)YesAmount in IDR, supports two decimals
- typeString(20)YesProduct Type
- urlString(200)NoProduct URL
- quantityNumber(4)YesProduct Quantity

paymentType

Payment TypeCode
VASinarmasVA,MaybankVA,DanamonVA,BNCVA,BCAVA,INAVA,BNIVA,PermataVA,MuamalatVA,BSIVA,BRIVA,MandiriVA,CIMBVA,NobuVA,KaltimtaraVA,BTNVA

Generate VA Response Parameters

Header

Data Signing Rules

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details please check Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

Error Code

ParameterTypeRequiredRemarks
requestIdString(64)YesUnique identifier on every request
errCodeString(32)Yes0 means success, otherwise see Error Code
errCodeDesString(128)NoError description
merchantIdString(20)YesMerchant ID
storeIdString(30)NoOnly if using branch ID
paymentTypeString(20)YesPayment type
requestAmountDecimal(12,2)NoAmount at request
amountDecimal(12,2)YesAmount in IDR, 2 decimals. Fee type OUR adds fee; fractional fees are rounded up (10,000.11 → 10,001.00).
merchantTradeNoString(32)YesMerchant order number
createTimeString(16)NoyyyyMMddHHmmss
vaCodeString(32)NoVirtual Account Number
platformTradeNoString(32)NoPaylabs platform order number
successTimeString(16)NoyyyyMMddHHmmss
expiredTimeString(16)NoyyyyMMddHHmmss
statusString(32)No01 PENDING, 09 FAILED, 02 SUCCEEDED
productNameString(100)YesProduct/service name
+ productInfoArray<Object>(30)NoProduct/service details
- idString(10)YesProduct ID
- nameString(32)YesProduct Name
- pricedecimal(12,2)YesAmount in IDR, supports two decimals
- typeString(20)YesProduct Type
- urlString(200)NoProduct URL
- quantityNumber(4)YesProduct Quantity
transFeeRateDecimal(6,6)NoTransaction Rate, six decimals
transFeeAmountDecimal(12,2)NoFees, two decimals
totalTransFeeDecimal(12,2)NoTotal transaction fee rate (excluding vatFee), two decimals
vatFeeDecimal(12,2)NoTaxes, two decimals
feeTypeString(3)NoFee deduction type: BEN/OUR. Default BEN. OUR adds fee to order amount automatically.
payerString(60)NoActual payer name if supported; otherwise null. Currently supports: INA VA, BNC VA. Not the payer sent when initiating request.
accountNoString(32)NoActual 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"
}