Skip to main content

Balance Inquiry

Balance Inquiry

To request balance inqury, you will need to hit this API through your Backend:

Direct API - Direct Debit Balance Inquiry
 Direct API - Direct Debit Balance Inquiry

API Request

TypeValueDescription
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/direct-debit/[acquirer-name]/v1.0/balance-inquiryPossible Values for [acquirer-name] : ovo, cimb, allobank, bri
API endpoint (Production)https://api.doku.com/direct-debit/[acquirer-name]/v1.0/balance-inquiryPossible 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) with formula
stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of request body for Balance Inquiry :

{
"bankCardToken": "78b7b881c207a079d6338033365dfb28"
}
Request Body Explanation
ParameterTypeMandatoryDescription
bankCardTokenstring MandatoryCustomer's token obtained from binding process

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:

1. OVO

{
"responseCode": "2001100",
"responseMessage": "Request has been processed successfully",
"accountInfo": [
{
"balanceType": "Cash",
"amount": {
"value": "200000.00",
"currency": "IDR"
},
"floatAmount": {
"value": "50000.00",
"currency": "IDR"
},
"holdAmount": {
"value": "20000.00",
"currency": "IDR"
},
"availableBalance": {
"value": "130000.00",
"currency": "IDR"
},
"ledgerBalance": {
"value": "30000.00",
"currency": "IDR"
},
"currentMultilateralLimit": {
"value": "10000.00",
"currency": "IDR"
},
"registrationStatusCode": "0001",
"status": "0001"
},
{
"balanceType": "Points",
"amount": {
"value": "200000.00",
"currency": "IDR"
},
"floatAmount": {
"value": "50000.00",
"currency": "IDR"
},
"holdAmount": {
"value": "20000.00",
"currency": "IDR"
},
"availableBalance": {
"value": "130000.00",
"currency": "IDR"
},
"ledgerBalance": {
"value": "30000.00",
"currency": "IDR"
},
"currentMultilateralLimit": {
"value": "10000.00",
"currency": "IDR"
},
"registrationStatusCode": "0001",
"status": "0001"
}
]
}
Response Balance Inquiry Explanation
ParameterTypeMandatoryDescription
responseCodestring (7)MandatoryResponse code as defined in SNAP Regulation
responseMessagestring (150)MandatoryResponse message as defined in SNAP Regulation
accountInfostring (64)Optional
accountInfo.balanceTypestring (70)OptionalAccount type name (CASH/POINT)
accountInfo.floatAmountobjectOptional
accountInfo.floatAmount.valueNumeric (16,2)ConditionalAmount of deposit that is not effective yet (due to holiday, etc.). balance of this type of account, ends with decimal .00
accountInfo.floatAmount.currencystring (3)ConditionalIDR
accountInfo.holdAmountobjectOptional
accountInfo.holdAmount.valueNumeric (16,2Conditionalbalance of Hold amount that cannot be used, ends with decimal .00
accountInfo.holdAmount.currencystring (3)ConditionalIDR
accountInfo.availableBalanceobjectOptional
accountInfo.availableBalance.valueNumeric (16,2MandatoryCustomer's auth code
accountInfo.availableBalance.currencystring(128)MandatoryCustomer's auth code
accountInfo.ledgerBalancestring(128)MandatoryCustomer's auth code
accountInfo.ledgerBalance.valuestring(128)MandatoryCustomer's auth code
accountInfo.ledgerBalance.currencystring(128)MandatoryCustomer's auth code
accountInfo.currentMultilateralLimitstring(128)MandatoryCustomer's auth code
accountInfo.currentMultilateralLimit.valuestring(128)MandatoryCustomer's auth code
accountInfo.currentMultilateralLimit.currencystring(128)MandatoryCustomer's auth code
registrationStatusCodestring(128)MandatoryCustomer's auth code
statusstring(128)MandatoryCustomer's auth code

2. Allo Bank


{
"responseCode": "2001100",
"responseMessage": "Successful",
"accountInfos": [
{
"balanceType": "balance",
"amount": {
"value": "1916427.00",
"currency": "IDR"
}
},
{
"balanceType": "point",
"amount": {
"value": "0",
"currency": "IDR"
}
},
{
"balanceType": "paylater",
"amount": {
"value": "50000000.00",
"currency": "IDR"
}
}
]
}
Response Balance Inquiry Notification Explanation
ParameterTypeMandatoryDescription
responseCodestring (7)MandatoryResponse code as defined in SNAP Regulation
responseMessagestring (150)MandatoryResponse message as defined in SNAP Regulation
accountInfoobjectOptional
accountInfo.balanceTypestringOptionalAccount type name (CASH/POINT)
accountInfo.amountobjectOptionalAvailable balance type in user's account (BALANCE, POINT, PAYLATER)
accountInfo.amount.valueNumeric (16,2)Conditionalbalance of this type of account, ends with decimal .00
accountInfo.amount.currencystring (3)ConditionalIDR