Get Wallet Balance
Query the balance and cumulative recharge/debit amounts of a wallet in a specified currency. If the account has no wallet record yet, a zero-balance object is returned and no wallet record is created. /papi/wallet/get is an alias path of the same interface.
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 + digits |
Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| currency | string | No | Currency code, only USD is supported, defaults to USD |
Request Example:
json
{
"currency": "USD"
}Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| code | integer | Error code. See Error Codes |
| data | object | Response data |
| ├─ currency | string | Currency code |
| ├─ currencySymbol | string | Currency symbol, e.g. $ for USD |
| ├─ balance | string | Current wallet balance (cents) |
| ├─ totalRechargeAmount | string | Cumulative recharge amount (cents) |
| ├─ totalDebitAmount | string | Cumulative debit amount (cents) |
| ├─ status | string | Wallet status (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": ""
}