Appearance
Balance Inquiry
Information
Merchant use this API to check balance user or check available balance that can use to transaction.
| Path | /v1.0/balance-inquiry |
|---|---|
| HTTP Method | POST |
| Service Code | 11 |
| Type Format | JSON |
Header Request
Details
| Name | Value | Detail |
|---|---|---|
| Content-Type | application/json | Mandatory |
| Authorization | String | Mandatory. Represents access_token of a request; string starts with keyword Bearer followed by access_token (e.g. Bearer eyJraWQiOi...Jzc29zIiwY) |
| Authorization-Customer | String | Mandatory. Optional if the payment does not use account binding, but mandatory if the payment uses account binding. Represents access_token of a request belonging to customer; string starts with keyword Bearer followed by access_token (e.g. Bearer eyJrsWaiOi...Jzc523awiY) |
| X-TIMESTAMP | yyyy-MM-ddTHH:mm:ssTZD | Mandatory. Client current local time |
| X-SIGNATURE | String | Mandatory. Represents signature of a request. X-Signature: symmetric signature algorithm HMAC_SHA512 (clientSecret, stringToSign). Formula: stringToSign = HTTPMethod + ":" + EndpointUrl + ":" + AccessToken + ":" + Lowercase(HexEncode(SHA-256(minify(RequestBody)))) + ":" + TimeStamp. Notes: (1) Endpoint URL includes full relative path and query parameters. (2) If Request Body is empty, use empty string for minify(RequestBody). |
| X-PARTNER-ID | String(36) | Mandatory. Unique ID for a partner (merchant_index) |
| X-EXTERNAL-ID | String(36) | Mandatory. Numeric string. Reference number that should be unique in the same day per merchant ID |
| CHANNEL-ID | String(20) | Mandatory. See channel id on overview page |
Request Body
Details
| Parameter | Value | Mandatory | Length | Description |
|---|---|---|---|---|
| partnerReferenceNo | String | M | 64 | Transaction identifier on the service consumer system |
| accountNo | String | C | 16 | Filled with Phone No. Mandatory only for OVO and DANA |
| additionalInfo | Object | O | - | Additional information for custom use that are not provided by SNAP |
Example Request
Details
sh
POST .../v1.0/balance-inquiry HTTP/1.2
Content-type: application/json
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a"
Authorization-Customer: Bearer fa8sjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a"
X-TIMESTAMP: 2020-12-18T15:06:00+07:00
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221
{
"partnerReferenceNo":"2020102900000000000001",
"accountNo":"0857742221322",
"additionalInfo":{}
}Response Body
Details
| Parameter | Data Type | Mandatory | Length | Description |
|---|---|---|---|---|
| responseCode | String | M | 7 | Response code |
| responseMessage | String | M | 150 | Response description |
| referenceNo | String | O | 64 | Transaction identifier on service provider system |
| partnerReferenceNo | String | O | 64 | Transaction identifier on service consumer system |
| accountNo | String | O | 32 | Registered account number / phone no |
| accountInfos | Array | O | - | - |
| balanceType | String | O | 70 | Account type name |
| availableBalance | Object | O | - | - |
| value | String | M | 16,2 | Account balance that can be used for financial transaction |
| currency | String | M | 3 | Currency (ISO4217) |
| additionalInfo | Object | O | - | Additional information for custom use that are not provided by SNAP |
Example Response
Details
sh
Content-type: application/json
X-TIMESTAMP: 2020-12-18T15:06:07+07:00
{
"responseCode":"2001100",
"responseMessage":"Request has been processed successfully",
"referenceNo":"2020102977770000000009",
"partnerReferenceNo":"2020102900000000000001",
"accountNo":"0857742221322",
"accountInfos":[
{
"balanceType":"Cash",
"availableBalance":{
"value":"130000.00",
"currency":"IDR"
}
},
{
"balanceType":"Coins",
"availableBalance":{
"value":"130000.00",
"currency":"IDR"
}
}
],
"additionalInfo":{
}
}