Sub Account
Learn more about how DOKU Sub Account can help you Power up your online payments here.
Integration steps
Here is the overview of how to integrate with DOKU Sub Account:
1. Create Account
To create the account, you will need to hit this API through your Backend:
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) |
|
API endpoint (Production) |
|
Here is the sample of request header to create the payment:
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 create the account:
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | Email identifier for your partner account
Allowed chars: |
|
| Mandatory | Type of account. Available Values: Default, Standard
Allowed chars: |
|
| Mandatory | Your partner name
Allowed chars: |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 201 |
Result | CREATED |
Here is the sample response header:
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:
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | Timestamp when the account was created |
|
| Mandatory | Timestamp when the account was updated |
|
| Mandatory | Same as the request |
|
| Mandatory | Same as the request |
|
| Mandatory | Same as the request |
|
| Mandatory | Sub Account status. In this state, it should be |
|
| Mandatory | ID of your Sub Account, use this id to create transactions on behalf of your Partner |
2. Accept Payment
To accept payment add this additional_info.account object into your payment request.
Request Header Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | Include this object for routing the payment |
|
| Mandatory | ID of your Account, use this to create transactions on behalf of your Account
Allowed chars: |
Sample Usage
Let's assume you are using the DOKU Direct integration. You can simply add these parameters into your API Initiate Payment:
3. Send Payout
You can request to send money from your accounts balance account for any disbursement purpose e.g: withdrawal, refund, paying vendor/supplier, etc
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) |
|
API endpoint (Production) |
|
Here is the sample of request header to create the payment:
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 for payouts:
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | The source of the payout
Allowed chars: |
|
| Mandatory | Payout amount
Allowed chars: |
|
| Mandatory | A unique reference for this Payout. Use this to reconcile your payout.
Allowed chars: |
|
| Mandatory | SWIFT CODE Bank Destination
Allowed chars: |
|
| Mandatory | Beneficiary Bank Account Number
Allowed chars: |
|
| Mandatory | Beneficiary Bank Account Name
Allowed chars: |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Here is the sample response header:
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:
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Payout status |
|
| Mandatory | Timestamp when Payout was created |
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
4. Transfer Intra Sub Account
The Transfers API allows you to transfer balances between your accounts.
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) |
|
API endpoint (Production) |
|
Here is the sample of request header to create the payment:
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 for payouts:
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | The source of the Transfer
Allowed chars: |
|
| Mandatory | The destination of the Transfer
Allowed chars: |
|
| Mandatory | Transfer amount
Allowed chars: |
|
| Mandatory | A unique reference for this Payout. Use this to reconcile your payout.
Allowed chars: |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Here is the sample response header:
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:
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Same as request |
|
| Mandatory | Timestamp when Payout was created |
5. Get Balances
Get Balance API allows you to retrieve the balance of your available and pending balance
API Request
Type | Value |
---|---|
HTTP Method | GET |
API endpoint (Sandbox) |
|
API endpoint (Production) |
|
Here is the sample of request header to get balance:
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 |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 200 |
Result | SUCCESS |
Here is the sample response header:
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:
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
|
| Mandatory | The balance remaining in your pending balance |
|
| Mandatory | The balance remaining in your available balance |
Last updated