Query balance
Sandbox https://test.lintaspay.xyz/finance/query-balance · Production https://lintaspay.xyz/finance/query-balance
Returns the account balance. May be disabled for your merchant account (code 10011430).
Request
Headers
| Header | Required | Value |
|---|---|---|
Content-Type | required | application/json |
Authorization | required | LINTASPAY-SHA256withRSA app_id=…,nonce=…,timestamp=…,sign=… — see Signing requests |
lintaspay-request-id | required | Unique request id, [A-Za-z0-9_-], max 64 |
Body parameters
Send an empty JSON object: {}
Example
{}Response
HTTP 200 with the envelope {"code", "message", "data"}. code = 0 means success; otherwise data is null and code is an error code. Authentication failures return HTTP 401 (403 for a blocked IP, 429 when rate-limited). Always verify the response signature.
data fields
| Name | Type | Description |
|---|---|---|
merchantId | integer | Example: 100001 |
availableBalance | string | Example: 619984.00 |
frozenBalance | string | Example: 0.00 |
pendingSettlementAmount | string | Example: 15000.00 |
totalBalance | string | Example: 634984.00 |
currency | string | Example: IDR |
Examples
{
"code": 0,
"message": "success",
"data": {
"merchantId": 100001,
"availableBalance": "619984.00",
"frozenBalance": "0.00",
"pendingSettlementAmount": "15000.00",
"totalBalance": "634984.00",
"currency": "IDR"
}
}{
"code": 10011304,
"message": "Signature verification failed",
"data": null
}Code samples
URL_PATH=/finance/query-balance
BODY='{}'
AUTH="app_id=$APP_ID,nonce=$(openssl rand -hex 16),timestamp=$(date +%s)000"
SIGN=$(printf '%s\nPOST\n%s\n%s\n' "$AUTH" "$URL_PATH" "$BODY" \
| openssl dgst -sha256 -sign merchant_private_key.pem | base64 | tr -d '\n')
curl -sS -X POST "https://test.lintaspay.xyz$URL_PATH" \
-H 'Content-Type: application/json' \
-H "Authorization: LINTASPAY-SHA256withRSA $AUTH,sign=$SIGN" \
-H "lintaspay-request-id: $(openssl rand -hex 16)" \
-d "$BODY"// call() is defined on the Signing requests page
const res = await call('/finance/query-balance', {});
if (res.code !== 0) throw new Error(`${res.code} ${res.message}`);
console.log(res.data);# call() is defined on the Signing requests page
res = call("/finance/query-balance", {})
if res["code"] != 0:
raise RuntimeError(f"{res['code']} {res['message']}")
print(res["data"])<?php
// api_call() is defined on the Signing requests page
$res = api_call('/finance/query-balance', new stdClass());
if ($res['code'] !== 0) {
throw new RuntimeException($res['code'] . ' ' . $res['message']);
}
print_r($res['data']);// ApiClient is defined on the Signing requests page
ApiClient client = new ApiClient();
String body = "{}";
String res = client.call("/finance/query-balance", body);
System.out.println(res);