Host to Host Integration
Integration Steps
Overview of integration process with KKI Integration
1. Payment
Merchant can request for payment by requesting this API
Payment Flow
API Endpoint
HTTP Method
POST
API Sandbox
API Production
Path
.../direct-debit/core/v1/debit/payment-host-to-host
Sample of Request Header, Request Body and Response Body
Notes:
Parameter with (*) is mandatory
Paramater without (*) is optional/conditional
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-0001POST /direct-debit/core/v1/debit/payment-host-to-host HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 410
{
"partnerReferenceNo": "INV-0001",
"bankCardToken": "de52e5820f4c381db88a1cf91d57b73e",
"chargeToken": 9360001609987000000,
"otp": 12345678,
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"channel": "KARTU_KREDIT_INDONESIA",
"isBindAndPay": "N",
"paymentType": "RECURRING",
"customer": {
"customerId": "CUST-001",
"customerName": "DOKU Merchant"
},
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
}
]
}
}Successful
{
"responseCode": "2005400",
"responseMessage": "Successful",
"referenceNo": "REF-DOKU-0001"
}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-0001POST /direct-debit/core/v1/debit/payment-host-to-host HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 405
{
"partnerReferenceNo": "INV-0001",
"bankCardToken": "de52e5820f4c381db88a1cf91d57b73e",
"chargeToken": 9360001609987000000,
"otp": 12345678,
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"channel": "KARTU_KREDIT_INDONESIA",
"isBindAndPay": "Y",
"paymentType": "SALE",
"customer": {
"customerId": "CUST-001",
"customerName": "DOKU Merchant"
},
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
}
]
}
}Successful
{
"responseCode": "2005400",
"responseMessage": "Successful",
"referenceNo": "REF-DOKU-0001"
}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-0001POST /direct-debit/core/v1/debit/payment-host-to-host HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 405
{
"partnerReferenceNo": "INV-0001",
"bankCardToken": "de52e5820f4c381db88a1cf91d57b73e",
"chargeToken": 9360001609987000000,
"otp": 12345678,
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"channel": "KARTU_KREDIT_INDONESIA",
"isBindAndPay": "N",
"paymentType": "SALE",
"customer": {
"customerId": "CUST-001",
"customerName": "DOKU Merchant"
},
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
}
]
}
}Successful
{
"responseCode": "2005400",
"responseMessage": "Successful",
"referenceNo": "REF-DOKU-0001"
}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-0001POST /direct-debit/core/v1/debit/payment-host-to-host HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 410
{
"partnerReferenceNo": "INV-0001",
"bankCardToken": "de52e5820f4c381db88a1cf91d57b73e",
"chargeToken": 9360001609987000000,
"otp": 12345678,
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"channel": "KARTU_KREDIT_INDONESIA",
"isBindAndPay": "N",
"paymentType": "RECURRING",
"customer": {
"customerId": "CUST-001",
"customerName": "DOKU Merchant"
},
"lineItems": [
{
"name": "masker",
"price": "5000.00",
"quantity": 1
}
]
}
}Successful
{
"responseCode": "2005400",
"responseMessage": "Successful",
"referenceNo": "REF-DOKU-0001"
}2. Binding
This endpoint is used to tokenize a customer's CPAN without charging any amount, compared to the payment with Tokenization API which need to charges some amount to the Customer.
Registers a credit card for a customer under a merchant account.
Flow:
Merchant submits the encrypted card data along with customer information.
The system decrypts the card data, validates it against the ALTO/KKI network, and creates an
AcquirerToken.On success, a
redirectUrlis returned (whenCHANNEL-ID: DH) pointing to the OTP verification page.The customer completes OTP verification, which finalises the binding and issues a
bankCardToken.
Card Data Encryption: Encrypt the CardDataPayload JSON object using AES-CBC with the merchant's sharedKey. The resulting Base64-encoded ciphertext is submitted as the cardData field.
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
POST /direct-debit/core/v1/registration-card-bind HTTP/1.1
Host: api.doku.com
Authorization: text
X-PARTNER-ID: text
X-EXTERNAL-ID: text
X-TIMESTAMP: text
X-SIGNATURE: text
Content-Type: application/json
Accept: */*
Content-Length: 504
{
"partnerReferenceNo": "BIND-REF-20260526-001",
"cardData": "U2FsdGVkX1+A1B2C3D4E5F6G7H8I9J0K...",
"custIdMerchant": "CUST001",
"journeyId": "journey-bind-20260526-001",
"phoneNo": "08123456789",
"additionalInfo": {
"channel": "KARTU_KREDIT_INDONESIA",
"customerName": "John Doe",
"email": "john.doe@example.com",
"address": "Jl. Sudirman No. 1, Jakarta",
"dateOfBirth": "19900101",
"successRegistrationUrl": "https://merchant.example.com/binding/success",
"failedRegistrationUrl": "https://merchant.example.com/binding/failed"
}
}{
"responseCode": "2000100",
"responseMessage": "Successful",
"referenceNo": "REF-KKI-20260526-001",
"redirectUrl": "https://app.doku.com/direct-debit/kki/binding/SESSION-ABC123",
"additionalInfo": {
"custIdMerchant": "CUST001",
"status": "PENDING",
"authCode": "SESSION-ABC123"
}
}3. Unbinding
This endpoint is used to unbind a previously binded token compared to the payment with Tokenization API which need to charges some amount to the Customer.
Deactivates a previously bound credit card token for a customer under a merchant account.
Flow:
Merchant submits the
tokenId(i.e., thebankCardTokenfrom the binding response).The system locates all active tokens for the card and marks them as
PENDINGfor deactivation.The unbinding is finalised asynchronously via the ALTO/KKI network.
A Kafka event is published for downstream systems.
The tokenId is the raw token value for KKI (not Base64-decoded, unlike other channels).
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
POST /direct-debit/core/v1/registration-card-unbind HTTP/1.1
Host: api.doku.com
Authorization: text
X-PARTNER-ID: text
X-EXTERNAL-ID: text
X-TIMESTAMP: text
X-SIGNATURE: text
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"tokenId": "TOKEN-KKI-ABC123XYZ",
"additionalInfo": {
"channelId": "KARTU_KREDIT_INDONESIA"
}
}{
"responseCode": "2000500",
"responseMessage": "Successful",
"referenceNo": "REF-UNBIND-20260526-001",
"additionalInfo": {
"custIdMerchant": "CUST001",
"status": "PENDING"
}
}4. Refund
Online Refund
This endpoint is used to create refund request for previous successful payment. Merchant can request a transaction refund to DOKU. Full refund and partial refund are available to be requested
Online Refund Flow

API Endpoint
HTTP Method
POST
API Sandbox
API Production
Path
.../direct-debit/core/v1/debit/refund
Sample of Request Header, Request Body and Response Body
Notes:
Parameter with (*) is mandatory
Paramater without (*) is optional/conditional
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.123POST /direct-debit/core/v1/debit/refund HTTP/1.1
Host: {api-domain}
X-TIMESTAMP: 2020-12-21T07:56:11.000Z
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 821508239190
X-EXTERNAL-ID: 418075533589
X-IP-ADDRESS: 192.168.1.1
Authorization-customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2OTgwNTA3NDMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjExLTE2OTY5MTk2NTE5MTgifQ.x-D5VlK6TlVZbLPUSCr-Gbfgh4tnp0QDJmedYFHJGHFjg1c4x39pszU4sLvRhr0Jk0vKdMIzxUZeNhKoesWqDJitnG3kfrNZNsMb_WYUC0tJW91onXzYOKXiTgsHwRNFoWPQHlXIEtT3RQm-SRlCpk_E0gsavgkQn2-kbJEBnPhIs4eKg5IUY9GYi4hRr-_GHsudDl8sd2B5UBB_rHYq36BRmLXH7i7MQADHPsB1ktPVgk3ZWF0jebEjI-lJ88p-omL1vQNvRseXej2HKBa9chGLmPDvXYBQaRmmstHz-tv1boFrHfwsHJebcUec-i3WE1vMvP_3EPXdbqb45N4ciQ
Content-Type: application/json
Accept: */*
Content-Length: 243
{
"additionalInfo": {
"channel": "DIRECT_DEBIT_ALLO_SNAP"
},
"originalPartnerReferenceNo": "INV0001",
"originalExternalId": "REQ-0001",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"reason": "Request by Customer",
"partnerRefundNo": "INV-REF-0001"
}Successful
{
"responseCode": "2000700",
"responseMessage": "Successful",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"originalPartnerReferenceNo": "Ra7o1bLJAh2oV9eb33129stQc5xFm5s7",
"originalReferenceNo": "Ra7o1bLJAh2oV9eb33129stQc5xFm5s7",
"refundNo": "Ra7o1bLJAh2oV9eb33129stQc5xFm5s7",
"partnerRefundNo": "Ra7o1bLJAh2oV9eb33129stQc5xFm5s7",
"refundTime": "2024-01-01T09:09:00.123"
}Last updated