Embedded Wallet

Integration Steps

Overview of integration process with DOKU Wallet SNAP.


1. Requirement

  • DOKU Partner credential. This data is generated by DOKU Integration Team and is provided to you upon account activation.

  • A website or application and test environment.

  • A prior knowledge of web site or application programming is required.

  • DOKU API has minimum requirements to run properly:

    • Dynamic language: Must use a language that supports a dynamic environment. Cannot be plain HTML.

    • Language: Can use any kind of web-enabled language such as Apache PHP, Microsoft ASP, Adobe ColdFusion, Sun Java, Ruby on Rails.

    • Frameworks: Virtually can use many of the different frameworks available such as CodeIgniter, Spring, etc.

    • Capable of using both the HTTP Method GET and POST.

    • Database: Any kind of database available in the market that supports basic SQL Statements.

2. Signature

X-Signature are one of header components that partners need to send

X-Signature ONLY for Get Token B2B and B2B2C

X-SIGNATURE = SHA256withRSA(PrivateKey, StringToSign)

  • SHA256withRSA is used to generate the signature with your Private Key.

  • Generate StringToSign: StringToSign = client_ID+"|"+X-TIMESTAMP

X-Signature for Others API B2B / B2B2C

X-SIGNATURE = HMAC-SHA512(ClientSecret, StringToSign)

  • SHA-512 HMAC is used to generate the signature with your Client Secret.

  • Generate stringToSign: HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp


3. Token

Before partners can access SNAP API DOKU, a partner must request a B2B / B2B2C token. Token B2B / B2B2C session expired 900s (access token will continue to be used as long as there is activity request API from a partners to DOKU), but when partners request access token B2B / B2B2C more than one element before time limit expired, the latest access token B2B / B2B2C will be processed.

a. Token B2B

Token B2B used all SNAP API DOKU.

circle-exclamation

POST authorization/v1/access-token/b2b

post
Header parameters
X-CLIENT-KEYstringRequired

Credential partner from DOKU

Example: BRN-0256-1676878043376
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature SHA256withRSA(PrivateKey, StringToSign) SHA256withRSA is used to generate the signature with your Private Key. Generate StringToSign : StringToSign = client_ID+"|"+X-TIMESTAMP

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
Body
grantTypestringRequired

Grant type for get access token B2B"

Example: client_credentials
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2007300
responseMessagestringOptionalExample: Successful
accessTokenstringOptionalExample: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2NjYxNjU0NTYsIm5iZiI6MTY2NjE2NDU1NiwiaXNzIjoiRE9L VSIsImlhdCI6MTY2NjE2NDU1NiwianRpIjoiNzRmYmEyYzQtODlmZi00YTFhLWI2NWItMWExZTYwMmZmMj NjIiwiY2xpZW50SWQiOiIzMTg5In0.l-Nv7ajrTtscfRpDK2E7HY_8YN46Fb5KJfIoLB5M5fKzjwWfiYBE mx1gHRoilXhV4v-mAoa7ZTHgmIPW5WJHhNBI-5203fPyhvvkyK7ZgglB4rV7s3gzD9BWh8qm109Qj34PH1 IYQZyw02KOiOq3G1Hs_FKtBlcR9me1S_IlF2ar4uENMfL-wt2_rESU3u9lMm85imDfohSHVRANk1IJjONo VktRVBACZVxR1jOgVs-y-LTEkIETxXf7_JQGAfRbc5ezuj_lN8Zl0Vy70ZMGDAlZZwH2CRL9pBZCdpJLlQ 8-b1OWXEd_QXdFZU-jtyBGw5bxRy0wiWxKo5h68i77gA
tokenTypestringOptionalExample: Bearer
expiresInstringOptionalExample: 900
additionalInfostringOptional
post
/authorization/v1/access-token/b2b
200

OK

b. Token B2B2C

Token B2B2C is used for all SNAP API DOKU that involve customers for transaction activity.

POST authorization/v1/access-token/b2b2c

post
Header parameters
X-CLIENT-KEYstringRequired

Credential partner from DOKU

Example: BRN-0256-1676878043376
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature SHA256withRSA(PrivateKey, StringToSign) SHA256withRSA is used to generate the signature with your Private Key. Generate StringToSign : StringToSign = client_ID+"|"+X-TIMESTAMP

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
Body
grantTypestringRequired

Grant type for get access token B2B2C

Example: authorization_code
authCodestringRequired

Authorization code that you get from redirect url after user login and consent

Example: cfb5de1a-6a40-40e0-8549-0634bcaed8ed
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2007400
responseMessagestringOptionalExample: Successful
accessTokenstringOptionalExample: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2Njg1MDI4ODMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IjI5 NjUiLCJhZGRpdGlvbmFsRGF0YSI6IntcImFjY291bnRJZFwiOlwiMTEzMDk2MjY0MlwifSJ9.HA91xn5bL tnp8pytgdQE0wo20yiFdDGfHGSBowm9KyMIdCvk6nrZKJCv3eSB7J7mqJwJ0IvnmU0CJQG2O6adzmNLeqL TXcigmED6b9zVd7A_JQPyg0w-GagP3QnTA0Z859vPgqGZQokRAgSrsmj026V5aFEIbdtyk-C44ESj31nmz D8twtyqWgY0hB7UG_TjL093tWYW3VIK-TZepuzdT24l996CriLjcIkLnSXj6LakkCLkKxG229QHtE6fkeu uTSgCgQWZvMAW3Id9sghqKL0IaFP4wlUfH0AFpPzrB059QT6sHxHQJfNd64FUV_n5jvF7AyQ4zHiImUGXx lKzJg
tokenTypestringOptionalExample: Bearer
accessTokenExpiryTimestringOptionalExample: 2022-11-15T16:01:23+07:00
refreshTokenstringOptionalExample: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE2Njk3OTg4ODMsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IjI5 NjUiLCJhZGRpdGlvbmFsRGF0YSI6IjFiNjRjNGM2LTdhMzYtNGEyMy04OGRiLWRmMzIxMmFkZDg1MCJ9.R o3EzNpe6xUrWggeSOfC4whcdEpVsPXnl6SPrWO63QO7b4nE0azgsCe0lSkJ9wW6KtA42fiHZiXBdZe8PJX L5zthbfdkt1DoZW73WW26uyiZSNZxifWGhURiDhAzbVGTvdAjdDosRQnTgaQhNWfOyKd6ZW0gGuneyfkvX otffNQ5yAKDqDcNxkvr1WFC_gTHL50F6eWIi-uwgwSO_BORk_76zJiJ_iVGmMz6ArZFzN7NgD-xQlko3q_ ivj9ZKh4Awy7SHI5gsfdq4RSLJyy9me-dh5smwj2mniVVbwVeod0DVsNfkgfmF6cBesaz0ufBctx3119LP c-lSQE-65028Q
refreshTokenExpiryTimestringOptionalExample: 2022-11-30T16:01:23+07:00
additionalInfostringOptional
post
/authorization/v1/access-token/b2b2c
200

OK

4. Account

a. Account Creation

At this stage is the process for registering a new account, where after a successful registration process the customer will get a DOKU ID that is unique among customers to one another.

For account creation complete partners need to request to 3 API:

  1. Account Creation: Pre registration account data

  2. Verify OTP: Validate account data with OTP ( User Interface provided by partners )

  3. Binding Account: Binding account with partners and get B2BB2C / Authorization-Customer for payment

circle-info

Notes

DOKU will send OTP directly to mobile phone customers from request Account Creation.

Account Creation Flow Diagram

POST snap-adapter/b2b/v1.0/registration-account-creation

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
partnerReferenceNostringRequiredExample: f1a69bce-41bc-4abd-8c5c-01910574e404
namestringRequiredExample: SNAPaccount11230010
phoneNostringRequiredExample: 81212340010
emailstringRequiredExample: [email protected]
redirectUrlstringRequiredExample: https://doku.com
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2000600
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: d2059e29-aebe-4c60-be56-936f85f230e1
partnerReferenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
post
/snap-adapter/b2b/v1.0/registration-account-creation
200

OK

b. Request OTP

With this API partners can request new OTP when customer OTP has expired. OTP expired time 5 Minutes

POST snap-adapter/b2b/v1.0/otp

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
partnerReferenceNostring · max: 64Required

Activity ID partners from request Account Creation / Account Unbinding

Example: AccountSNAP0002
bankCardTokenstring · max: 128Required

DOKU

Example: DOKU
journeyIDstring · max: 32Required

An identifier to uniquly identify a journey. On the first request of the journey, this must be equal to the X-EXTERNAL-ID.

Example: BRN-0229-1689238428325_1692351887640
Responses
chevron-right
200

OK

application/json
responseCodestringOptional

Respond Code for Result API

Example: 2008100
responseMessagestringOptional

Detailed Response Message

Example: Request has been processed successfully
partnerReferenceNostringOptional

Activity ID from partners

Example: f139057a-39f6-468d-a9ec-c30987b6752d
referenceNostringOptional

Activity ID from DOKU

Example: 7f153090-68c5-4f4b-8902-ef779340818b
chargeTokenstringOptional

String code for verification OTP

Example: 2db4fbf7e00b9931337f6e912c304f9de5c31a60
post
/snap-adapter/b2b/v1.0/otp
200

OK

c. Verify OTP

Partners use API Verify OTP when user input OTP on partner side, this activity is required when we need to validate the account, example on flow journey Account Creation and Account Unbinding.

circle-info

Notes

  1. For Account Creation, partners need to redirect user to Create PIN page, URL (qparamsURL?action=action) from Response Verify OTP

  2. Account ID will be info to redirectUrl from request Account Creation, example below:

    htttp://partnerweb.com/registerdoku/?accountId=1140340010&partnerReferenceNo=f1a69bce-41bc-4abd-8c5c -01910574e404&status=SUCCESS

POST snap-adapter/b2b/v1.0/otp-verification

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
originalPartnerReferenceNostringRequired

Activity ID partners from request AccountCreation

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
originalReferenceNostringRequired

Activity ID DOKU from respond AccountCreation

Example: 934fbec9-2f65-40e1-b7fa-71e62536b83c
otpstringRequired

One Time Password entered by the user

Example: 989029
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2000400
responseMessagestringOptionalExample: Request has been processed successfully
originalPartnerReferenceNostringOptionalExample: f139057a-39f6-468d-a9ec-c30987b6752d
originalReferenceNostringOptionalExample: 7f153090-68c5-4f4b-8902-ef779340818b
emailstringOptionalExample: [email protected]
phoneNostringOptionalExample: 857100006
sendOtpFlagstringOptionalExample: YES
qparamsURLstringOptionalExample: https://sandbox.doku.com/snap-adapter-webview/create-pin
post
/snap-adapter/b2b/v1.0/otp-verification
200

OK

d. Account Binding

Account Binding is flow to bind DOKU Wallet accounts to partner for get authCode (B2BB2C / Authorization-Customer for payment purposes)

circle-info

Notes

Auth Code will be info to redirectUrl from request example below:

htttp://partnerweb.com/registerdoku/?authCode=9301a29e-60d6-4f68-ab92-7d3d61617233&partnerReferenceNo=478c40b2-e8af-49ed-bd6c-c36aa3a27ef7&status=SUCCESS

POST snap-adapter/b2b/v1.0/registration-account-binding

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
partnerReferenceNostringRequired

Activity ID partners from request AccountCreation

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
redirectUrlstringRequired

Partner URL when user finish binding

Example: https://partner.com/redirect
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2000700
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: 934fbec9-2f65-40e1-b7fa-71e62536b83c
partnerReferenceNostringOptionalExample: 478c40b2-e8af-49ed-bd6c-c36aa3a27ef7
linkIdstringOptionalExample: 1669794770461PTWZy7qpYcg
nextActionstringOptionalExample: https://sandbox.doku.com/snap-adapter-webview/account-binding?token=eyJhbGciOiJI UzUxMiJ9.eyJyZWRpc19rZXlfaWQiOiJzbmFwLWFkYXB0ZXI6OmFjY291bnQtYmluZGluZzo6YXV0aGVu dGljYXRpb246OjYyODEyMTIzNDAwMTAxMTIwMzQwMDEwLTQ3OGM0MGIyLWU4YWYtNDllZC1iZDZjLWMzN mFhM2EyN2VmNyIsImNyZWF0ZWQiOjE2Njk3OTQ3NzA2ODQsImV4cCI6MTY2OTg4MTE3MH0.j9IzFhlw-g -t861S4f76B_k_jy-E_XvkFX1HxDdxD9V7sz49u7rPbuG8XadlPE7aOSsG7E4QjYGbUZIgH9LcNw&phon eNo=6281*****0010
redirectUrlstringOptionalExample: https://dwidobelyu-doku.free.beeceptor.com
post
/snap-adapter/b2b/v1.0/registration-account-binding
200

OK

e. Query Account Binding

This API to check the binding status of an account.

Additional Info

The authcode can be found in the account binding inquiry API response. The value will be in the form of cipher text which is the result of encryption using AES-1. To get the raw text, partners need to encrypt the authCode obtained from the API. From the partner side, there are 2 values ​​that will be used:

  1. cipherText: authCode obtained from the account inquiry response

  2. secretKey: key provided by DOKU

To decrypt it, we need to create a Cipher instance to decrypt with AES and decode the cipherText using BASE64Decoder. Here's the sample code :

  • Convert secretKey from String to bytes

chevron-rightSee codehashtag

public static String decryptInputKey(String cipherText, String secretKey) throws Exception {byte[] keyBytes = secretKey.getBytes();}

  • Create a cryptographic key from the secret key

chevron-rightSee codehashtag

Key key = new SecretKeySpec(keyBytes, “AES”);

  • Create a Cipher instance for AES

chevron-rightSee codehashtag

Cipher c = Cipher.getInstance(“AES”);

Set Cipher to decrypt with secretKey

chevron-rightSee codehashtag

c.init(2, key);

Decode cipherText to bytes

chevron-rightSee codehashtag

byte[] decodedCipherText = (new BASE64Decoder()).decodeBuffer(cipherText);

Decrypt cipher text

chevron-rightSee codehashtag

byte[] decValue = c.doFinal(decodedCipherText);

Convert rawText from bytes to String

chevron-rightSee codehashtag

return new String(decValue);

POST snap-adapter/b2b/v1.0/registration-account-inquiry

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
partnerReferenceNostringRequired

Identifier activity ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2000800
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: 0987dc7e-a391-420a-887a-425595acaabd"
partnerReferenceNostringOptionalExample: f314e49a-c2e8-4db1-bbac-335120ea6a73
accountNostringOptionalExample: 1508091937
post
/snap-adapter/b2b/v1.0/registration-account-inquiry
200

OK

f. Account Unbinding

This is the process when customers want to unbinding their DOKU account from merchants. To complete the unbinding account process OTP must send to API Verify OTP.

POST snap-adapter/b2b/v1.0/registration-account-unbinding

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Body
partnerReferenceNostringRequired

Identifier activity ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
linkIdstringRequired

Identifier provided from Account Binding

Example: 1669794770461PTWZy7qpY2d
merchantIdstringRequired

Credential client ID from DOKU

Example: 3189
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2000900
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: 8f560a36-fc69-407a-9b62-6565d15263b2
partnerReferenceNostringOptionalExample: f68f64b5-842e-4298-87c4-6ee7bd202467
merchantIdstringOptionalExample: 3189
linkIdstringOptionalExample: SnpFXl9hINuzcA9gxGwgcJk8
unlinkResultstringOptionalExample: inProgress
post
/snap-adapter/b2b/v1.0/registration-account-unbinding
200

OK

g. Balance Inquiry

With this API, partners can check for customer balance that has been verified by DOKU, so that partners can equate customer data, between partners and DOKU.

POST snap-adapter/b2b2c/v1.0/balance-inquiry

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequiredExample: Activity ID from partners
Responses
chevron-right
200

OK

application/json
responseCodestringOptional

Respond Code for Result API

Example: 2001100
responseMessagestringOptional

Detailed Response Message

Example: Request has been processed successfully
referenceNostringOptionalExample: 9e5bfe5d-6270-4737-ad45-1091f97c8b6d
partnerReferenceNostringOptionalExample: 1eb0db4aa2e642208e71e9252428d912
accountNostringOptionalExample: 17139626343
namestringOptionalExample: John Doe
post
/snap-adapter/b2b2c/v1.0/balance-inquiry
200

OK

5. Authorize Payment and Capture

a. Auth Payment

Enables partners to authorize payments without immediate capture. This API is ideal for scenarios where payment verification is required before final processing.

Authorize a payment

post

Endpoint to authorize a payment transaction.

Header parameters
X-PARTNER-IDstringRequired

client_ID or Partner_ID from DOKU

Example: BRN-001-0000000001
X-TIMESTAMPstring · date-timeRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-23T08:58:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day (request-id)

Example: 41807553358950093184162180797837
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: “Bearer xxxTheTokenxxx
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: “Bearer xxxTheTokenxxx
Body
partnerReferenceNostring · max: 64Optional

Partner's reference number for the transaction.

Example: 2020102900000000000001
merchantIdstring · max: 22Optional

Unique ID for a partner (DOKU'S Client ID)

Example: BRN-001-12345678901234
amountstringOptionalExample: 10000.00
mccstringOptional

Merchant category code.

Example: 5743
Responses
chevron-right
200

Payment authorized successfully.

application/json
responseCodestring · min: 7 · max: 7Optional

Response code indicating status of transaction.

Example: 2006300
responseMessagestring · max: 150Optional

Response description.

Example: Request has been processed successfully
referenceNostring · max: 64Optional

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
partnerReferenceNostring · max: 64Optional

Partner's reference number for the transaction.

Example: 2020102900000000000001
amountstringOptionalExample: 10000.00
paidTimestring · date-time · max: 25Optional

Transaction paid time. Format paid time : (ISO 8601) YYYY-MM-DDThh:mm:ss

Example: 2009-07-03T12:08:56+07:00
post
/dw/b2b2c/v1.0/auth/payment

b. Capture Payment

Enables partners to Capture payments after Authorize Payment. When Split Settlement Rules are defined, then the capture amount can be transferred to DOKU ID

Capture a payment

post

Endpoint to capture a payment transaction.

Header parameters
X-PARTNER-IDstringRequired

client_ID or Partner_ID from DOKU

Example: BRN-001-0000000001
X-TIMESTAMPstring · date-timeRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-23T08:58:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day (request-id)

Example: 41807553358950093184162180797837
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: “Bearer xxxTheTokenxxx
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: “Bearer xxxTheTokenxxx
Body
originalReferenceNostring · max: 64Required

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Required

Partner's reference number for the transaction.

Example: 2020102900000000000001
merchantIdstring · max: 22Required

Unique ID for a partner (DOKU'S Client ID)

Example: BRN-001-12345678901234
partnerCaptureNostring · max: 64Required

Capture identifier generated by the partner / merchant.

Example: 0000710001012344
titlestringRequired

Capture title

Example: Confirmed
lastCapturebooleanOptional

Goods ID.

Example: false
Responses
chevron-right
200

Payment capture successfully.

application/json
responseCodestringRequiredExample: 2006500
responseMessagestring · max: 150Required

Response description.

Example: Request has been processed successfully
originalReferenceNostring · max: 64Optional

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Optional

Partner's reference number for the transaction.

Example: 2020102900000000000001
captureAmountstringRequiredExample: 10000.00
captureTimestring · date-time · max: 25Optional

Transaction paid time. Format paid time : (ISO 8601) YYYY-MM-DDThh:mm:ss

Example: 2009-07-03T12:08:56+07:00
post
/dw/b2b2c/v1.0/auth/capture

c. Void Auth Payment

Enable Customer to Cancel order by using Void Auth Payment API, Authorized Amount will be released to Active Balance to be used in the next transaction.

Void Authorization payment

post

Endpoint to Cancel Void payment transaction.

Header parameters
X-PARTNER-IDstringRequired

client_ID or Partner_ID from DOKU

Example: BRN-001-0000000001
X-TIMESTAMPstring · date-timeRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-23T08:58:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day (request-id)

Example: 41807553358950093184162180797837
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: “Bearer xxxTheTokenxxx
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: “Bearer xxxTheTokenxxx
Body
originalReferenceNostring · max: 64Required

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Required

Partner's reference number for the transaction.

Example: 2020102900000000000001
merchantIdstring · max: 22Required

Unique ID for a partner (DOKU'S Client ID)

Example: BRN-001-12345678901234
partnerVoidNostring · max: 64Required

Void identifier generated by the partner / merchant.

Example: 0000710001012344
reasonstring · max: 150Optional

reason cancel of transaction.

Example: -
Responses
chevron-right
200

void successfully.

application/json
responseCodestringRequiredExample: 2006700
responseMessagestring · max: 150Required

Response description.

Example: Request has been processed successfully
originalReferenceNostring · max: 64Required

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Required

Partner's reference number for the transaction.

Example: 2020102900000000000001
voidNostring · max: 64Required

Void Number identifier generated by DOKU.

Example: 202010173821904898012234423
partnerVoidNostring · max: 64Required

Void identifier generated by the partner / merchant.

Example: 0000710001012344
voidTimestring · date-time · max: 25Required

Transaction paid time. Format paid time : (ISO 8601) YYYY-MM-DDThh:mm:ss

Example: 2009-07-03T12:08:56+07:00
post
/dw/b2b2c/v1.0/auth/void

6. Purchase

Partners can provide an online payment facility using PIN authentication that can facilitate customers in making the transaction at any merchant that has been integrated. DOKU will provide a webview payment page to input the PIN and proceed with the payment.

a. Purchase Web

POST snap-adapter/b2b2c/v1.0/debit/payment-host-to-host

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

Transaction ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
chargeTokenstringRequired

Charge token for the transaction

Example: 2db4fbf7e00b9931337f6e912c304f9de5c31a60
merchantIdstringRequiredExample: 6067
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2005400
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: c8c73c4635794cdcae7d9fe325251088
partnerReferenceNostringOptionalExample: c8c73c4635794cdcae7d9fe325251088
webRedirectUrlstringOptionalExample: https://sandbox.doku.com/snap-adapter-webview/direct-debit?token=eyJhbGciOiJIUzU xMiJ9.eyJyZWRpc19rZXlfaWQiOiJzbmFwLWFkYXB0ZXI6OmRpcmVjdC1kZWJpdDo6MTQ1NTM0MDAwNC1 jOGM3M2M0NjM1Nzk0Y2RjYWU3ZDlmZTMyNTI1MTA4OCIsImNyZWF0ZWQiOjE2NjkwODc0OTI1MTgsImV4 cCI6MTY2OTE3Mzg5Mn0.wIL92PT2km7rQ0oHWytEVknE0X6URdIJz4f7s-TQ9E3uH4txLGo2a-GMYdh-w acTcXjl252XS87_634ajnM_dg
post
/snap-adapter/b2b2c/v1.0/debit/payment-host-to-host
200

OK

b. Query Purchase

checks status payment

post

Endpoint to checks tatus transaction.

Header parameters
X-PARTNER-IDstringRequired

client_ID or Partner_ID from DOKU

Example: BRN-001-0000000001
X-TIMESTAMPstring · date-timeRequired

Client's current local time in yyyy-MM- ddTHH:mm:ssTZD format

Example: 2020-12-23T08:58:11+07:00
X-SIGNATUREstringRequired

Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day (request-id)

Example: 41807553358950093184162180797837
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: “Bearer xxxTheTokenxxx
Body
originalReferenceNostring · max: 64Optional

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Required

Partner's reference number for the transaction.

Example: 2020102900000000000001
merchantIdstring · max: 22Required

Unique ID for a partner (DOKU'S Client ID)

Example: BRN-001-12345678901234
serviceCodestringRequired

Unique service API

Example: 67
Responses
chevron-right
200

Payment authorized successfully.

application/json
responseCodestring · min: 7 · max: 7Required

Response code indicating status of transaction.

Example: 2006300
responseMessagestring · max: 150Required

Response description.

Example: Request has been processed successfully
originalReferenceNostring · max: 64Required

DOKU reference number that only filled upon successful transaction.

Example: 2020102977770000000009
originalPartnerReferenceNostring · max: 64Required

Partner's reference number for the transaction.

Example: 2020102900000000000001
serviceCodestringRequired

Unique service API

Example: 67
latestTransactionStatusstringRequired

Unique service API

Example: 05
transAmountstringRequiredExample: 10000.00
transactionStatusDescstringRequiredExample: Canceled
paidTimestring · date-time · max: 25Required

Transaction paid time. Format paid time : (ISO 8601) YYYY-MM-DDThh:mm:ss

Example: 2009-07-03T12:08:56+07:00
post
/dw/b2b/v1.0/debit/status

c. Cancel Purchase

Partners can cancel the transaction or reverse immediately after successful transaction processing in the DOKU system, it can be used in case of time-out or other problems that occur on the merchant side.

POST snap-adapter/b2b2c/v1.0/debit/cancel

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
originalPartnerReferenceNostringRequired

Original Transaction ID from partners

Example: 5b4c663897ff488b9db50f789f0c9079
reasonstringRequired

Reason cancelation

Example: Customer request cancelation
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2005700
responseMessagestringOptionalExample: Request has been processed successfully
originalReferenceNostringOptionalExample: inv_pm_20221019143243557
originalPartnerReferenceNostringOptionalExample: inv_pm_20221019143243557
cancelTimestringOptionalExample: 2022-10-18T11:15:07.376472
transactionDatestringOptionalExample: 2022-10-18T11:11:00
post
/snap-adapter/b2b2c/v1.0/debit/cancel
200

OK

d. Refund Purchase

Partners can request a refund when the transaction has already settled.

POST snap-adapter/b2b2c/v1.0/debit/refund

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
originalPartnerReferenceNostringRequired

Original Transaction ID from partners

Example: 5b4c663897ff488b9db50f789f0c9079
reasonstringRequired

Reason for refund

Example: Customer request refund
partnerRefundNostringRequired

Transaction ID on service consumer system, when for refund payment.

Example: 123456
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2005800
responseMessagestringOptionalExample: Request has been processed successfully
originalReferenceNostringOptionalExample: 4f00d3a6819b439580731b7b77dbbf05
originalPartnerReferenceNostringOptionalExample: 4f00d3a6819b439580731b7b77dbbf05
refundNostringOptionalExample: 123456
partnerRefundNostringOptionalExample: 123456
refundTimestringOptionalExample: 2022-11-11T10:02:46+07:00"
post
/snap-adapter/b2b2c/v1.0/debit/refund
200

OK

7. Transaction History

a. Transaction History List

This API allows partners to get history from an account with 1 month range time and the oldest transaction is 1 year behind.

POST snap-adapter/b2b2c/v1.0/transaction-history-list

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

Activity ID from partners

Example: 5b4c663897ff488b9db50f789f0c9079
fromDateTimestringRequired

Starting time range ISO-8601

Example: 2022-11-01T00:00:00+07:00
toDateTimestringRequired

Ending time range ISO-8601

Example: 2022-11-30T23:59:59+07:00
pageSizestringRequired

Maximum number of transaction returned in one pagination Default 10

Example: 10
pageNumberstringRequired

Current page number Default 0

Example: 0
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001200
responseMessagestringOptionalExample: Request has been processed successfully
post
/snap-adapter/b2b2c/v1.0/transaction-history-list
200

OK

b. Transaction History Detail

This API allows partners to get transaction details from an account.

POST snap-adapter/b2b2c/v1.0/transaction-history-detail

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

Transaction ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001300
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: RendH9Bpwly4CDRxzeAXIw
partnerReferenceNostringOptionalExample: e73771a15652c5aace3f05d0feaa8cb82b40e5cd
dateTimestringOptionalExample: 2022-11-23T18:39:41+07:00
remarkstringOptionalExample: Transfer Cash Wallet To Bank Account
statusstringOptionalExample: SUCCESS
typestringOptionalExample: SEND_MONEY
post
/snap-adapter/b2b2c/v1.0/transaction-history-detail
200

OK

8. Transfer

a. Transfer Bank Account Inquiry

This API allows partners to get BANK beneficiary information, so customers can see and confirm the transfer activity

POST snap-adapter/b2b2c/v1.0/emoney/bank-account-inquiry

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

partnerReferenceNo

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
customerNumberstringRequired

customerNumber

Example: 1020340010
beneficiaryAccountNumberstringRequired

beneficiaryAccountNumber

Example: 18520102416246
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001200
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
partnerReferenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
beneficiaryAccountNumberstringOptionalExample: 18520102416246
beneficiaryAccountNamestringOptionalExample: John Doe
beneficiaryBankCodestringOptionalExample: 2
post
/snap-adapter/b2b2c/v1.0/emoney/bank-account-inquiry
200

OK

b. Transfer Bank Account Payment

This API allows partners to trigger transfer balance from account balance to BANK Account

POST snap-adapter/b2b2c/v1.0/emoney/transfer-bank

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

Transaction ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
customerNumberstringRequired

Customer number

Example: 1020340010
accountTypestringRequired

Account type

Example: tabungan
beneficiaryAccountNumberstringRequired

Beneficiary account number

Example: 18520102416246
beneficiaryBankCodestringRequired

Beneficiary bank code

Example: 2
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001300
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
partnerReferenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
transactionDatestringOptionalExample: 2022-11-11T17:37:37.473153
referenceNumberstringOptionalExample: 319874
post
/snap-adapter/b2b2c/v1.0/emoney/transfer-bank
200

OK

9. Top Up

Use this API for a cashback feature where the wallet balance is sent directly from the partner's wallet account to the customer's wallet account.

The amount of cashback would be conditioned by the business policy of each partner. Initially, the partner needs to deposit the amount to the partner's DOKUID Corporate before being able to credit/ topup to the customer’s wallet account.

a. Account Inquiry Top Up

This API allows partners to get DOKU account information, so customers can see and confirm the transfer activity.

POST snap-adapter/b2b2c/v1.0/emoney/account-inquiry

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

partnerReferenceNo

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
transactionDatestringRequired

transactionDate

Example: 2022-11-11T17:37:37.473153
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001400
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
partnerReferenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
customerNumberstringOptionalExample: 1020340010
customerNamestringOptionalExample: John Doe
customerMonthlyInLimitstringOptionalExample: 5000000
post
/snap-adapter/b2b2c/v1.0/emoney/account-inquiry
200

OK

b. Account Top Up

This API allows partners to trigger transfer balance from their corporate account balance to DOKU Customer Account.

POST snap-adapter/b2b2c/v1.0/emoney/topup

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
partnerReferenceNostringRequired

Transaction ID from partners

Example: f1a69bce-41bc-4abd-8c5c-01910574e404
customerNumberstringRequired

Customer number

Example: 1020340010
sessionIdstringRequired

Session ID

Example: 192837465
notesstringRequired

Notes for top up transaction

Example: notes
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001500
responseMessagestringOptionalExample: Request has been processed successfully
referenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
partnerReferenceNostringOptionalExample: f1a69bce-41bc-4abd-8c5c-01910574e404
sessionIdstringOptionalExample: 192837465
customerNumberstringOptionalExample: 1020340010
post
/snap-adapter/b2b2c/v1.0/emoney/topup
200

OK

c. Query Top Up

This API allows partners to check status top up.

POST snap-adapter/b2b2c/v1.0/emoney/topup-status

post
Header parameters
X-TIMESTAMPstringRequired

Client's current local time in yyyyMMddTHH:mm:ss.SSST ZD format

Example: 2026-01-26T14:33:11+07:00
X-PARTNER-IDstringRequired

Credential client ID from DOKU

Example: BRN-0256-1676878043376
X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

Example: BRN-0256-1676878043376_1769412783294
X-SIGNATUREstringRequired

SHA-512 HMAC is used to generate the signature with your Client Secret. Generate stringToSign : HTTPMethod + ”:“+ EndpointUrl +":"+ B2BAccessToken + ":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":“ + X-TimeStamp

Example: bySGzXdWfHaFF6L5VD/m/uMnAvZYnO6ry7lv5q4v0RB9sZ+yHqC1JPu8B2HLd7J4hVQhXvVaNqJmKt11KlpNpmq9qgtu2bqHt9qFIa5+0lZJjEYKFOFgjxVWSffF1EcTooeV3BUva1EedEsbjYgbaM3e8QszvNmKGkEEzv3qjkM=
AuthorizationstringRequired

Represents access_token of a request, string starts with keyword “Bearer ” followed by Token B2B

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3Njk0MTM2MzQsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYifQ.XPS6T9IKRh5JSI0hGcgkoEJEu1rG68sKf-3BVJNNWxipGPaI7HdGGHOUM3Fi_ivXCTgpgyHEqMC3Ht7kcrvvIwkMHCzxylAbcSKBzZhUm7N-uYdIzfcbTsXbpFk-OMhWF8YROYtlfmfz_PfPmpUYrnrU5vp2phBkrbZBNGVCw9fZBViF6ACuiHDFdcyLjSbM7fSdB0lt6_Tbjum9KeJKTUQNmCXmBX4nI_goFdPR_Y4AewPMDTI7bZUvClBFNrPHzjjaKj-0IxDjFxKeFapZH4BVv6rCbDAlIfQSzIUhTHMJZIE52qcvNMfRy4WGVtaOoaXKgJf3Hvsb3ZP5-cblmQ
Authorization-CustomerstringRequired

Represents access_token of a request belong customer; string starts with keyword “Bearer ” followed by Token B2B2C

Example: eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3NTEwOTMxMTYsImlzcyI6IkRPS1UiLCJjbGllbnRJZCI6IkJSTi0wMjU2LTE2NzY4NzgwNDMzNzYiLCJhY2NvdW50SWQiOiIxMTMwOTYyNjQyIn0.obDKu1k0ioPnAy89PzdhOx9w5ZqqTN_0I26A_N5MgXbxub8szGpwpsaZD5lNme9CMydJT8pBr4cuYb1uU-FUbAVg2I9OsEmioHLHHUhbAhfykOREOm9PXkU4A3e3_7jjt77XuJGTat-0ZG1tGn21GNbaCUa4TswE61PcUu-XM7rPoOSZkwxR_YPg7vWrR9cSNIJV3iECWGWD-t_cGgbi0Jt3Yj-eCA9JIjQGa9o8fPwvW1xmWLcLw6MhUdppYLphd5ulhLTCLeI4wpr8RXP9Kq0K0trcEBrVDFELD9PykcPuG8A_yW8lgjoTcJaep85CHlS07w-9TakwEND0Wu4Y8w
Body
originalPartnerReferenceNostringRequired

originalPartnerReferenceNo

Example: 977ebb3b8bdf4520b7ec8ead6c16567a
originalReferenceNostringOptional

originalReferenceNo

Example: 977ebb3b8bdf4520b7ec8ead6c16567a
originalExternalIdstringRequired

originalExternalId

Example: 977ebb3b8bdf4520b7ec8ead6c16567a
serviceCodestringRequired

serviceCode

Example: 50
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001600
responseMessagestringOptionalExample: Request has been processed successfully
originalPartnerReferenceNostringOptionalExample: 977ebb3b8bdf4520b7ec8ead6c16567a
originalReferenceNostringOptionalExample: 977ebb3b8bdf4520b7ec8ead6c16567a
originalExternalIdstringOptionalExample: 977ebb3b8bdf4520b7ec8ead6c16567a
serviceCodestringOptionalExample: 50
latestTransactionStatusstringOptionalExample: 0
transactionStatusDescstringOptionalExample: Request has been processed successfully
post
/snap-adapter/b2b2c/v1.0/emoney/topup-status
200

OK

Appendix

DOKU e-Wallet Customer Type

Criteria
Normal/Basic
Premium

Max Balance

Rp2.000.000

Rp20.000.000

Max Monthly Transaction Limit

Rp20.000.000/month

Rp40.000.000/month

Purchase

Transfer

Cash Out

Response Code

Response code has 3 parts of information, 3 digits for HTTP Code, 2 digits for Service Code and the last is for Case Code, like the example below.

circle-info

Example

Response Code: 2007300

  • 200 : HTTP Code

  • 73 : Service Code

  • 00 : Case Code

Response Code
Desc

200 ”ServiceCode” 00

Successful

401 ”ServiceCode” 01

Access Token Invalid ( B2B / B2B2B Token )

401 ”ServiceCode” 00

Unauthorized Signature

400 ”ServiceCode” 02

Invalid Mandatory Field

400 ”ServiceCode” 01

Invalid Field Format

409 ”ServiceCode” 00

Conflict ( Using same External-ID )

404 ”ServiceCode” 11

Account Information Invalid

404 ”ServiceCode” 15

OTP/Verification Code Invalid

403 ”ServiceCode” 18

Inactive Account

403 ”ServiceCode” 05

Account Frozen/Abnormal

403 ”ServiceCode” 02

Exceeds Top Up Amount Limit

403 ”ServiceCode” 14

Insufficient Fund

404 ”ServiceCode” 08

Invalid Merchant

400 ”ServiceCode” 00

Parsing Error

404 ”ServiceCode” 01

Transaction Not Found

404 ”ServiceCode” 04

Transaction Cancelled

Service Code
API

04

Verify OTP

06

Account Creation

07

Account Binding

08

Account Inquiry

09

Account Unbinding

11

Balance Inquiry

12

Transaction History List

13

Transaction History Detail

54

Purchase

55

Query Purchase

57

Cancel Purchase

58

Refund Purchase

37

Account Inquiry Top Up

39

Query Top Up

38

Account Top Up

42

Transfer BANK Account Inquiry

43

Transfer Bank Payment

63

Authorize Payment

65

Capture Payment

67

Void Auth Payment

Last updated