Skip to main content

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

  1. Obtain payment.url on Backend
  2. Display Direct Transfer Page on Frontend
  3. Create test payment
  4. Acknowledge payment result
Direct Transfer Sequence Diagram
 Direct Transfer Corporate - Merchant Flow

1. Obtain Payment URL on Backend

To obtain Direct Transfer you need to hit this API through your Backend :

API Request

TypeValue
HTTP MethodPOST
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
ParameterDescription
Client-IdClient ID retrieved from DOKU Back Office
Request-IdUnique random string (max 128 characters) generated from merchant 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 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
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.item_namestringOptionalName of the product item
Allowed chars: alphabetic, numeric, spesial chars
Max length: 255
order.customer_addressstringOptionalCustomer address
Allowed chars: alphabeticc,numeric,spesial chars
Max length: 400
customer.namestringMandatoryCustomer name
Allowed chars: alphabetic
Max length: 255
customer.emailstringOptionalCustomer email
Allowed chars: alphabetic, numeric, special chars
Max length: 128
additional_info.hold_settlementbooleanOptionalFor hold and release settlement feature. More details in here
additional_info.report.keystringOptionalFor custom your settlement report. More details in here
additional_info.report.valuestringOptionalFor custom your settlement report. More details in here
additional_info.settlement.bank_account_settlement_idstringOptionalFor split settlement feature. More details in here
additional_info.settlement.valuestringOptionalFor split settlement feature. More details in here
additional_info.settlement.typestringOptionalFor split settlement feature. More details in here
additional_info.account.idstringOptionalID of your Sub Account, use this id to create transactions on behalf of your Partner. More details in here

API Response

TypeValue
HTTP Status200
ResultSUCCESS
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
ParameterDescription
Client-IdSame as the request
Request-IdSame as the request
Response-TimestampTimestamp Response on UTC with format ISO8601 UTC+0 from DOKU
SignatureSignature 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
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
order.amountnumberMandatorySame as the request
order.item_namestringOptionalSame as the request
order.customer_addressstringOptionalSame as the request
customer.namestringMandatorySame as the request
customer.emailstringOptionalSame as the request
direct_transfer_info.created_datestringMandatoryPayment 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_numbernumberMandatoryMerchant’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_pagestringOptionalPage 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_namestringMandatoryMerchant’s account name registered on acquirer
direct_transfer_info.expired_datestringMandatoryDate 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_amountnumberMandatoryThe amount the customer has to pay. It is the sum of order amount and unique amount
direct_transfer_info.unique_amountnumberMandatoryUnique 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:

Display Payment URL

Create Test Payment

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

Display Payment URL

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.