Query balance
POST /v1/api/tenant/query_balance
- data is an object, not an account list. Do not subtract frozen funds twice.
Request fields
| Field | Type | Requirement | Description |
|---|---|---|---|
tenant_id | string | Required | Merchant ID; must belong to the same merchant as app_key. Maximum 20 characters. |
app_key | string | Required | Application key, maximum 16 characters; sign using the secret of this exact application. |
timestamp | string / integer | Required | Current Unix timestamp in seconds. Timestamps older than 60 seconds are rejected; do not send milliseconds. |
sign | string | Required | 32-character lowercase MD5 calculated using the signature rules. |
For algorithm details, see signature rules.
Request example · cURL
bash
curl --request POST 'https://api.trpay2024.com/v1/api/tenant/query_balance' \
--header 'Content-Type: application/json' \
--data-raw '{
"tenant_id": "DEMO0001",
"app_key": "demo_app_key",
"timestamp": "1791199800",
"sign": "4ec5f59fa281ba9a12439f3adbb29fca"
}'Response example
json
{
"request_id": "00000000-0000-4000-8000-000000000001",
"path": "/v1/api/tenant/query_balance",
"success": true,
"code": 200,
"message": "成功",
"data": {
"merchantCode": "DEMO0001",
"balance": 10000,
"totalBalance": 10521,
"creditBalance": 0,
"freezeBalance": 521,
"usableBalance": 10000
}
}Fields in data
| Field | Type | Requirement | Description |
|---|---|---|---|
merchantCode | string | Required | Merchant ID. |
balance | number | Required | Available account balance. |
totalBalance | number | Required | Available plus frozen balance. |
creditBalance | number | Required | Credit limit. |
freezeBalance | number | Required | Frozen balance. |
usableBalance | number | Required | Available balance plus credit limit. |
Error handling
See HTTP handling, request errors and error codes.