Direct Transfer Integration Guide
Preparation
Make sure you already have a Client ID & Secret Key to continue this section. Please refer to this section.
Integration Steps
- Obtain
payment.url
on Backend - Display Direct Transfer Page on Frontend
- Create test payment
- Acknowledge payment result
Direct Transfer Sequence Diagram

1. Obtain Payment URL on Backend
To obtain Direct Transfer you need to hit this API through your Backend :
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) | https://api-sandbox.doku.com/bca-direct-transfer/v1/order |
API endpoint (Production) | https://api.doku.com/bca-direct-transfer/v1/order |
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": "INV-20210124-0001",
"amount": 10000,
"item_name": "White T-Shirt",
"customer_adress" : "Menara Mulia, Jakarta Selatan"
},
"customer": {
"name": "Anton Budiman",
"email": "anton@example.com"
},
"additional_info": {
"hold_settlement": false,
"report": [
{
"key": "string",
"value": "string"
}
],
"settlement":[
{
"bank_account_settlement_id": "SBA-0403-1633576353470",
"value": 50,
"type":"PERCENTAGE"
},
{
"bank_account_settlement_id": "SBA-0004-20211007102624009",
"value": 30,
"type":"PERCENTAGE"
},
{
"bank_account_settlement_id": "SBA-0004-20211007102634009",
"value": 20,
"type":"PERCENTAGE"
}
],
"account": {
"id": "SAC-0001234234"
}
}
}
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. Allowed chars: numeric Max length: 12 |
order.item_name | string | Optional | Name of the product item Allowed chars: alphabetic, numeric, spesial chars Max length: 255 |
order.customer_address | string | Optional | Customer address Allowed chars: alphabeticc,numeric,spesial chars Max length: 400 |
customer.name | string | Mandatory | Customer name Allowed chars: alphabetic Max length: 255 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 128 |
additional_info.hold_settlement | boolean | Optional | For hold and release settlement feature. More details in here |
additional_info.report.key | string | Optional | For custom your settlement report. More details in here |
additional_info.report.value | string | Optional | For custom your settlement report. More details in here |
additional_info.settlement.bank_account_settlement_id | string | Optional | For split settlement feature. More details in here |
additional_info.settlement.value | string | Optional | For split settlement feature. More details in here |
additional_info.settlement.type | string | Optional | For split settlement feature. More details in here |
additional_info.account.id | string | Optional | ID of your Sub Account, use this id to create transactions on behalf of your Partner. More details in here |
API 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": "INV-20210124-0001",
"amount": 10000,
"item_name": "White T-Shirt",
"customer_adress" : "Menara Mulia, Jakarta Selatan"
},
"customer": {
"name": "Anton Budiman",
"email": "anton@example.com"
},
"direct_transfer_info": {
"created_date": "2021-10-18T07:15:15Z",
"account_number": "0201245680",
"how_to_pay_page": "https://app-sandbox.doku.com/direct-transfer/v1/how-to-pay?id=iTFRhfwnY%2F2YIwInQxSLcQ%3D%3d%7CDEV-AA%7C2%7C2%7CHe7vSVOPLaf%2FuNzhvrH%2FQ%3D%3D",
"how_to_pay_api": "https://api-sandbox.doku.com/direct-transfer/v1/how-to-pay?id=iTFRhfwnY%2F2YIwInQxSLcQ%3D%3d%7CDEV-AA%7C2%7C2%7CHe7vSVOPLaf%2FuNzhvrH%2FQ%3D%3D",
"account_name": "PT Nusa Satu Inti Artha",
"expired_date": "2021-10-18T10:15:18Z",
"total_amount": 10543,
"unique_amount" : 543
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Same as the request |
order.amount | number | Mandatory | Same as the request |
order.item_name | string | Optional | Same as the request |
order.customer_address | string | Optional | Same as the request |
customer.name | string | Mandatory | Same as the request |
customer.email | string | Optional | Same as the request |
direct_transfer_info.created_date | string | Mandatory | Payment order date generated by DOKU with SimpleDateFormat yyyy-MM-dd’T’HH:mm:ss’Z’ . The created date uses UTC+7 time |
direct_transfer_info.account_number | number | Mandatory | Merchant’s account number registered on acquirer that will be used by customer for doing a payment through acquirer channel (eg. ATM, Internet Banking, Mobile Banking) |
direct_transfer_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, Mobile Banking) |
direct_transfer_info.account_name | string | Mandatory | Merchant’s account name registered on acquirer |
direct_transfer_info.expired_date | string | Mandatory | Date and time when Direct Transfer will expire exactly 3 hours after payment created date with SimpleDateFormat yyyy-MM-dd’T’HH:mm:ss’Z’ . The created date uses UTC+7 time. |
direct_transfer_info.total_amount | number | Mandatory | The amount the customer has to pay. It is the sum of order amount and unique amount |
direct_transfer_info.unique_amount | number | Mandatory | Unique amount generated from 3-last digit order amount as an identifier. |
Display Payment URL ( Direct Transfer Page)
You can display payment URL as an iFrame using how_to_pay_page
or as a dedicated page to your customer by using how_to_pay_api
that you retrieved from API Response. Here is the sample of Direct Transfer on the iFrame:

Create Test Payment
You can try the payment with Direct Transfer like the example on Direct Transfer Summary Report page below :

The status will be updated as SUCCESS
if the customer has finished the payment process.
Temporary Simulator
If you want to simulate the payment, you can input the amount in the request payment with 10000
, so our system can automate simulate the payment with success transaction.
Acknowledge Payment Result
After the payment is made by your customer, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU here
View your transaction
You can monitor all transactions you have from various payment channel services you have activated including Direct Transfers. Learn more about it here.
Invoice
You can learn more about the invoice you need to pay on here.
What's next?
Congratulations! Now you are ready to go live. Make sure you have registered to our production environment and the business has been approved by our team.