bni-virtual-account-create-va
Here is the endpoint of BNI Virtual Account :
API Request
Type | Value |
---|---|
Service Code | 27 |
HTTP Method | POST |
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
Parameter | Data Type | Type | Description |
---|---|---|---|
X-TIMESTAMP | string | Mandatory | Client's current local time with format : YYYY-MM-DDTHH:mm:ssZD |
X-SIGNATURE | string | Mandatory | Represents 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-ID | string | Mandatory | Client Id for merchant that generated by DOKU |
X-EXTERNAL-ID | string | Mandatory | Numeric String. Reference number that should be unique in the same day (Request Id) |
CHANNEL-ID | string(5) | Mandatory | VA004 |
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
Parameter | Type | Mandatory | Description |
---|---|---|---|
partnerServiceId | string(8) | Mandatory | This parameter is similar to company code/BIN, 8 digit left padding space. |
customerNo | string(20) | Mandatory | Unique number (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo |
virtualAccountNo | string(28) | Mandatory | partnerServiceId (8 digit left padding 0) + customerNo (up to 20 digits). partnerServiceId + customerNo or virtualAccountNo |
virtualAccountName | string(255) | Mandatory | Customer Name |
virtualAccountEmail | string(255) | Optional | Customer Email |
virtualAccountPhone | string(30) | Optional | Customer Phone, Format: 62xxxxxxxxx xxxx |
trxId | string(64) | Mandatory | Transaction ID in Partner system |
totalAmount.value | string(8) | Optional | Transaction Amount. Total Amount with 2 decimal, format ISO 4217 |
totalAmount.Currency | string(3) | Optional | Currency. Example: IDR |
virtualAccountTrxType | string(1) | Optional | Type of Virtual Account : C : closed paymentO : open payment |
expiredDate | string(25) | Optional | Expiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00 |
additionalInfo | Object | Optional | Additional 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
Parameter | Data Type | Type | Description |
---|---|---|---|
X-Timestamp | string | Mandatory | Client's current local time with format YYYY-MM-DDTHH:mm:ssZ |
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
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"
}
}
}
Type | Value |
---|---|
HTTP Status | 404 |
Result | FAILED |
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
Parameter | Type | Mandatory | Description |
---|---|---|---|
responseCode | string(7) | Mandatory | Response Code : HTTP status code + service code + case code |
responseMessage | string(150) | Mandatory | Response Description |
virtualAccountData.partnerServiceId | string(8) | Mandatory | similar to company code, 8 digit left padding space |
virtualAccountData.customerNo | String (20) | Optional | Unique number (up to 20 digits). partnerServiceId + customerNo = virtualAccountNo |
virtualAccountData.virtualAccountNo | String (28) | Optional | partnerServiceId (8 digit left padding 0) + customerNo up to 20 digits). |
virtualAccountData.virtualAccountName | string(255) | Mandatory | Customer Name |
virtualAccountData.virtualAccountEmail | string(255) | Optional | Customer Email |
virtualAccountData.virtualAccountPhone | string(30) | Optional | Customer Phone, Format: 62xxxxxxxxx xxxx |
virtualAccountData.trxId | string(64) | Mandatory | Transaction ID in Partner system |
virtualAccountData.totalAmount.value | string(8) | Optional | Transaction Amount. Total Amount with 2 decimal, format ISO 4217 |
virtualAccountData.totalAmount.Currency | string(3) | Optional | Currency. Example: IDR |
virtualAccountData.howToPayInfo.howToPayPage | ANS(256) | Optional | Step by step that will be used by customer for how to doing a payment |
virtualAccountData.howToPayInfo.howToPayApi | ANS(256) | Optional | Step by step that will be used by customer for how to doing a payment |
virtualAccountTrxType | string(1) | Optional | Type of Virtual Account : C : closed paymentO : open payment |
expiredDate | string(25) | Optional | Expiration date for Virtual Account. ISO-8601. Example: 2020-12- 31T23:59:59-07:00 |
additionalInfo | Object | Optional | Additional Information for custom use |