doku-virtual-account-direct-inquiry
Here is the overview of how to integrate with DOKU:
- Setup
Inquiry URL
- Generate payment code
- Receive inquiry request from DOKU
- Acknowledge payment result
Direct API - DOKU 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
Generate payment is done in your system. 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": "DOKU"
},
"channel":{
"id": "VIRTUAL_ACCOUNT_DOKU"
},
"virtual_account_info":{
"virtual_account_number": "7889940000000001"
},
"virtual_account_inquiry":{
"date": "20210913100120",
"identifier": [
]
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
service.id | string | Mandatory | Value: VIRTUAL_ACCOUNT |
acquirer.id | string | Mandatory | Value: DOKU |
channel.id | string | Mandatory | Value: VIRTUAL_ACCOUNT_DOKU |
virtual_account_info. virtual_account_number | number | Mandatory | Payment code that is inquired by the customer |
virtual_account_inquiry.date | string | Mandatory | Timestamp request on UTC time in ISO8601 format |
virtual_account_inquiry.identifier | array | Optional | List of transaction identifier that coming from the acquiring. Merchant can save these data for reference |
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 |
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": {
"billing_type":"FIX_BILL",
"virtual_account_number": "7889940000000001",
"info1": "Merchant Demo Store"
},
"virtual_account_inquiry": {
"status": "success"
},
"customer": {
"name": "Taufik Ismail",
"email": "taufik@doku.com"
},
"additional_info": {
}
}
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 |
order.min_amount | number | Conditional | Send this parameter for Limited Amount Virtual Account to set the minimum amount need to be paid by the customer Allowed chars: numeric Max length: 12 |
order.max_amount | number | Conditional | Send this parameter for Limited Amount Virtual Account to set the maximum amount need to be paid by the customer Allowed chars: numeric Max length: 12 |
virtual_account_info.billing_type | string | Optional | Generated by Merchant to implement the open amount, close amount and limit amount features. For open amount, set this to NO_BILL . For close amount, set this to FIX_BILL Possible Value : FIX_BILL , NO_BILL Default value: FIX_BILL |
virtual_account_info. virtual_account_number | string | Mandatory | Same as the request |
virtual_account_info.info1 | string | Optional | Additional info that will be display on the acquirer channel (eg. ATM, Internet Banking) when customer do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 32 |
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: 20 |
customer.email | string | 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 |
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: