Z Zise Developers 简体中文

Merchant funding accounts (available / frozen / payable / custody declaration)

GET /v1/merchant/balances scope: merchant:read
Merchant account

One row per asset. These four figures are four distinct buckets, not different presentations of one amount:

  • available: available prepaid balance. All costs are first frozen from this bucket; when it runs out, your members begin receiving service_unavailable.
  • frozen: funds held for orders in progress but not yet settled.
  • payable: awaiting settlement.
  • custody: how much you must actually hold for your members. This is not money we owe you; it is money you owe your members. Compare it with the total of the seven member buckets through GET /v1/merchant/custody.

⚠ All five amounts are fixed-point integer strings, without a decimal point. Use ledger_scale on the same row. display_scale only controls displayed digits; using it for scaling causes orders-of-magnitude errors.

Assets with a balance of 0 do not appear here: rows are created for assets with posted activity.

Parameters

This endpoint takes no parameters: no path parameters, query parameters or request body. For the authentication header (x-auth-token) and on-behalf-of header (x-on-behalf-of), see Authentication and Signing.

Response

200OK
{
  "balances": [
    {
      "asset": "USDT",
      "available": "1250000000",
      "frozen": "80000000",
      "payable": "0",
      "custody": "9430000000",
      "ledger_scale": 6,
      "display_scale": 2
    }
  ]
}
403insufficient_scope: missing merchant:read.
Request
curl -X GET 'https://api.zinfra.vip/v1/merchant/balances' \
  -H 'x-auth-token: Bearer $TOKEN'
const res = await fetch("https://api.zinfra.vip/v1/merchant/balances", {
  method: "GET",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
  },
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.get(
    "https://api.zinfra.vip/v1/merchant/balances",
    headers={
        "x-auth-token": "Bearer $TOKEN",
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("GET", "https://api.zinfra.vip/v1/merchant/balances",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/merchant/balances"))
    .header("x-auth-token", "Bearer $TOKEN")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/v1/merchant/balances');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
  ],
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
  "balances": [
    {
      "asset": "USDT",
      "available": "1250000000",
      "frozen": "80000000",
      "payable": "0",
      "custody": "9430000000",
      "ledger_scale": 6,
      "display_scale": 2
    }
  ]
}