Skip to main content

3ds-authentication-section

To get 3DS authentication, you will need to hit this API through your backend:

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/credit-card/check-three-d-secure
API endpoint (Production)https://api.doku.com/credit-card/check-three-d-secure

Here is the sample of request header to get 3DS authentication:

Client-Id: MCH-0001-10791114622547
Request-Id: 6d0bffbd-9246-455e-a1f1-44c1f76ad589
Request-Timestamp: 2021-08-24T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Request Header Explanation
ParameterDescription
Client-IdClient ID retrieved from DOKU Back Office
Request-IdUnique random string (max 128 characters) generated from merchant side to protect duplicate request
Request-TimestampTimestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z
SignatureSecurity parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature

Here is the sample request body to get 3DS authentication:

{
"order": {
"amount": 90000
},
"card": {
"token": "243591d7e49f45109961581718c3ef82",
"number": "5573381011111101",
"expiry": "1225"
},
"three_dsecure": {
"callback_url_success": "https://www.merchant.com/success",
"callback_url_failed": "https://www.merchant.com/failed"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.amountnumberMandatoryIn IDR Currency and without decimal
Allowed chars: numeric
Max length: 12
card.tokenstringOptionalCard token generated by DOKU, can be used if you already activate tokenization
card.numberstringMandatoryCard number, can be optional if you sent card.token
card.expirystringMandatoryCard expiry date, can be optional if you sent card.token
Format: MMYY
three_dsecure.callback_url_successstringMandatoryAfter 3DS process success, customer will be redirected to this page
three_dsecure.callback_url_failedstringMandatoryAfter 3DS process success, customer will be redirected to this page

API Response

After hitting the above API request, DOKU will give the response.

TypeValue
HTTP Status200
ResultSUCCESS

Here is the sample response header:

Client-Id: MCH-0001-10791114622547
Request-Id: b266c265-3d61-4708-9860-c0d5b9a98f8c
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Response Header Explanation
ParameterDescription
Client-IdSame as the request
Request-IdSame as the request
Response-TimestampTimestamp Response on UTC with format ISO8601 UTC+0 from DOKU
SignatureSignature generated by DOKU based on the response body

Here is the sample of response body:

{
"order": {
"amount": 90000
},
"three_dsecure": {
"enrollment_status": true,
"authentication_id": "eb7e72313b491cd73ea10c6354bc96900f08b3e50e66cf3df2fe29580d6ff84e",
"authentication_url": "https://doku.3ds.com?authenticationId=eb7e72313b491cd73ea10c6354bc96900f08b3e50e66cf3df2fe29580d6ff84e"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.amountnumberMandatorySame as the request
three_dsecure.enrollment_statusbooleanMandatoryCard 3D Secure enrollment status
Possible value: true, false
three_dsecure.authentication_idstringMandatory3DS process ID to use on API Charge
three_dsecure.authentication_urlstringOptional3DS page if the three_dsecure.enrollment_status is true