Z Zise Developers 简体中文

Custody reconciliation (balanced=false means a balance lacks your custody declaration)

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

Compares two amounts per asset: member_total, the total held by your members, and custody, the amount you declare held in custody. Under merchant-hosted custody, this is your only self-check for this relationship and uses the exact same criterion as our internal invariant.

balanced = false means some balance is not backed by your custody declaration. This signals an accounting incident or compromise, not a discrepancy to inspect later. Stop initiating new deposit declarations immediately and contact us.

⚠ member_total excludes funds on cards. Card funds physically reside with the issuing upstream and are outside this equation. A card may hold funds while this comparison remains balanced.

Both figures are fixed-point integer strings. This endpoint does not return ledger_scale; fetch and cache precision from GET /v1/assets.

Assets present on only one side are also included. If there is a member balance without a custody declaration or vice versa, the other side is "0".

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
{
  "data": [
    {
      "asset": "USDT",
      "member_total": "9430000000",
      "custody": "9430000000",
      "balanced": true
    },
    {
      "asset": "USD",
      "member_total": "120000000",
      "custody": "119000000",
      "balanced": false
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403insufficient_scope: missing merchant:read.
Request
curl -X GET 'https://api.zinfra.vip/v1/merchant/custody' \
  -H 'x-auth-token: Bearer $TOKEN'
const res = await fetch("https://api.zinfra.vip/v1/merchant/custody", {
  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/custody",
    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/custody",
    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/custody"))
    .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/custody');
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
{
  "data": [
    {
      "asset": "USDT",
      "member_total": "9430000000",
      "custody": "9430000000",
      "balanced": true
    },
    {
      "asset": "USD",
      "member_total": "120000000",
      "custody": "119000000",
      "balanced": false
    }
  ],
  "next_cursor": null,
  "has_more": false
}