Skip to main content

Account Binding

DOKU has partnered with various banks and e-wallet to provide Direct Debit SNAP Payment Service. Learn more about how DOKU can help you integrate with Direct Debit SNAP here.


Requirements

Before start integration, you must have retrieved credentials from Acquirer.

If you don't have the credentials yet, we can help to facilitate you to get one. Here is the flow to get credentials:

Direct API - BRI Direct Debit Activation
 Direct API - BRI Direct Debit Credential Request Step 1 Direct API - BRI Direct Debit Credential Request Step 2
  1. Login to DOKU Back Office
  2. Go to Configuration > Direct Debit
  3. Select Specific Direct Debit SNAP Channel (Example: OVO, CIMB, BRI, etc) and click Activate button
  4. Input Consumer Key
  5. Input Consumer Secret
  6. Click Activate button

Congratulations! You are now ready for the integration.


Integration steps

Here is the overview of how to integrate with Direct Debit:

  1. Account Binding (tokenization)
  2. Check Balance (optional for some acquirer)
  3. Create payment using the token
  4. Acknowledge payment result

Optional but recommended to have:

  1. Direct Debit Status Inquiry
  2. Unbinding

Account Binding (Tokenization)

To perform Account Binding, you will need to hit this API through your Backend:

Direct API - Direct Debit Account Binding
 Direct API - Direct Debit Account Binding

API Request

TypeValueDescription
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/direct-debit/[acquirer-name]/v1.0/registration-account-bindingPossible Values for [acquirer-name] : ovo, cimb, allobank, bri
API endpoint (Production)https://api.doku.com/direct-debit/[acquirer-name]/v1.0/registration-account-bindingPossible Values for [acquirer-name] : ovo, cimb, allobank, bri

Here is the sample of request header to perform Account Binding:

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Request Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) with formula
stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of request body to perform Account Binding:

{
"phoneNo": "0857957868761",
"additionalInfo": {
"custIdMerchant": "TEST-123",
"customerName": "Paulus",
"email": "john.doe@doku.com",
"idCard": "12345",
"country": "Indonesia",
"address": "Bali",
"dateOfBirth": "19990101",
"successRegistrationUrl": "https://sandbox.doku.com/bo/login/",
"failedRegistrationUrl": "https://www.seleniumeasy.com/test",
"deviceModel": "iphone12",
"osType": "ios",
"channel": "app"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
phoneNostring (16)MandatoryPhone number registered to user's account in acquirer.
Allowed chars: alphabetic, numeric, special chars
Min Length: 9 , Max Length : 16. Start with 62
additionalInfoobjectMandatory
additionalInfo.custIdMerchantstring (64)MandatoryCustomer ID
Allowed chars: alphabetic, numeric, special chars
additionalInfo.customerNamestring (70)OptionalCustomer Name.
additionalInfo.emailstring (254)ConditionalCustomer's email
Notes:
Mandatory for Allobank, Optional for other Acquirer
additionalInfo.idCardstring (20)OptionalCustomer Identity Card number (KTP) for our risk engine assessment
additionalInfo.countrystring(60)OptionalCustomer's country of residence
additionalInfo.addressstring (255)OptionalCustomer's address
additionalInfo.dateOfBirthdateOptionalyyyymmdd
additionalInfo.successRegistrationUrlstring (255)Mandatoryredirect URL in case of binding request was a success
additionalInfo.failedRegistrationUrlstring (255)Mandatoryredirect URL in case of binding request was a failure
additionalInfo.deviceModelstring (64)ConditionalDevice's model the customer is accessing the request from.
Notes: Mandatory for Allobank, Optional for other Acquirer
additionalInfo.osTypestring (64)ConditionalDevice's operating system the customer is accessing the request from
Notes:
Mandatory for Allobank, Optional for other Acquirer
additionalInfo.channelstringConditionalChannel of from what platform the customer is accessing this request from
Notes:
Mandatory for Allobank, Optional for other Acquirer

API Response

After hitting the above API request, DOKU will give the response.

TypeValue
HTTP Status200
ResultCREATED

Here is the sample response header:

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Response Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of response body:

{
"responseCode": "2000700",
"responseMessage": "Successful",
"referenceNo": "",
"redirectUrl": "https://app.doku.com/direct-debit/ui/binding/2238230713001534401107183161486001168389",
"additionalInfo": {
"custIdMerchant": "CUSTOMER_OVOxDOKU",
"accountStatus": "PENDING",
"authCode": "1234123412341234"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
responseCodestring (7)MandatoryResponse code as defined in SNAP Regulation
responseMessagestring (150)MandatoryResponse message as defined in SNAP Regulation
referenceNostring (64)Optionalaccount binding unique identifier on acquirer's side. Notes: will be returned to merchant if acquirer returns it
redirectUrlstring (2048)MandatoryURL to redirect user to Acquirer's webview to let customer finish OTP
additionalInfoobjectMandatory
additionalInfo.custIdMerchantstring (64)OptionalCustomer's ID
additionalInfo.accountStatusstringOptionalCustomer's account status. Value : PENDING
additionalInfo.authCodestring(128)MandatoryCustomer's auth code