Skip to main content

Crypto Balance Inquiry

TOPPAY TeamAbout 3 min

Overview

The balance inquiry API returns the real-time balance of a merchant's crypto account, including available balance, frozen amount and total amount. You can query a single coin or fetch all enabled coins at once.

Common request headers (including the mandatory Nonce), common body fields and the unified response envelope are described in Crypto Integration Overview.


Request path

Domain: Prefer unified host openapi.toppayment.com (path unchanged); legacy crypto domain (global-digit-openapi.toppayment.com) remains available.

EnvironmentURL
Sandboxhttps://openapi.toppayment.com/crypto/sandbox/balance/v1
Productionhttps://openapi.toppayment.com/crypto/balance/v1

Request headers

FieldRequiredTypeDescription
Content-TypeMStringFixed value: application/json
NonceMString(16-64)Anti-replay random string, unique within 10 minutes, excluded from the signature

Request body

FieldRequiredTypeDescription
mchNoMString(32)Merchant number
In sandbox use the SD-prefixed sandbox merchant number
timestampMString(13)Request timestamp (13-digit milliseconds), within ±5 minutes
signMStringSignature, see Signature
currencyOString(16)Coin
Provided: returns only that coin
Omitted or empty: returns balances for all enabled coins
Example: USDT
netWorkOString(100)Chain network
Only echoed back in the response netWork field; it does not filter balances
Crypto balances are booked per coin, not per chain
tenantCodeOString(32)Sub-tenant code, defaults to the default tenant
countryCodeOString(16)Country code, not needed for crypto

netWork does not affect the balance

Account balances are booked per coin; holdings of the same coin across different chains are aggregated. The netWork in the request is only echoed back and will not filter or split the balance.

Request example

Content-Type: application/json
Nonce: a91e60c3b7d248f5c0a2

Response body

FieldRequiredTypeDescription
successMBooleanWhether the request succeeded
codeMStringResponse code
9999: success; otherwise see Exception Codes
msgOStringResponse message, null on success
timeStampMNumberServer response time (milliseconds)
dataMObjectResponse payload
mchNoMStringMerchant number
tenantCodeMStringTenant code
The merchant's default tenant code when tenantCode is omitted
balancesMArrayBalance details
An empty array [] when no account is available
tenantCodeMStringTenant code
currencyMStringCoin
netWorkOStringChain network
Echoes the request netWork; null when omitted
balanceMNumberAvailable balance
Quantity currently usable for payouts and fees
freezeMNumberFrozen amount
Held by in-flight payouts, risk holds, etc.
totalAmountMNumberTotal amount held in the account

Precision

Balance amounts are returned with 8 decimal places. Parse them with a high-precision type (BigDecimal, Decimal, etc.) and avoid floating point.

Response example

{
    "success": true,
    "code": "9999",
    "msg": null,
    "timeStamp": 1767873172906,
    "data": {
        "mchNo": "JIMMY001",
        "tenantCode": "JIMMY001",
        "balances": [
            {
                "tenantCode": "JIMMY001",
                "currency": "USDT",
                "netWork": null,
                "balance": 12580.36000000,
                "freeze": 120.00000000,
                "totalAmount": 12700.36000000
            }
        ]
    }
}

Sandbox response differences

The sandbox response shape differs from production

The sandbox balance endpoint returns mock data with a different shape: sandbox returns flat single-coin fields whereas production returns a balances array. Parse the response per environment.

  • The balance is always 2000000 and freeze is always 0.
  • When currency is omitted, sandbox defaults to USDT.
FieldTypeDescription
mchNoStringMerchant number (sandbox merchant number)
currencyStringCoin, USDT when omitted in the request
totalAmountNumberTotal amount, always 2000000
balanceNumberAvailable balance, always 2000000
freezeNumberFrozen amount, always 0
waitingSettleAmountNumberAmount awaiting settlement, always 0
freezeWaitingSettleAmountNumberFrozen amount awaiting settlement, always 0
{
    "success": true,
    "code": "9999",
    "msg": null,
    "timeStamp": 1767873172906,
    "data": {
        "mchNo": "SDJIMMY001",
        "currency": "USDT",
        "totalAmount": 2000000,
        "balance": 2000000,
        "freeze": 0,
        "waitingSettleAmount": 0,
        "freezeWaitingSettleAmount": 0
    }
}

References