Skip to content

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/balance

Request Method:

text
POST

Content-Type:

text
application/json

Header Parameters:

ParameterTypeRequiredDescription
X-Access-KeystringYesAPI access key ID. See API Rules for authentication
X-SignaturestringYesSignature value, Base64-encoded HMAC-SHA256 result
X-TimestampstringYesMillisecond-level Unix timestamp (13 digits)
X-NoncestringYesRandom string, 10~32 lowercase letters and digits

Body Parameters:

ParameterTypeRequiredDescription
currencystringNoCurrency code; only USD is supported

Request Example:

json
{
  "currency": "USD"
}

Response Parameters:

ParameterTypeDescription
codeintegerError code. See Error Codes
dataobjectReturn data
├─ currencystringCurrency code
├─ currencySymbolstringCurrency symbol, e.g. $ for USD
├─ balancestringCurrent wallet balance, in cents
├─ totalRechargeAmountstringTotal recharge amount, in cents
├─ totalDebitAmountstringTotal debit amount, in cents
├─ statusstringWallet status, e.g. NORMAL
├─ versionstringWallet version
msgstringError 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.

OpenAPI Docs