Skip to main content

Create VA

Create VA Availability

Currently Create VA API only available for these Acquirer's Virtual Accounts:

BNC
BNI
BTN

Process Flow

There are 2 main flow in SNAP Format Virtual Account:

  1. VA API from acquirer.

    Merchant could hit create VA API (service code 27) to create their virtual account number by acquirer. The number created then will be inquired by acquirer, merchant can get the payment notification. Currently the VA that use this API service are BNC and BNI
Virtual Account - Register Flow Process
 Virtual Account - Register Flow Process
  1. Inquiry and Payment

    Merchant can create their own virtual account number or get help from DOKU to create the number, and then DOKU will process the inquiry and payment. These virtual account within DOKU that use the inquiry and payment flow are: BNI, BTN, Danamon, Mandiri, Maybank, Permata
Virtual Account - Inquiry and Payment Flow Process
 Virtual Account - Inquiry and Payment Flow Process

Integration Details

1. BNC VA

Here is the endpoint of BNC Virtual Account :

API Request

TypeValue
Service Code27
HTTP MethodPOST
Path/bi-snap-va/bnc/v1/transfe-va/create-va

Here is the sample of request header to generate payment code:

X-TIMESTAMP: 2020-12-21T14:56:11+07:00
X-SIGNATURE: ieNOENDdN4MnectGytx5UvmOfASZ2oGWMCJ8gVqkw3tB98ofgY9cbxSeY4IYoYeoKs+0QP4h8BTBhemlfeXp1w==
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: VA008
Request Header Explanation
ParameterData TypeTypeDescription
X-TIMESTAMPstringMandatoryClient's current local time with format :
YYYY-MM-DDTHH:mm:ssZD
X-SIGNATUREstringMandatoryRepresents signature of a request. Identify Signature Type used Value:
1. Symmetric Signature with Get Token (Default)
HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:β€œ+ EndpointUrl +":"+ AccessToken +":β€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":β€œ + TimeStamp
Notes :
1. The full URL endpoint includes all parameters in the associated URL
2. For the minify(Request Body) parameter, if there is no Request Body then an empty string is used.
X-PARTNER-IDstringMandatoryClient Id for merchant that generated by DOKU
X-EXTERNAL-IDstringMandatoryNumeric String. Reference number that should be unique in the same day (Request Id)
CHANNEL-IDstring(5)MandatoryVA008

Here is the sample of request body:

{  
"partnerServiceId":"99341537",
"customerNo":"00000000000000000000",
"virtualAccountNo":"0000000000000000000000000000",
"virtualAccountName":"Jessica Tessalonika",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00"
}

API Response

After hitting the above API request, DOKU will give the response.

Here is the sample of response header :

X-TIMESTAMP: 2020-12-21T14:36:19+07:00
Response Header Explanation
ParameterData TypeTypeDescription
X-TimestampstringMandatoryClient's current local time with format YYYY-MM-DDTHH:mm:ssZ
TypeValue
HTTP Status200
ResultSUCCESS

Here is the sample of response body:

{
"responseCode":"2002700",
"responseMessage":"Successful",
"virtualAccountData":{
"partnerServiceId":"90341537",
"customerNo":"0000000000112",
"virtualAccountNo":"903415370000000000112",
"virtualAccountName":"Jessica Tessalonika",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00",
"additionalInfo":{
},
"howToPayInfo":{
"howToPayPage":"https://sandbox.doku.com/bca-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
"howToPayApi":"https://api-sandbox.doku.com/bca-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
}
}
}

Another response, for failed scenario

TypeValue
HTTP Status404
ResultFAILED

Here is response sample for failed scenario

{
"responseCode":"4042716",
"responseMessage":"Partner Not Found",
"virtualAccountData":{
"partnerServiceId":"90341537",
"customerNo":"0000000000112",
"virtualAccountNo":"903415370000000000112",
"virtualAccountName":"Jokul Doe 003",
"virtualAccountEmail":"jokul@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00"
"additionalInfo":{
"settlement":[
{
"bank_account_settlement_id":"SBA-0001-123123123",
"value":10,
"type":"PERCENTAGE"
},{
"bank_account_settlement_id":"SBS-0002-321321321",
"value":90,
"type":"PERCENTAGE"
}
]
}
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
responseCodestring(7)MandatoryResponse Code : HTTP status code + service code + case code
responseMessagestring(150)MandatoryResponse Description
virtualAccountData.partnerServiceIdstring(8)Mandatorysimilar to company code, 8 digit left padding space
virtualAccountData.customerNoString (20)OptionalUnique number (up to 20 digits).
partnerServiceId + customerNo = virtualAccountNo
virtualAccountData.virtualAccountNoString (28)OptionalpartnerServiceId (8 digit left padding 0) + customerNo up to 20 digits).
virtualAccountData.virtualAccountNamestring(255)MandatoryCustomer Name
virtualAccountData.virtualAccountEmailstring(255)OptionalCustomer Email
virtualAccountData.virtualAccountPhonestring(30)OptionalCustomer Phone, Format: 62xxxxxxxxx xxxx
virtualAccountData.trxIdstring(64)MandatoryTransaction ID in Partner system
virtualAccountData.totalAmount.valuestring(8)OptionalTransaction Amount.
Total Amount with 2 decimal, format ISO 4217
virtualAccountData.totalAmount.Currencystring(3)OptionalCurrency. Example: IDR
virtualAccountData.howToPayInfo.howToPayPageANS(256)OptionalStep by step that will be used by customer for how to doing a payment
virtualAccountData.howToPayInfo.howToPayApiANS(256)OptionalStep by step that will be used by customer for how to doing a payment
billDetails.billCodestring(2)OptionalBill code for Customer choose. Example : 01
billDetails.billNostring(18)OptionalBill number from Partner
billDetails.billNamestring(20)OptionalBill Name
billDetails.billShortNamestring(10)OptionalBill Name to shown to
billDetails.billDescription.englishstring(18)OptionalBill Description in English
billDetails.billDescription.indonesiastring(18)OptionalBill Description in Bahasa Indonesia
billDetails.billSubCompanystring(5)OptionalPartner’s product code
billDetails.billAmount.valueString (16.2)(ISO 4217)OptionalTransaction Amount.
Nominal inputted by Customer with 2 decimal
billDetails.billAmount.currencystring(3)OptionalCurrency
billDetails.additionalInfoObject(Unlimited)OptionalAdditional Information for custom use for each bill
freeTexts.englishstring(32)OptionalThis parameter will be shown in Channel
freeTexts.indonesiastring(32)OptionalThis parameter will be shown in Channel
virtualAccountTrxTypestring(1)OptionalType of Virtual Account :
C : closed payment
O : open payment
feeAmount.valueString (16.2)OptionalFormat ISO 4217
feeAmount.currencystring(3)OptionalExample : IDR
expiredDatestring(25)OptionalExpiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00
additionalInfoObjectOptionalAdditional Information for custom use

2. BNI VA

Here is the endpoint of BNI Virtual Account :

API Request

TypeValue
Service Code27
HTTP MethodPOST
Path/bi-snap-va/bni/v1/transfer-va/create-va

Here is the sample of request header to generate payment code:

X-TIMESTAMP: 2020-12-21T14:56:11+07:00
X-SIGNATURE: ieNOENDdN4MnectGytx5UvmOfASZ2oGWMCJ8gVqkw3tB98ofgY9cbxSeY4IYoYeoKs+0QP4h8BTBhemlfeXp1w==
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: VA004
Request Header Explanation
ParameterData TypeTypeDescription
X-TIMESTAMPstringMandatoryClient's current local time with format :
YYYY-MM-DDTHH:mm:ssZD
X-SIGNATUREstringMandatoryRepresents signature of a request. Identify Signature Type used Value:
1. Symmetric Signature with Get Token (Default)
HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:β€œ+ EndpointUrl +":"+ AccessToken +":β€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":β€œ + TimeStamp
Notes :
1. The full URL endpoint includes all parameters in the associated URL
2. For the minify(Request Body) parameter, if there is no Request Body then an empty string is used.
X-PARTNER-IDstringMandatoryClient Id for merchant that generated by DOKU
X-EXTERNAL-IDstringMandatoryNumeric String. Reference number that should be unique in the same day (Request Id)
CHANNEL-IDstring(5)MandatoryVA004

Here is the sample of request body:

{
"partnerServiceId": " 8412",
"customerNo": "000000000001",
"virtualAccountNo": " 8412000000000001",
"virtualAccountName": "Jessica Tessalonika",
"virtualAccountEmail": "jessica@email.com",
"virtualAccountPhone": "6281828384700",
"trxId": "QA-001",
"totalAmount": {
"value" : "100000.00",
"currency": "IDR"
},
"additionalInfo": {

},
"virtualAccountTrxType": "c",
"expiredDate": "2022-01-01T23:59:59-07:00"
}
Request Body Explanation
ParameterTypeMandatoryDescription
partnerServiceIdstring(8)MandatoryThis parameter is similar to company code/BIN, 8 digit left padding space.
customerNostring(20)MandatoryUnique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo
virtualAccountNostring(28)MandatorypartnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo
virtualAccountNamestring(255)MandatoryCustomer Name
virtualAccountEmailstring(255)OptionalCustomer Email
virtualAccountPhonestring(30)OptionalCustomer Phone, Format: 62xxxxxxxxx xxxx
trxIdstring(64)MandatoryTransaction ID in Partner system
totalAmount.valuestring(8)OptionalTransaction Amount.
Total Amount with 2 decimal, format ISO 4217
totalAmount.Currencystring(3)OptionalCurrency. Example: IDR
virtualAccountTrxTypestring(1)OptionalType of Virtual Account :
C : closed payment
O : open payment
expiredDatestring(25)OptionalExpiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00
additionalInfoObjectOptionalAdditional Information for custom use

API Response

After hitting the above API request, DOKU will give the response.

Here is the sample of response header :

X-TIMESTAMP: 2020-12-21T14:36:19+07:00
Response Header Explanation
ParameterData TypeTypeDescription
X-TimestampstringMandatoryClient's current local time with format YYYY-MM-DDTHH:mm:ssZ
TypeValue
HTTP Status200
ResultSUCCESS

Here is the sample of response body for success scenario :

{
"responseCode":"2002700",
"responseMessage":"Successful",
"virtualAccountData":{
"partnerServiceId":" 8412",
"customerNo":"000000000001",
"virtualAccountNo":" 8412000000000001",
"virtualAccountName":"Jessica Tessalonika",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"virtualAccountTrxType":"1",
"expiredDate":"2023-01-01T10:55:00+07:00",
"additionalInfo":{
},
"howToPayInfo":{
"howToPayPage":"https://sandbox.doku.com/bni-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
"howToPayApi":"https://api-sandbox.doku.com/bni-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
}
}
}
TypeValue
HTTP Status404
ResultFAILED

Here is the sample of response body for failed scenario :

{
"responseCode":"4042716",
"responseMessage":"Partner Not Found",
"virtualAccountData":{
"partnerServiceId":" 8412",
"customerNo":"000000000001",
"virtualAccountNo":" 8412000000000001",
"virtualAccountName":"Jessica Tessalonika",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"virtualAccountTrxType":"1",
"expiredDate":"2023-01-01T10:55:00+07:00"
"additionalInfo":{
"settlement":[
{
"bank_account_settlement_id":"SBA-0001-123123123",
"value":10,
"type":"PERCENTAGE"
},{
"bank_account_settlement_id":"SBS-0002-321321321",
"value":90,
"type":"PERCENTAGE"
}
]
}
}
}

Response Body Explanation
ParameterTypeMandatoryDescription
responseCodestring(7)MandatoryResponse Code : HTTP status code + service code + case code
responseMessagestring(150)MandatoryResponse Description
virtualAccountData.partnerServiceIdstring(8)Mandatorysimilar to company code, 8 digit left padding space
virtualAccountData.customerNoString (20)OptionalUnique number (up to 20 digits).
partnerServiceId + customerNo = virtualAccountNo
virtualAccountData.virtualAccountNoString (28)OptionalpartnerServiceId (8 digit left padding 0) + customerNo up to 20 digits).
virtualAccountData.virtualAccountNamestring(255)MandatoryCustomer Name
virtualAccountData.virtualAccountEmailstring(255)OptionalCustomer Email
virtualAccountData.virtualAccountPhonestring(30)OptionalCustomer Phone, Format: 62xxxxxxxxx xxxx
virtualAccountData.trxIdstring(64)MandatoryTransaction ID in Partner system
virtualAccountData.totalAmount.valuestring(8)OptionalTransaction Amount.
Total Amount with 2 decimal, format ISO 4217
virtualAccountData.totalAmount.Currencystring(3)OptionalCurrency. Example: IDR
virtualAccountData.howToPayInfo.howToPayPageANS(256)OptionalStep by step that will be used by customer for how to doing a payment
virtualAccountData.howToPayInfo.howToPayApiANS(256)OptionalStep by step that will be used by customer for how to doing a payment
virtualAccountTrxTypestring(1)OptionalType of Virtual Account :
C : closed payment
O : open payment
expiredDatestring(25)OptionalExpiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00
additionalInfoObjectOptionalAdditional Information for custom use

3. BTN VA

info

For BTN, virtualAccountTrxType is defined based on the BIN/ partnerServiceId.
Each partnerServiceId will be defined whether it will be number for closed or open payment.

Here is the endpoint of BTN Virtual Account :

API Request

BTN

TypeValue
Service Code27
HTTP MethodPOST
Path/bi-snap-va/btn/v1/transfer-va/create-va

Here is the sample of request header to generate payment code:

X-TIMESTAMP: 2020-12-21T14:56:11+07:00
X-SIGNATURE: ieNOENDdN4MnectGytx5UvmOfASZ2oGWMCJ8gVqkw3tB98ofgY9cbxSeY4IYoYeoKs+0QP4h8BTBhemlfeXp1w==
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
Authorization: bearer DUMMY
Content type: application/ json
CHANNEL-ID: VA009
Request Header Explanation
ParameterData TypeTypeDescription
X-TIMESTAMPstringMandatoryClient's current local time with format :
YYYY-MM-DDTHH:mm:ssZD
X-SIGNATUREstringMandatoryRepresents signature of a request. Identify Signature Type used Value:
1. Symmetric Signature with Get Token (Default)
HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +”:β€œ+ EndpointUrl +":"+ AccessToken +":β€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":β€œ + TimeStamp
Notes :
1. The full URL endpoint includes all parameters in the associated URL
2. For the minify(Request Body) parameter, if there is no Request Body then an empty string is used.
X-PARTNER-IDstringMandatoryClient Id for merchant that generated by DOKU
X-EXTERNAL-IDstringMandatoryNumeric String. Reference number that should be unique in the same day (Request Id)
AuthorizationstringMandatoryRepresents access_token of a request;
String starts with keyword β€œBearer ” followed by access_token (e.g. Bearer eyJraWQiOi...Jzc29zIiwiY)
Content typestringMandatoryString represents indicate the media type of the resource (e.g. application/json)
CHANNEL-IDstring(5)MandatoryVA009

Here is the sample of request body:

{  
"partnerServiceId":"95962001",
"customerNo":"00000000001",
"virtualAccountNo":"95962001000000001",
"virtualAccountName":"Jessica Tessalonika",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00"
}

Request Body Explanation
ParameterTypeMandatoryDescription
partnerServiceIdstring(8)MandatoryThis parameter is similar to company code/BIN, 8 digit left padding space.
customerNostring(20)MandatoryUnique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo
virtualAccountNostring(28)MandatorypartnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo
virtualAccountNamestring(255)MandatoryCustomer Name
virtualAccountEmailstring(255)OptionalCustomer Email
virtualAccountPhonestring(30)OptionalCustomer Phone, Format: 62xxxxxxxxx xxxx
trxIdstring(64)MandatoryTransaction ID in Partner system
totalAmount.valuestring(8)OptionalTransaction Amount.
Total Amount with 2 decimal, format ISO 4217
totalAmount.Currencystring(3)OptionalCurrency. Example: IDR
billDetails.billCodestring(2)OptionalBill code for Customer choose. Example : 01
billDetails.billNostring(18)OptionalBill number from Partner
billDetails.billNamestring(20)OptionalBill Name
billDetails.billShortNamestring(10)OptionalBill Name to shown to
billDetails.billDescription.englishstring(18)OptionalBill Description in English
billDetails.billDescription.indonesiastring(18)OptionalBill Description in Bahasa Indonesia
billDetails.billSubCompanystring(5)OptionalPartner’s product code
billDetails.billAmount.valueString (16.2)(ISO 4217)OptionalTransaction Amount.
Nominal inputted by Customer with 2 decimal
billDetails.billAmount.currencystring(3)OptionalCurrency
billDetails.additionalInfoObject(Unlimited)OptionalAdditional Information for custom use for each bill
freeTexts.englishstring(32)OptionalThis parameter will be shown in Channel
freeTexts.indonesiastring(32)OptionalThis parameter will be shown in Channel
virtualAccountTrxTypestring(1)ConditionalType of Virtual Account :
1 : closed payment
2 : open payment. Default : Closed Payment, conditional if using Open Payment
feeAmount.valueString (16.2)OptionalFormat ISO 4217
feeAmount.currencystring(3)OptionalExample : IDR
expiredDatestring(25)OptionalExpiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00
additionalInfoObjectOptionalAdditional Information for custom use

API Response

After hitting the above API request, DOKU will give the response.

Here is the sample of response header :

X-TIMESTAMP: 2020-12-21T14:36:19+07:00
Response Header Explanation
ParameterData TypeTypeDescription
X-TimestampstringMandatoryClient's current local time with format YYYY-MM-DDTHH:mm:ssZ
TypeValue
HTTP Status200
ResultSUCCESS

Here is the sample of response body for success scenario :

{
"responseCode":"2002700",
"responseMessage":"Successful",
"virtualAccountData":{
"partnerServiceId":"95962001",
"customerNo":"00000000001",
"virtualAccountNo":"9596200100000000001",
"virtualAccountName":"Jessica Tessalonka",
"virtualAccountEmail":"jessica@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00",
"additionalInfo":{
},
"howToPayInfo":{
"howToPayPage":"https://sandbox.doku.com/btn-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
"howToPayApi":"https://api-sandbox.doku.com/btn-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
}
}
}
{
"responseCode": "2002700",
"responseMessage": "Successful",
"virtualAccountData": {
"partnerServiceId": "95962002",
"customerNo": "00000000001",
"virtualAccountNo": "9596200200000000001",
"virtualAccountName": "Jokul Doe 003",
"virtualAccountEmail": "jokul@email.com",
"virtualAccountPhone": "6281828384858",
"trxId": "INV-20220916-0001",
"totalAmount": {
"value": "11000.00",
"currency": "IDR"
},
"billDetails": [
{
"billCode": "01",
"billNo": "123456789012345601",
"billName": "Bill A for Jan",
"billShortName": "Bill A",
"billDescription": {
"english": "Maintenance",
"indonesia": "Pemeliharaan"
},
"billSubCompany": "00001",
"billAmount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {}
}
],
"freeTexts": [
{
"english": "Free text",
"indonesia": "Tulisan bebas"
}
],
"virtualAccountTrxType": "1",
"feeAmount": {
"value": "1000.00",
"currency": "IDR"
},
"expiredDate": "2023-01-01T10:55:00+07:00"
},
"additionalInfo":{
},
"howToPayInfo":{
"howToPayPage":"https://sandbox.doku.com/btn-virtual-acccount/v1/how-to-pay-page/0008889912345678901234567890",
"howToPayApi":"https://api-sandbox.doku.com/btn-virtual-acccount/v1/how-to-pay-api/0008889912345678901234567890"
}
}

TypeValue
HTTP Status404
ResultFAILED

Here is the sample of response body for failed scenario :

{
"responseCode":"4042716",
"responseMessage":"Partner Not Found",
"virtualAccountData":{
"partnerServiceId":"95962001",
"customerNo":"00000000001",
"virtualAccountNo":"9596200100000000001",
"virtualAccountName":"Jokul Doe 003",
"virtualAccountEmail":"jokul@email.com",
"virtualAccountPhone":"6281828384858",
"trxId":"INV-20220916-0002",
"totalAmount":{
"value":"11000.00",
"currency":"IDR"
},
"billDetails":[
{
"billCode":"01",
"billNo":"123456789012345601",
"billName":"Bill A for Jan",
"billShortName":"Bill A",
"billDescription":{
"english":"Maintenance",
"indonesia":"Pemeliharaan"
},
"billSubCompany":"00001",
"billAmount":{
"value":"10000.00",
"currency":"IDR"
},
"additionalInfo":{

}
}
],
"freeTexts":[
{
"english":"Free text",
"indonesia":"Tulisan bebas"
}
],
"virtualAccountTrxType":"1",
"feeAmount":{
"value":"1000.00",
"currency":"IDR"
},
"expiredDate":"2023-01-01T10:55:00+07:00"
"additionalInfo":{
"settlement":[
{
"bank_account_settlement_id":"SBA-0001-123123123",
"value":10,
"type":"PERCENTAGE"
},{
"bank_account_settlement_id":"SBS-0002-321321321",
"value":90,
"type":"PERCENTAGE"
}
]
}
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
responseCodestring(7)MandatoryResponse Code : HTTP status code + service code + case code
responseMessagestring(150)MandatoryResponse Description
virtualAccountData.partnerServiceIdstring(8)Mandatorysimilar to company code, 8 digit left padding space
virtualAccountData.customerNoString (20)OptionalUnique number (up to 20 digits).
partnerServiceId + customerNo = virtualAccountNo
virtualAccountData.virtualAccountNoString (28)OptionalpartnerServiceId (8 digit left padding 0) + customerNo up to 20 digits).
virtualAccountData.virtualAccountNamestring(255)MandatoryCustomer Name
virtualAccountData.virtualAccountEmailstring(255)OptionalCustomer Email
virtualAccountData.virtualAccountPhonestring(30)OptionalCustomer Phone, Format: 62xxxxxxxxx xxxx
virtualAccountData.trxIdstring(64)MandatoryTransaction ID in Partner system
virtualAccountData.totalAmount.valuestring(8)OptionalTransaction Amount.
Total Amount with 2 decimal, format ISO 4217
virtualAccountData.totalAmount.Currencystring(3)OptionalCurrency. Example: IDR
virtualAccountData.howToPayInfo.howToPayPageANS(256)OptionalStep by step that will be used by customer for how to doing a payment
virtualAccountData.howToPayInfo.howToPayApiANS(256)OptionalStep by step that will be used by customer for how to doing a payment
billDetails.billCodestring(2)OptionalBill code for Customer choose. Example : 01
billDetails.billNostring(18)OptionalBill number from Partner
billDetails.billNamestring(20)OptionalBill Name
billDetails.billShortNamestring(10)OptionalBill Name to shown to
billDetails.billDescription.englishstring(18)OptionalBill Description in English
billDetails.billDescription.indonesiastring(18)OptionalBill Description in Bahasa Indonesia
billDetails.billSubCompanystring(5)OptionalPartner’s product code
billDetails.billAmount.valueString (16.2)(ISO 4217)OptionalTransaction Amount.
Nominal inputted by Customer with 2 decimal
billDetails.billAmount.currencystring(3)OptionalCurrency
billDetails.additionalInfoObject(Unlimited)OptionalAdditional Information for custom use for each bill
freeTexts.englishstring(32)OptionalThis parameter will be shown in Channel
freeTexts.indonesiastring(32)OptionalThis parameter will be shown in Channel
virtualAccountTrxTypestring(1)OptionalType of Virtual Account :
C : closed payment
O : open payment
feeAmount.valueString (16.2)OptionalFormat ISO 4217
feeAmount.currencystring(3)OptionalExample : IDR
expiredDatestring(25)OptionalExpiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00
additionalInfoObjectOptionalAdditional Information for custom use
Pro Tips

You can also learn about generatin signature here https://apidevportal.bi.go.id/snap/api-services/keamanan

Pro Tips

You can also show payment instruction link to your customer by using virtual_account_info.how_to_pay_page. If you wish to customize the UI for the payment instruction, you can use the virtual_account_info.how_to_pay_api.


2. Display payment code (virtual account number)

You can display the payment code to your customer by using virtual_account_info.virtual_account_number that you retrieved from the API response.


3. Acknowledge payment result

After the payment is being made by your customer, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU: