Dark Mode

Fetch Balance API


The following endpoint retrieves the balance in the durianpay account:

/balance-inquiry

Run in Postman

Request Header Attributes

Following are the parameters to be sent in the request header:

Content-Type

string
Mandatory

Indicates the media type of the resource. value: application/json

X-TIMESTAMP

string
Mandatory

Timestamp in ISO8601 format, Example: 2024-05-14T18:54:57+07:00

Authorization

String
Mandatory

Represents Access Token (B2B) of a request; string starts with keyword “Bearer ” followed by Access Token (B2B)

To know how to obtain access token, please visit the Implementation Guide here.

X-SIGNATURE

String
Mandatory

Signature generated with by encrypting HTTP method, relative path, access token, minified request body, and timestamp

To know how to generate signature, please visit the Implementation Guide here.

X-PARTNER-ID

String
Mandatory

Unique ID for a partner given by Durianpay upon completing registration. Its value is same as the X-CLIENT-KEY

X-EXTERNAL-ID

String
Mandatory

Unique messaging reference identifier generated by merchant and should be unique within the same day

CHANNEL-ID

String
Mandatory

Device identification on which the API services is currently being accessed by the merchant. Possible value: 95221

Request Body Attributes

Following are the parameters to be sent in the request body:

accountNo

String
Mandatory

Merchant's balance accountNo (merchant_id)

additionalInfo

Object
Optional

JSON object with keys: deviceId and channel. example: {"deviceId": "1234567", "channel": "mobilephone"}

Hide items object

FieldTypeDescription

deviceIdOptional

string

device id of the request source

channelOptional

string

channel of the request source

Example
curl --location 'https://api.durianpay.id/v1.0/balance-inquiry' \
--header 'X-TIMESTAMP: 2023-07-31T10:55:00+07:00' \
--header 'X-SIGNATURE: SlCb5OKordx8WVhAE5bkg4M8U1vbI7hyHb07G/ydStvTIBmNgEzHj8PdLVbp2iWY1k2e/jgwWmKsrIj/AvH9rw==' \
--header 'X-PARTNER-ID: partner_id' \
--header 'X-EXTERNAL-ID: 202001' \
--header 'CHANNEL-ID: 95521' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1Nzk0MjYsImlhdCI6MTcxNTU3ODUyNiwibWVyY2hhbnRfaWQiOiJtZXJfTXNDdElQaHFSYzgwNDUiLCJncmFudF90eXBlIjoiQVVUSE9SSVpBVElPTl9DT0RFIiwiY2xpZW50X2tleSI6ImNsaWVudF84MDQ1In0.H2IMBY0MiGNvjHwVwXoYekajhPocBxflmodiHxbm0XA' \
--data '{
    "accountNo": "7382382957893840",
    "additionalInfo": {
        "deviceId": "123456",
        "channel": "phone"
    }
}'

Response Code

200 - Success

1
2
3
4
5
6
7
8
9
10
11
12
{
    "accountInfo": [
        {
            "availableBalance": {
                "currency": "IDR",
                "value": "100000.00"
            }
        }
    ],
    "responseCode": "2001100",
    "responseMessage": "Successful"
}

400 - Bad Request - Invalid Mandatory Field

400 - Bad Request - Invalid Field Format

400 - Bad Request - Missing Header

401 - Unauthorized - Invalid Token

401 - Unauthorized - Invalid Signature

409 - Conflict

500 - Internal Server Error

504 - Gateway Timeout