Skip to main content

doku-virtual-account-direct-inquiry

Here is the overview of how to integrate with DOKU:

  1. Setup Inquiry URL
  2. Generate payment code
  3. Receive inquiry request from DOKU
  4. Acknowledge payment result
Direct API - DOKU for Direct Inquiry Sequence Diagram
 Direct API -  DOKU Direct Inquiry Flow

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:

TypeValue
HTTP MethodPOST

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
ParameterDescription
Client-IdClient ID retrieved from DOKU Back Office
Request-IdUnique random string (max 128 characters) generated from DOKU side to protect duplicate request
Request-TimestampTimestamp 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
SignatureSecurity 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
ParameterTypeMandatoryDescription
service.idstringMandatoryValue: VIRTUAL_ACCOUNT
acquirer.idstringMandatoryValue: DOKU
channel.idstringMandatoryValue: VIRTUAL_ACCOUNT_DOKU
virtual_account_info.
virtual_account_number
numberMandatoryPayment code that is inquired by the customer
virtual_account_inquiry.datestringMandatoryTimestamp request on UTC time in ISO8601 format
virtual_account_inquiry.identifierarrayOptionalList 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:

TypeValue
HTTP Status for virtual_account_inquiry.status = success200
HTTP Status for virtual_account_inquiry.status = decline400
HTTP Status for virtual_account_inquiry.status = billing_already_paid400
HTTP Status for virtual_account_inquiry.status = billing_was_expired400
HTTP Status for virtual_account_inquiry.status = billing_not_found404
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
ParameterDescription
Client-IdSame as the request
Request-IdSame as the request
Response-TimestampTimestamp Response on UTC with format ISO8601 UTC+0 from Merchant
SignatureSignature 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
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatoryGenerated by merchant to identify the order and must unique per request
Allowed chars: alphabetic, numeric, special chars
Max length: 64
order.amountnumberMandatoryIn IDR currency and without decimal
Allowed chars: numeric
Max length: 12
order.min_amountnumberConditionalSend 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_amountnumberConditionalSend 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_typestringOptionalGenerated 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
stringMandatorySame as the request
virtual_account_info.info1stringOptionalAdditional 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.statusstringMandatoryPossible value: success, decline, billing_already_paid, billing_was_expired, billing_not_found
customer.namestringMandatoryCustomer name that will be displayed on acquirer channel when do inquiry
Allowed chars: alphabetic, numeric, special chars
Max length: 20
customer.emailstringOptionalCustomer email
Allowed chars: alphabetic, numeric, special chars
Max length: 128
additional_infoobjectOptionalMerchant 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: