Host to Host Integration
1. Payment
API Endpoint
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Access token obtained from B2B2C API
Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9aAccess Token obtained from Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQReference No From Partner | max: 32 | Optional
INV-0001Token From DOKU | max: 64 | Conditional if merchant customer already has token from DOKU
de52e5820f4c381db88a1cf91d57b73eCustomer CPAN | max: 20 | Optional
9360001609987000000Customer OTP | min: 8 max: 8 | Optional
12345678Successful
Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7.
2005400Response Description. | min length: 1 | max length: 150
SuccessfulDOKU Reference No
REF-DOKU-0001Successful
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Access token obtained from B2B2C API
Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9aAccess Token obtained from Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQReference No From Partner | max: 32 | Optional
INV-0001Token From DOKU | max: 64 | Conditional if merchant customer already has token from DOKU
de52e5820f4c381db88a1cf91d57b73eCustomer CPAN | max: 20 | Optional
9360001609987000000Customer OTP | min: 8 max: 8 | Optional
12345678Successful
Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7.
2005400Response Description. | min length: 1 | max length: 150
SuccessfulDOKU Reference No
REF-DOKU-0001Successful
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Access token obtained from B2B2C API
Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9aAccess Token obtained from Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQReference No From Partner | max: 32 | Optional
INV-0001Token From DOKU | max: 64 | Conditional if merchant customer already has token from DOKU
de52e5820f4c381db88a1cf91d57b73eCustomer CPAN | max: 20 | Optional
9360001609987000000Customer OTP | min: 8 max: 8 | Optional
12345678Successful
Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7.
2005400Response Description. | min length: 1 | max length: 150
SuccessfulDOKU Reference No
REF-DOKU-0001Successful
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589Access token obtained from B2B2C API
Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9aAccess Token obtained from Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQReference No From Partner | max: 32 | Optional
INV-0001Token From DOKU | max: 64 | Conditional if merchant customer already has token from DOKU
de52e5820f4c381db88a1cf91d57b73eCustomer CPAN | max: 20 | Optional
9360001609987000000Customer OTP | min: 8 max: 8 | Optional
12345678Successful
Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7.
2005400Response Description. | min length: 1 | max length: 150
SuccessfulDOKU Reference No
REF-DOKU-0001Successful
2. Binding
B2B access token obtained from the Get B2B Token API (/authorization/v1/access-token/b2b)
Merchant's client ID registered with DOKU
merchant-client-id-001Unique reference ID for this request (per-day uniqueness required). Used for idempotency and tracing.
ext-bind-20260526-00001B2B access token obtained from the Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9...Request timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)
2026-05-26T10:00:00+07:00Pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+\-]\d{2}:\d{2}$HMAC-SHA512 asymmetric signature for request integrity verification
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Channel identifier determining the post-registration redirect behaviour.
DH(Direct Hosting, default): returns aredirectUrlpointing to the DOKU-hosted OTP page.H2H(Host-to-Host): no redirect; merchant handles the OTP flow independently.
DHExample: DHPossible values: Request body for card binding (registration)
Merchant's unique reference number for this binding request
BIND-REF-20260526-001AES-CBC encrypted JSON of the card data, Base64-encoded.
Encrypt the CardDataPayload object using the merchant's sharedKey provided by DOKU.
See the CardDataPayload schema for the plaintext structure.
U2FsdGVkX1+A1B2C3D4E5F6G7H8I9J0K...Merchant's unique identifier for the customer
CUST001Pattern: ^[a-zA-Z0-9]+$Optional journey or session ID for tracking the binding flow end-to-end
journey-bind-20260526-001Customer's phone number (used for OTP delivery during OTP verification step)
08123456789Card binding request accepted. The customer must complete OTP verification
to finalise the binding. Use redirectUrl (DH flow) or additionalInfo.authCode
(H2H flow) to proceed.
Response body for a successful card binding request
Response code: HTTP Status (3) + Service Code 01 (2) + Case Code (2).
Example: 2000100 = HTTP 200 + service 01 + case 00 (Successful).
2000100Human-readable response message
SuccessfulDOKU-generated reference number for this binding request
REF-KKI-20260526-001URL for OTP verification page hosted by DOKU.
Only present when CHANNEL-ID: DH. Merchant must redirect the customer here
to complete the binding via OTP entry.
https://app.doku.com/direct-debit/kki/binding/SESSION-ABC123Reusable token representing the bound credit card. Present only after OTP verification is successfully completed (final binding state). Use this token for subsequent payment requests.
eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UifQ...Charge token from the ALTO network (from the decrypted card data), if applicable
CHG-TOKEN-ABC123Request in progress (timeout from ALTO network; may still succeed asynchronously)
Bad request — missing or invalid fields
Authentication failure — invalid token or card data decryption failed
Forbidden — transaction not permitted or card restrictions
Not found — merchant, card, or transaction record not found
Conflict — duplicate transaction or duplicate token
Internal server error or external system malfunction
3. Unbinding
B2B access token obtained from the Get B2B Token API (/authorization/v1/access-token/b2b)
Merchant's client ID registered with DOKU
merchant-client-id-001Unique reference ID for this request (per-day uniqueness required)
ext-unbind-20260526-00001B2B access token obtained from the Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9...Request timestamp in ISO 8601 format (yyyy-MM-ddTHH:mm:ss+07:00)
2026-05-26T10:05:00+07:00Pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+\-]\d{2}:\d{2}$HMAC-SHA512 asymmetric signature for request integrity verification
a1b2c3d4e5f6...IP address of the end customer's device
103.31.4.0Channel identifier. Defaults to DH (Direct Hosting).
DH: may return aredirectUrlfor redirect-based unbinding flows.H2H: host-to-host; returns a plain success response without redirect.
DHExample: DHPossible values: Request body for card unbinding
The token to be deactivated. This is the bankCardToken value returned
in the binding response (or from the token list).
For KKI, this value is used as-is (no Base64 decoding is applied).
TOKEN-KKI-ABC123XYZUnbinding request accepted. The token is now in PENDING deactivation state.
Final deactivation is completed asynchronously via the ALTO/KKI network.
Response body for a successful card unbinding request
Response code: HTTP Status (3) + Service Code 05 (2) + Case Code (2).
Example: 2000500 = HTTP 200 + service 05 + case 00 (Successful).
2000500Human-readable response message
SuccessfulDOKU-generated reference number for this unbinding request
REF-UNBIND-20260526-001Bad request — missing or invalid fields
Authentication failure — invalid B2B token or token not found
Forbidden — transaction not permitted for the given card/account
Not found — active token not found for the given merchant and token ID
Internal server error
4. Refund
Online Refund

API Endpoint
Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format
2020-12-21T07:56:11.000ZAlgorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)
85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5Unique ID for a partner (DOKU'S Client ID)
821508239190Numeric String. Reference number that should be unique in the same day (request-id)
418075533589IP Address Customer | min: 10 max: 15 | Mandatory
192.168.1.1Access token obtained from B2B2C API
Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9aAccess Token obtained from Get B2B Token API
Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQReference No From Partner | AlphaNumeric | min: 32 max: 64 | Mandatory
INV0001External ID Purchase Transaction | max: 36 |
REQ-0001Reason from customer | max: 255
Request by CustomerPartner Refund No| max: 12 | Mandatory
INV-REF-0001Successful
Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7.
2000700Response Description. | min length: 1 | max length: 150
SuccessfulPartner Reference No Purchase Transaction
Ra7o1bLJAh2oV9eb33129stQc5xFm5s7Reference No Purchase Transaction From DOKU To Allo
Ra7o1bLJAh2oV9eb33129stQc5xFm5s7Refund No from DOKU To Allo
Ra7o1bLJAh2oV9eb33129stQc5xFm5s7Partner Refund No
Ra7o1bLJAh2oV9eb33129stQc5xFm5s7format: yyyy-MM-dd'T'HH:mm:ssXXX
2024-01-01T09:09:00.123Successful
Last updated