Get Wallet Balance
Query the wallet balance of a specified currency along with total recharge and debit amounts. /papi/wallet/balance and /papi/wallet/get are two paths of the same API and share the same request body.
Interface Address:
text
/papi/wallet/balanceRequest Method:
text
POSTContent-Type:
text
application/jsonHeader Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Access-Key | string | Yes | API access key ID. See API Rules for authentication |
| X-Signature | string | Yes | Signature value, Base64-encoded HMAC-SHA256 result |
| X-Timestamp | string | Yes | Millisecond-level Unix timestamp (13 digits) |
| X-Nonce | string | Yes | Random string, 10~32 lowercase letters and digits |
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| currency | string | No | Currency code; only USD is supported |
Request Example:
json
{
"currency": "USD"
}Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| code | integer | Error code. See Error Codes |
| data | object | Return data |
| ├─ currency | string | Currency code |
| ├─ currencySymbol | string | Currency symbol, e.g. $ for USD |
| ├─ balance | string | Current wallet balance, in cents |
| ├─ totalRechargeAmount | string | Total recharge amount, in cents |
| ├─ totalDebitAmount | string | Total debit amount, in cents |
| ├─ status | string | Wallet status, e.g. NORMAL |
| ├─ version | string | Wallet version |
| msg | string | Error message |
Response Example:
json
{
"code": 0,
"data": {
"currency": "USD",
"currencySymbol": "$",
"balance": "1250",
"totalRechargeAmount": "2000",
"totalDebitAmount": "750",
"status": "NORMAL",
"version": "3"
},
"msg": ""
}Notes:
- Balance, total amounts and version are strings; do not process them as floating-point numbers.
- Returns a zero-balance object when the account has no wallet record yet; querying does not create a wallet record.
