BNI VA Guide
DOKU has partnered with various banks and one of them is BNI to provide Virtual Account Payment. Learn more about how DOKU can help you integrate with BNI Virtual Account here.
Integration methods
There are two methods to integrate with BNI VA:
- Register: The VA number will be registered to DOKU and Acquirer will inquiry to our side when the customer make payment at the acquirer channel (ATM, mobile banking, internet banking, etc.)
- DOKU Generated VA: The VA number is generated by DOKU. Suitable for e-commerce business model.
- Merchant Generated VA: The VA number is generated by Merchant. Suitable for top up business model.
Integration steps
- DOKU Generate VA
- Merchant Generate VA
- Direct Inquiry
Here is the overview of how to integrate with Virtual Account:
- Generate payment code (virtual account number)
- Display payment code (virtual account number)
- Acknowledge payment result
Direct API - DOKU Generated Payment Code Virtual Account Sequence Diagram
1. Generate payment code (virtual account number)
To generate payment code, you will need to hit this API through your Backend:
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) | https://api-sandbox.doku.com/bni-virtual-account/v2/payment-code |
API endpoint (Production) | https://api.doku.com/bni-virtual-account/v2/payment-code |
Here is the sample of request header to generate payment code:
Client-Id: MCH-0001-10791114622547
Request-Id: d24a5644-6078-4249-8740-4a6dcd92df5a
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
Parameter | Description |
---|---|
Client-Id | Client ID retrieved from DOKU Back Office |
Request-Id | Unique random string (max 128 characters) generated from merchant side to protect duplicate request |
Request-Timestamp | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z |
Signature | Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature |
Here is the sample of request body to generate payment code:
{
"order": {
"invoice_number": "INV-1634463196",
"amount": 20000
},
"virtual_account_info": {
"expired_time": 60,
"biling_type" : "FIXED",
"info" : "Product detail here",
"merchant_unique_reference":"UNIQUE_000035"
},
"customer": {
"name": "Jessica Tessalonika",
"email": "jessica@doku.com"
},
"additional_info": {
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Generated by merchant to identify the order and must unique per request NOTES : Default transaction amount limit is IDR 50,000,000. If you need to create transaction with bigger amount, please request to sales team for assistant. Terms & conditions applied. Allowed chars: alphabetic, numeric, special chars Max length: 64 |
order.amount | number | Mandatory | In IDR currency and without decimal. Billing type already provides its own settings for the Amount type. You can check the details in the Billing type section. Allowed chars: numeric Max length: 12 |
virtual_account_info.expired_time | number | Optional | Virtual account expiration time in minutes format Allowed chars: numeric Maximum length: 8 Default value: 60 |
virtual_account_info.billing_type | string | Optional | 1. Billing type is types of features configurable by merchants to determine the payment amount settings for their customers when they Inquiry the transaction. Here are the types: a. MIN : Invoice/billing can be paid with greater than or equal to the requested amount.b. FIXED : Invoice/billing should be paid with exactly the same amount as requested. Validation : order.amount must be > 0 c. INSTALLMENT : Invoice/billing can be paid multiple times as long as paid amount is less than the requested amount and still active. 2. Billing type below is available upon request, please contact sales team for activation. a. OPEN_MIN : Invoice/billing can be paid greater than or equal to the requested amount multiple times as long as it is still active. Multiple payment can only be paid 3 times. b. OPEN_MAX : Invoice/billing can be paid less than or equal to the requested amount multiple times as long as it is still active. Multiple payment can only be paid 3 times. c. OPEN : Invoice/billing can be paid multiple times as long as it is still active. Validation : order.amount must be = 0. Multiple payment can only be paid 3 times. |
virtual_account_info.info | string | Optional | Additional info that will be display on BNI channel. Allowed chars: alphabetic, numeric, special chars Max length: 32 |
virtual_account_info.merchant_unique_reference | string | Mandatory | Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric Max length: 13 NOTES : a. If client id 22 character (eg. MCH-0411-1211992283648), then max char 13 char. b. If client id longer (eg. 23 char), merchant unique reference will be shorter (12 char) |
customer.name | string | Mandatory | Customer name that will be displayed on acquirer channel when do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 64 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 64 |
additional_info | object | Optional | Merchant can send additional data through this parameter and will be get the data when notify payment |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Client-Id: MCH-0001-10791114622547
Request-Id: d24a5644-6078-4249-8740-4a6dcd92df5a
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Response Header Explanation
Parameter | Description |
---|---|
Client-Id | Same as the request |
Request-Id | Same as the request |
Response-Timestamp | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
Signature | Signature generated by DOKU based on the response body |
Here is the sample of response body:
{
"order": {
"invoice_number": "INV-1634463196",
"amount": 20000
},
"virtual_account_info": {
"status": "ACTIVE",
"virtual_account_number": "8803300000000014",
"merchant_unique_reference": "UNIQUE_000035",
"created_date": "20211017163316",
"expired_date": "20211017173316",
"created_date_utc": "2021-10-17T09:33:16Z",
"expired_date_utc": "2021-10-17T10:33:16Z",
"how_to_pay_page": "https://sandbox.doku.com/how-to-pay/v2/bni-virtual-account/8803300000000014/XmmJ-mWUYNY6Cmp6GeF0qYvwvLsH57UOz_Ap6yqCEEM",
"how_to_pay_api": "https://api-sandbox.doku.com/bni-virtual-account/v2/how-to-pay-api/8803300000000014/XmmJ-mWUYNY6Cmp6GeF0qYvwvLsH57UOz_Ap6yqCEEM"
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Same as the request |
order.amount | number | Mandatory | Same as the request |
virtual_account_info.status | string | Optional | Status of the transaction. Possible values: ACTIVE, TIMEOUT, FAILED |
virtual_account_info.merchant_unique_reference | number | Mandatory | Same as the request |
virtual_account_info. virtual_account_number | string | Optional | Generated by DOKU that will be used by customer for doing a payment through acquirer channel (eg. ATM, Internet Banking) |
virtual_account_info.how_to_pay_page | string | Optional | Page URL that merchant can use to display how customer can complete the payment process through acquirer channel (eg. ATM, Internet Banking) |
virtual_account_info.how_to_pay_api | string | Optional | URL that merchant can parse to display customized how customer can complete the payment process through accquirer channel (eg. ATM, Internet Banking) |
virtual_account_info.created_date | string | Conditional | Date time of VA generated with the format of yyyyMMddHHmmss . The created date uses UTC+7 time |
virtual_account_info.expired_date | string | Conditional | Date time of VA will be expired with the format of yyyyMMddHHmmss . The expired date uses UTC+7 time. Use this to set the expiry order on merchant side |
virtual_account_info.created_date_utc | string | Conditional | Date time of VA generated in UTC format |
virtual_account_info.expired_date_utc | string | Conditional | Date time of VA will be expired in UTC. Use this to set the expiry order on merchant side |
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:
Here is the overview of how to integrate with Virtual Account:
- Generate payment code (virtual account number)
- Display payment code (virtual account number)
- Acknowledge payment result
Direct API - Merchant Generated Payment Code Virtual Account Sequence Diagram
1. Generate payment code (virtual account number)
To generate payment code, you will need to hit this API through your Backend:
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) | https://api-sandbox.doku.com/bni-virtual-account/v2/merchant-payment-code |
API endpoint (Production) | https://api.doku.com/bni-virtual-account/v2/merchant-payment-code |
Here is the sample of request header to generate payment code:
Client-Id: MCH-0001-10791114622547
Request-Id: 15022aab-444f-4b04-afa8-ddfce89432ec
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
Parameter | Description |
---|---|
Client-Id | Client ID retrieved from DOKU Back Office |
Request-Id | Unique random string (max 128 characters) generated from merchant side to protect duplicate request |
Request-Timestamp | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z |
Signature | Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature |
Here is the sample of request body to generate payment code:
{
"order": {
"invoice_number":"MINV20201231468",
"amount":150000
},
"virtual_account_info": {
"virtual_account_number": "8889933344445555",
"merchant_unique_reference": "101",
"expired_time": 60,
"info": "Online Shopping Store",
"billing_type": "FIXED"
},
"customer": {
"name": "Jessica Tessalonika",
"email": "jessica@doku.com"
},
"additional_info": {
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric, special chars Max length: 64 |
order.amount | number | Mandatory | In IDR currency and without decimal. Billing type already provides its own settings for the Amount type. You can check the details in the Billing type section. NOTES : Default transaction amount limit is IDR 50,000,000. If you need to create transaction with bigger amount, please request to sales team for assistant. Terms & conditions applied. Allowed chars: numeric Max length: 12 |
virtual_account_info.virtual_account_number | number | Mandatory | Generated by Merchant that will be used by customer for doing a payment through acquirer channel (eg. ATM, Internet Banking) Allowed Chars: numeric Fix Length : 16 |
virtual_account_info.expired_time | number | Optional | Virtual account expiration time in minutes format Allowed chars: numeric Maximum length: 8 Default value: 60 |
virtual_account_info.billing_type | string | Optional | 1. Billing type is types of features configurable by merchants to determine the payment amount settings for their customers when they Inquiry the transaction. Here are the types: a. MIN : Invoice/billing can be paid with greater than or equal to the requested amount.b. FIXED : Invoice/billing should be paid with exactly the same amount as requested. Validation : order.amount must be > 0 c. INSTALLMENT : Invoice/billing can be paid multiple times as long as paid amount is less than the requested amount and still active. 2. Billing type below is available upon request, please contact sales team for activation. a. OPEN_MIN : Invoice/billing can be paid greater than or equal to the requested amount multiple times as long as it is still active. Multiple payment can only be paid 3 times. b. OPEN_MAX : Invoice/billing can be paid less than or equal to the requested amount multiple times as long as it is still active. Multiple payment can only be paid 3 times. c. OPEN : Invoice/billing can be paid multiple times as long as it is still active. Validation : order.amount must be = 0. Multiple payment can only be paid 3 times. |
virtual_account_info.info | string | Optional | Additional info that will be display on BNI channel. Allowed chars: alphabetic, numeric, special chars Max length: 32 |
virtual_account_info.merchant_unique_reference | string | Mandatory | Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric Max length: 13 NOTES : a. If client id 22 character (eg. MCH-0411-1211992283648), then max char 13 char. b. If client id longer (eg. 23 char), merchant unique reference will be shorter (12 char) |
customer.name | string | Mandatory | Customer name that will be displayed on acquirer channel when do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 64 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 64 |
additional_info | object | Optional | Merchant can send additional data through this parameter and will be get the data when notify payment |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Client-Id: MCH-0001-10791114622547
Request-Id: 15022aab-444f-4b04-afa8-ddfce89432ec
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Response Header Explanation
Parameter | Description |
---|---|
Client-Id | Same as the request |
Request-Id | Same as the request |
Response-Timestamp | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
Signature | Signature generated by DOKU based on the response body |
Here is the sample of response body:
{
"order": {
"invoice_number":"MINV20201231468"
},
"virtual_account_info": {
"virtual_account_number":"8889933344445555",
"merchant_unique_reference":"101",
"how_to_pay_page":"https://sandbox.doku.com/bni-virtual-acccount/v1/how-to-pay-page/8890778911110000/q1-T9EG6LscmTJnx-UyfvkjfDz9te1ULN2Ba5dO01yk",
"how_to_pay_api":"https://api-sandbox.dokupay.com/bni-virtual-acccount/v1/how-to-pay-api/8890778911110000/q1-T9EG6LscmTJnx-UyfvkjfDz9te1ULN2Ba5dO01yk",
"created_date_utc":"2020-08-11T08:45:42Z",
"expired_date_utc":"2020-08-12T08:45:42Z"
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Same as the request |
virtual_account_info. virtual_account_number | string | Mandatory | Same as the request |
virtual_account_info. merchant_unique_reference | string | Mandatory | Same as the request |
virtual_account_info.how_to_pay_page | string | Optional | Page URL that merchant can use to display how customer can complete the payment process through acquirer channel (eg. ATM, Internet Banking) |
virtual_account_info.how_to_pay_api | string | Optional | URL that merchant can parse to display customized how customer can complete the payment process through accquirer channel (eg. ATM, Internet Banking) |
virtual_account_info.created_date_utc | string | Conditional | Date time of VA generated in UTC format |
virtual_account_info.expired_date_utc | string | Conditional | Date time of VA will be expired in UTC. Use this to set the expiry order on merchant side |
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:
Here is the overview of how to integrate with BNI:
- Setup
Inquiry URL
- Generate payment code
- Receive inquiry request from DOKU
- Acknowledge payment result
Direct API - BNI for Direct Inquiry Sequence Diagram
1. Setup Inquiry URL
To receive the inquiry request from DOKU. You must set your Inquiry URL
to DOKU. Please contact our team for the setup.
Please inform the Inquiry URL
for Sandbox environment and Production environment.
2. Generate Payment code
Generated by DOKU in sequence for reference purpose. The payment code length maximum is 16
digits.
3. Receive inquiry request from DOKU
API Request
DOKU will hits your Inquiry URL
with the following API request:
Type | Value |
---|---|
HTTP Method | POST |
Here is the sample of request header that DOKU generated for inquiry:
Client-Id: MCH-0001-10791114622547
Request-Id: 5b8e438f-fac1-4103-9e0e-ebfdc38b5acb
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
Parameter | Description |
---|---|
Client-Id | Client ID retrieved from DOKU Back Office |
Request-Id | Unique random string (max 128 characters) generated from DOKU side to protect duplicate request |
Request-Timestamp | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z |
Signature | Security parameter that needs to be verified on merchant Backend to ensure that the request is coming from DOKU. Please refer to this section to generate the signature |
Here is the sample of request body that DOKU will send to defined Inquiry URL
:
{
"service": {
"id":"VIRTUAL_ACCOUNT"
},
"acquirer": {
"id":"BNI"
},
"channel": {
"id":"VIRTUAL_ACCOUNT_BNI"
},
"virtual_account_info": {
"virtual_account_number":"780300000000001234",
"merchant_unique_reference": "101",
"identifier":[
{
"name": "BILLING_NUMBER",
"value": "3280300000000001234"
}
]
},
"virtual_account_inquiry": {
"date":"2020-08-11T08:45:42Z"
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
service.id | string | Mandatory | Value: VIRTUAL_ACCOUNT |
acquirer.id | string | Mandatory | Value: BNI |
channel.id | string | Mandatory | Value: VIRTUAL_ACCOUNT_BNI |
virtual_account_info.virtual_account_number | number | Mandatory | Generated by DOKU in sequence for reference purpose. Max length: 16 |
virtual_account_info.merchant_unique_reference | string | Mandatory | Generated by DOKU in sequence for reference purpose. Max length: 30 |
virtual_account_info.identifier | array | Mandatory | List of transaction identifier that coming from the acquiring. Merchant can save these data for reference. BILLING_NUMBER (N(19)) : Sent by BNI as payment code (customer will use this and input to payment channel instead of VA Number). This will be sent to merchant in inquiry request as a part of virtual_account_info.identifier object |
virtual_account_inquiry.date | string | Mandatory | Timestamp request on UTC time in ISO8601 format |
API Response
After DOKU hits your Inquiry URL
with the above API request, you must give the following response:
Type | Value |
---|---|
HTTP Status for virtual_account_inquiry.status = success | 200 |
HTTP Status for virtual_account_inquiry.status = decline | 400 |
HTTP Status for virtual_account_inquiry.status = billing_already_paid | 400 |
HTTP Status for virtual_account_inquiry.status = billing_was_expired | 400 |
HTTP Status for virtual_account_inquiry.status = billing_not_found | 404 |
HTTP Status for virtual_account_inquiry.status = invalid_signature | 401 |
Client-Id: MCH-0001-10791114622547
Request-Id: 5b8e438f-fac1-4103-9e0e-ebfdc38b5acb
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Response Header Explanation
Parameter | Description |
---|---|
Client-Id | Same as the request |
Request-Id | Same as the request |
Response-Timestamp | Timestamp Response on UTC with format ISO8601 UTC+0 from Merchant |
Signature | Signature generated by Merchant based on the response body. Please refer to this section to generate the signature |
Here is the sample of response body:
{
"order": {
"invoice_number": "MINV20201231468",
"amount": 150000
},
"virtual_account_info": {
"virtual_account_number": "780300000000001234",
"merchant_unique_reference": "101",
"info": "Online Shopping Store",
"identifier":[
{
"name": "BILLING_NUMBER",
"value": "3280300000000001234"
}
]
},
"virtual_account_inquiry": {
"status":"success"
},
"customer": {
"name": "Jessica Tessalonika",
"email": "jessica@doku.com",
"phone": "081939815484"
},
"additional_info": {
"addl_label_1": "",
"addl_label_2": "",
"addl_label_3": "",
"addl_value_1": "",
"addl_value_2": "",
"addl_value_3": "",
"addl_label_1_en": "",
"addl_label_2_en": "",
"addl_label_3_en": "",
"addl_value_1_en": "",
"addl_value_2_en": "",
"addl_value_3_en": ""
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric, special chars Max length: 64 |
order.amount | number | Mandatory | In IDR currency and without decimal Allowed chars: numeric Max length: 12 |
virtual_account_info.virtual_account_number | string | Mandatory | Same as the request |
virtual_account_info.merchant_unique_reference | string | Mandatory | Same as the request |
virtual_account_info.info | string | Optional | This parameter providesome additional information about the invoice/billing, and will be displayed on the invoice email notification. Allowed chars: alphabetic, numeric, special chars Allowed chars: alphabetic, numeric, special chars Max length: 32 |
virtual_account_info.identifier | string | Optional | List of transaction identifier that coming from the acquiring. Merchant can save these data for reference. BILLING_NUMBER (N(19)) : Sent by BNI as payment code (customer will use this and input to payment channel instead of VA Number). This will be sent to merchant in inquiry request as a part of virtual_account_info.identifier object |
virtual_account_inquiry.status | string | Mandatory | Possible value: success , decline , billing_already_paid , billing_was_expired , billing_not_found |
customer.name | string | Mandatory | Customer name that will be displayed on acquirer channel when do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 64 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 128 |
customer.phone | number | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 128 |
additional_info | object | Optional | Merchant can send additional data through this parameter and will be get the data in the HTTP Notification |
additional_info.addl_label | string | Optional | Additional info that will be display on the acquirer channel when customer do inquiry. Please add numbering as per sample above. Max length: 15 |
additional_info.addl_value | integer | Optional | Additional info that will be display on the acquirer channel when customer do inquiry. Please add numbering as per sample above. Max length: 17 |
additional_info.addl_label_en | string | Optional | This parameter provide some additional information about the invoice/billing, and will be displayed on BNI payment channel with english version.This param only can filled, if addl_label has been filled.If this parameter is omitted, the parameter value of addl_label will be thrown to payment channel. Please add numbering as per sample above. Max length: 15 |
additional_info.addl_value_en | integer | Optional | This parameter provide some additional information about the invoice/billing, and will be displayed on BNI payment channel with english version.This param only can filled, if addl_value has been filled.If this parameter is omitted, the parameter value of addl_label will be thrown to payment channel. Please add numbering as per sample above. Max length: 17 |
4. 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:
Additional features
We provide various additional features to suited your needs. Learn more here.
Update and Cancel Virtual Account
If you wish to update your virtual account such as, update the amount, update the expiry time, customer details, and etc. You can do that by hitting the API with PATCH
method:
API Request
Type | Value |
---|---|
HTTP Method | PATCH |
API endpoint (Sandbox) | https://api-sandbox.doku.com/bni-virtual-account/v2/payment-code |
API endpoint (Production) | https://api.doku.com/bni-virtual-account/v2/payment-code |
Here is the sample of request header to update payment code:
Client-Id: MCH-0001-10791114622547
Request-Id: 2dc5985e-adaa-4f82-b126-b09e9006da14
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
Parameter | Description |
---|---|
Client-Id | Client ID retrieved from DOKU Back Office |
Request-Id | Unique random string (max 128 characters) generated from merchant side to protect duplicate request |
Request-Timestamp | Timestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z |
Signature | Security parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature |
Here is the sample of request body to update payment code:
Cancel Virtual Account
To cancel a virtual account, simply set virtual_account_info.status
to DELETE
{
"order": {
"invoice_number": "INV-1644465041",
"amount": 150000
},
"virtual_account_info": {
"virtual_account_number": "8803300000000174",
"billing_type" :"FIXED",
"merchant_unique_reference": "UNIQUE_00256",
"status": "DELETE",
"expired_time": 120,
"reusable_status": false
},
"customer": {
"name": "Anton Budiman",
"email": "anton@example.com"
},
"additional_info": {
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Must be same like invoice_number on Get Payment Code API or Register Payment Code |
order.amount | number | Optional | In IDR currency and without decimal. |
virtual_account_info.virtual_account_number | number | Mandatory | Must be same like virtual_account_number on Get Payment Code API or Register Payment Code. |
virtual_account_info.merchant_unique_reference | string | Mandatory | Must be same like merchant_unique_reference on Get Payment Code API or Register Payment Code. |
virtual_account_info.expired_time | number | Optional | Virtual account expiration time in minutes format |
virtual_account_info | string | Optional | Additional info that will be display on BNI VA channel |
virtual_account_info.billing_type | string | Mandatory | Must be same like billing_type on Get Payment Code API or Register Payment Code |
customer.name | string | Optional | Customer name |
customer.email | string | Optional | Customer Email |
customer.phone | string | Optional | Customer Phone |
additional_info | string | Optional | Merchant can send additional data through this parameter and will be get the data when notify payment |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Client-Id: MCH-0001-10791114622547
Request-Id: 09e0defe-a071-45b3-9feb-ac134374628c
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Response Header Explanation
Parameter | Description |
---|---|
Client-Id | Same as the request |
Request-Id | Same as the request |
Response-Timestamp | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
Signature | Signature generated by DOKU based on the response body |
Here is the sample of response body:
{
"order": {
"invoice_number": "INV-1644465041",
"amount": "150000"
},
"virtual_account_info": {
"status": "ACTIVE",
"virtual_account_number": "8803300000000174",
"merchant_unique_reference": "UNIQUE_00256",
"created_date": "20220210105042",
"expired_date": "20220210125715",
"created_date_utc": "2022-02-10T03:50:42Z",
"expired_date_utc": "2022-02-10T05:57:15Z"
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Same as the request |
virtual_account_info.virtual_account_number virtual_account_number | number | Mandatory | Same as the request |
virtual_account_info.merchant_unique_reference | string | Mandatory | Same as the request |
virtual_account_info.created_date_utc | string | Optional | Date time of VA generated in UTC format |
virtual_account_info.expired_date_utc | string | Optional | Date time of VA will be expired in UTC. Use this to set the expiry order on merchant side |
Split Settlement
If you are a platform or a marketplace, you can use this feature to settle the funds to your sellers or partners programmatically, save many operational efforts.
What's next?
You can test your payment through our Payment Simulator. Learn more here.