Skip to main content

Verify OTP

Verify OTP

To register the card, you will need to hit this API through your Backend:

Direct API - Direct Debit CIMB SNAP Payment
 Direct API - CIMB Payment

API Request

TypeValueDescription
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/direct-debit/[acquirer-name]/v1.0/otp-verificationPossible Values for [acquirer-name] : ovo, cimb, allobank, bri
API endpoint (Production)https://api.doku.com/direct-debit/[acquirer-name]/v1.0/otp-verificationPossible Values for [acquirer-name] : ovo, cimb, allobank, bri

Here is the sample of request header to perform Account Binding:

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Request Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of request body for Balance Inquiry :

{
"originalPartnerReferenceNo": " CIMB20000001",
"otp": "123456",
"type": "PAYMENT",
"additionalInfo": {
"bankCardToken": "12341234"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
originalPartnerReferenceNostring ConditionalTransaction identifier on service consumer system, Mandatory for type Payment
otpstring MandatoryThe OTP Sent to user's Whatsapp or Phone Number
typestring MandatoryType of OTP Verification (binding, unbinding, payment)
additionalInfo.bankCardTokenstring MandatoryCustomer's Token, mandatory for type Binding and Payment

API Response

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

TypeValue
HTTP Status201
ResultCREATED

Here is the sample response header:

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Response Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of response body:

{
"responseCode": "2005400",
"responseMessage": "Successful",
"originalReferenceNo": "12341234"
}
Request Body Explanation
ParameterTypeMandatoryDescription
responseCodestring (7) MandatoryResponse code as defined in SNAP Regulation
responseMessagestring MandatoryResponse message as defined in SNAP Regulation
originalReferenceNostring Optionalaccount binding unique identifier on acquirer's side