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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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.

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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
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
200

OK

application/json
post
/snap-adapter/b2b2c/v1.0/transaction-history-detail
200

OK

Last updated

Was this helpful?