Validate API


The following endpoint can be used to fetch the bank account and account number validation:

/disbursements/validate

Request Parameters

Fieldis required?Description
account_numbermandatorystring The account number associated with the bank
bank_codemandatorystring The bank code. Please refer here to fetch bank details

Example

curl -X POST \
  https://api.durianpay.id/v1/disbursements/validate \
  -H 'authorization: [Base64({Your_Server_Key}:)]' \
  -H 'content-type: application/json' \
  -d '{
    "account_number": "123456789",
    "bank_code": "bca"
}'

Response Examples

//valid response status
{
    "data": {
        "account_number": "12383830",
        "bank_code": "bca",
        "account_holder": "Dummy Name",
        "status": "valid"
    }
}

//invalid response status
{
    "data": {
        "account_number": "12383831",
        "bank_code": "bca",
        "account_holder": "Dummy Name",
        "status": "invalid"
    }
}

API Usage

Please note the above endpoint takes some time to evaluate the results. When it's under evaluation it will return the status as processing.

Response Example

{
    "data": {
        "account_number": "123737383830",
        "bank_code": "bca",
        "account_holder": "",
        "status": "processing"
    }
}

Error Response Code : 400

Here is an example error response for invalid request

{
    "error": "error reading request body",
    "error_code": "DPAY_INTERNAL_ERROR",
}

Error Response Code : 401

Here is an example error response for unauthorized access

{
    "error": "invalid Authorization header in request",
    "error_code": "DPAY_UNAUTHORIZED_ACCESS"
}

Error Response Code : 500

Here is an example error response for internal server error

{
    "error": "error getting validation info from provided credentials",
    "error_code": "DPAY_INTERNAL_ERROR"
}