This section will explain how merchants can initiate balance inquiry using SNAP specification.
ServiceCode | Method | URL | Description |
---|---|---|---|
11 | POST | /{version}/balance-inquiry | API Balance Inquiry |
Request
Header
The following table is a header of request parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
Content-Type | M | String | Represent media type of request e.g “application/json” |
Authorization | M | Bearer token obtained from Access Token API in the format Bearer | |
X-TIMESTAMP | M | String(25) | Client's current local time in “yyyy-MM-ddTHH:mm:ssTZD” format |
X-SIGNATURE | M | See General API Symmetric Signature | |
X-PARTNER-ID | M | See Credential Exchange | |
X-EXTERNAL-ID | M | String(max 36), Numeric | Unique request reference number from partner. Must be unique. |
CHANNEL-ID | M | See Credential Exchange |
Body
The following table is a body of request parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
accountNo | M | String(32) | For Facilitator: Bank account ID registered in Iris for facilitator model, can be accessed in IRIS Portal in Bank Accounts menu. For Aggregator: 0000000000 |
Response
Header
The following table is a header of response parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
X-TIMESTAMP | M | String(25) | “yyyy-MM-ddTHH:mm:ssTZD” format |
Body
The following table is a body of response parameter:
Field Name | Attrib. | Datatype | Description |
---|---|---|---|
responseCode | M | String(7) | Response code |
responseMessage | M | String(150) | Response description |
accountInfos | O | Array | |
[].amount.value | M | String(16,2) | Net amount of the transaction. If it’s IDR then value includes 2 decimal digits. e.g. IDR 10.000, will be placed with 10000.00 |
[].amount.currency | M | String(3) | Currency (should always be IDR) |
Sample
Request
The following section is a sample of request parameter:
curl --location --request POST 'https://merchants.midtrans.com/v1.0/balance-inquiry' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMmUzODE4Mi00YjIxLTQ0YWMtOTVkNi1mMjFhMjEwZmIxZTAiLCJjbGllbnRJZCI6IjY2ODA1MmUzNGYxOTRhYThiZTc5ZTE1YTIxZTRmYzJmIiwibmJmIjoxNjYzODQwNTU5LCJleHAiOjE2NjM4NDE0NTksImlhdCI6MTY2Mzg0MDU1OX0.fEr0vIbB2kY8alZ-SROl3ftAFbfRd0uU-lGq9XuFi8M' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2022-03-04T08:02:09+07:00' \
--header 'X-SIGNATURE: yqmBXZ3yV6NPG1LtwXMm3quXzJMRX5Ms+r9ebc5xWIZGSKbZL3Oy871GHb7WQUucLa5nxN/HcnZYoNHc+KkWTQ==' \
--header 'X-PARTNER-ID: 668052e34f194aa8be79e15a21e4fc2f' \
--header 'X-EXTERNAL-ID: 91919644194391346361915387229113' \
--header 'CHANNEL-ID: 95221' \
--data-raw '{"accountNo": "bnia750516c"}'
Response
The following section is a sample of response parameter:
Content-Type : application/json
x-timestamp : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{
"responseCode": "2001100",
"responseMessage": "Success",
"accountInfos": [
{
"amount": {
"value": "998877.00",
"currency": "IDR"
}
}
]
}
Content-Type : application/json
x-timestamp : 2022-03-04T08:02:09+07:00
-------------------------------------------------------------------------------
{"responseCode": "5001100", "responseMessage": "Internal Server Error"}
Migration
Request
The following table is a comparison of request parameter:
Payouts non-SNAP-based (current) | Payouts SNAP-based | Description |
---|---|---|
bank_account_id | accountNo | For Facilitator: Bank account ID registered in Iris for facilitator model, can be accessed in IRIS Portal in Bank Accounts menu. For Aggregator: 0000000000 |
Response
The following table is a comparison of response parameter:
Payouts non-SNAP-based (current) | Payouts SNAP-based | Description |
---|---|---|
responseCode | Response code | |
responseMessage | Response description | |
balance | accountInfos[0].amount.value | Net amount of the transaction. If it’s IDR then value includes 2 decimal digits. e.g. IDR 10.000, will be placed with 10000.00 |
accountInfos[0].amount.currency | Currency (should always be IDR) |
Response Codes
Payouts non-SNAP-based (current) | Payout SNAP-based | Description |
---|---|---|
2001100 | Successful | |
4001101 | Invalid Field Format [fieldName] | |
4001102 | Missing Mandatory Field [fieldName] | |
4011100 | Unauthorized | |
4011101 | Invalid Token (B2B) | |
5001101 | Internal Server Error |