DOKU Wallet

Integration Steps

Overview of integration process with DOKU Wallet SNAP.


1. 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.

POST authorization/v1/access-token/b2b

post
/authorization/v1/access-token/b2b
Header parameters
X-CLIENT-KEYstringRequired

Credential partner from DOKU

X-TIMESTAMPstringRequired

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

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

Body
grantTypestringRequiredExample: 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
/authorization/v1/access-token/b2b2c
Header parameters
X-CLIENT-KEYstringRequired

Credential partner from DOKU

X-TIMESTAMPstringRequired

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

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

Body
grantTypestringRequiredExample: authorization_code
authCodestringRequiredExample: 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

2. 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.

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

post
/snap-adapter/b2b/v1.0/registration-account-creation
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

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

3. 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
/snap-adapter/b2b/v1.0/otp-verification
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Body
originalPartnerReferenceNostringRequiredExample: Activity ID partners from request AccountCreation
originalReferenceNostringRequiredExample: Activity ID DOKU from respond AccountCreation
otpstringRequiredExample: OTP that user input
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

4. Account Binding

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

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

post
/snap-adapter/b2b/v1.0/registration-account-binding
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Body
partnerReferenceNostringRequiredExample: Activity ID from partners
redirectUrlstringRequiredExample: Partner URL when user finish binding
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

5. Account Inquiry

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

post
/snap-adapter/b2b/v1.0/registration-account-inquiry
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Body
partnerReferenceNostringRequiredExample: Identifier activity ID from partners
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

6. 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
/snap-adapter/b2b/v1.0/registration-account-unbinding
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Body
partnerReferenceNostringRequiredExample: Identifier activity ID from partners
linkIdstringRequiredExample: Identifier provided from Account Binding
merchantIdstringRequiredExample: Credential client ID from DOKU
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

7. 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
/snap-adapter/b2b2c/v1.0/balance-inquiry
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: Activity ID from partners
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2001100
responseMessagestringOptionalExample: 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

8. 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
/snap-adapter/b2b2c/v1.0/emoney/bank-account-inquiry
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: partnerReferenceNo
customerNumberstringRequiredExample: customerNumber
beneficiaryAccountNumberstringRequiredExample: beneficiaryAccountNumber
Responses
chevron-right
200

OK

application/json
responseCodestringOptional
responseMessagestringOptional
referenceNostringOptional
partnerReferenceNostringOptional
beneficiaryAccountNumberstringOptional
beneficiaryAccountNamestringOptional
beneficiaryBankCodestringOptional
post
/snap-adapter/b2b2c/v1.0/emoney/bank-account-inquiry
200

OK

9. 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
/snap-adapter/b2b2c/v1.0/emoney/transfer-bank
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: partnerReferenceNo
customerNumberstringRequiredExample: customerNumber
accountTypestringRequiredExample: accountType
beneficiaryAccountNumberstringRequiredExample: beneficiaryAccountNumber
beneficiaryBankCodestringRequiredExample: beneficiaryBankCode
Responses
chevron-right
200

OK

application/json
responseCodestringOptional
responseMessagestringOptional
referenceNostringOptional
partnerReferenceNostringOptional
transactionDatestringOptional
referenceNumberstringOptional
post
/snap-adapter/b2b2c/v1.0/emoney/transfer-bank
200

OK

10. 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
/snap-adapter/b2b2c/v1.0/emoney/topup
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: partnerReferenceNo
customerNumberstringRequiredExample: customerNumber
sessionIdstringRequiredExample: sessionId
notesstringRequiredExample: notes
Responses
chevron-right
200

OK

application/json
responseCodestringOptional
responseMessagestringOptional
referenceNostringOptional
partnerReferenceNostringOptional
sessionIdstringOptional
customerNumberstringOptional
post
/snap-adapter/b2b2c/v1.0/emoney/topup
200

OK

11. Query Top Up

This API allows partners to check status top up.

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

post
/snap-adapter/b2b2c/v1.0/emoney/topup-status
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
originalPartnerReferenceNostringRequiredExample: originalPartnerReferenceNo
originalReferenceNostringOptionalExample: originalReferenceNo
originalExternalIdstringRequiredExample: originalExternalId
serviceCodestringRequiredExample: serviceCode
Responses
chevron-right
200

OK

application/json
responseCodestringOptional
responseMessagestringOptional
originalPartnerReferenceNostringOptional
originalReferenceNostringOptional
originalExternalIdstringOptional
serviceCodestringOptional
latestTransactionStatusstringOptional
transactionStatusDescstringOptional
post
/snap-adapter/b2b2c/v1.0/emoney/topup-status
200

OK

12. Purchase Web

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

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

post
/snap-adapter/b2b2c/v1.0/debit/payment-host-to-host
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: Transaction ID from partners
chargeTokenstringRequiredExample: Default “DOKU”
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

13. Query Purchase

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

post
/snap-adapter/b2b2c/v1.0/debit/status
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: Transaction ID from partners
serviceCodestringRequiredExample: Unique service API “17”
transactionDatestringRequiredExample: Transaction date
Responses
chevron-right
200

OK

application/json
responseCodestringOptionalExample: 2005500
responseMessagestringOptionalExample: Request has been processed successfully
originalReferenceNostringOptionalExample: 5b4c663897ff488b9db50f789f0c9079
originalPartnerReferenceNostringOptionalExample: 5b4c663897ff488b9db50f789f0c9079
approvalCodestringOptionalExample: 319955
serviceCodestringOptionalExample: 17
latestTransactionStatusstringOptionalExample: 0
transactionStatusDescstringOptionalExample: SUCCESS
originalResponseCodestringOptionalExample: 2005500
originalResponseMessagestringOptionalExample: SUCCESS
paidTimestringOptionalExample: 2022-11-16T15:13:00+07:00
post
/snap-adapter/b2b2c/v1.0/debit/status
200

OK

14. 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
/snap-adapter/b2b2c/v1.0/debit/cancel
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
originalPartnerReferenceNostringRequiredExample: Original Transaction ID from partners
reasonstringRequiredExample: Reason 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

15. Refund Purchase

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

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

post
/snap-adapter/b2b2c/v1.0/debit/refund
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
originalPartnerReferenceNostringRequiredExample: Original Transaction ID from partners
reasonstringRequiredExample: Reason cancelation
partnerRefundNostringRequiredExample: Transaction ID on service consumer system, when for refund payment.
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

16. 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
/snap-adapter/b2b2c/v1.0/transaction-history-list
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: Activity ID from partners
fromDateTimestringRequiredExample: Starting time range ISO-8601
toDateTimestringRequiredExample: Ending time range ISO-8601
pageSizestringRequiredExample: Maximum number of transaction returned in one pagination Default 10
pageNumberstringRequiredExample: Current page number Default 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

17. Transaction History Detail

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

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

post
/snap-adapter/b2b2c/v1.0/transaction-history-detail
Header parameters
X-TIMESTAMPstringRequired

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

X-PARTNER-IDstringRequired

Credential client ID from DOKU

X-EXTERNAL-IDstringRequired

Reference number that should be unique in the same day

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

AuthorizationstringRequired

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

Authorization-CustomerstringRequired

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

Body
partnerReferenceNostringRequiredExample: Transaction ID from partners
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

Last updated