transfers
The Transfers API allows you to transfer balances between your accounts.
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) | https://api-sandbox.doku.com/sac-merchant/v1/transfers |
API endpoint (Production) | https://api.doku.com/sac-merchant/v1/transfers |
Here is the sample of request header to create the payment:
Client-Id: MCH-0001-10791114622547
Request-Id: b6a465ea-bb65-48b2-a22b-3e8fb51cf22e
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 for payouts:
{
"transfer":
{
"origin" : "SAC-0000-0000000000001",
"destination" : "SAC-8014-1628130619289",
"amount" : 10000,
"invoice_number" : "INV/7274812"
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
transfer.origin | string | Mandatory | The source of the Transfer Allowed chars: alphabetic, numeric, special chars Max Length: 40 |
transfer.destination | string | Mandatory | The destination of the Transfer Allowed chars: alphabetic, numeric, special chars Max Length: 40 |
transfer.amount | string | Mandatory | Transfer amount Allowed chars: numeric Max Length: 12 |
transfer.invoice_number | string | Mandatory | A unique reference for this Payout. Use this to reconcile your payout. Allowed chars: alphabetic, numeric, special chars Max Length: 100 |
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:
Client-Id: MCH-0001-10791114622547
Request-Id: b6a465ea-bb65-48b2-a22b-3e8fb51cf22e
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
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:
{
"transfer": {
"invoice_number": "INV/7274812",
"origin": "SAC-0000-0000000000001",
"destination": "SAC-8014-1628130619289",
"amount": 10000,
"status": "SUCCESS",
"created": "2021-08-06 15:18:06.820153+07:00"
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
transfer.invoice_number | string | Mandatory | Same as request |
transfer.origin | string | Mandatory | Same as request |
transfer.destination | string | Mandatory | Same as request |
transfer.amount | string | Mandatory | Same as request |
transfer.created | string | Mandatory | Timestamp when Payout was created |