商户资金账户(可用 / 冻结 / 待结算 / 托管声明)
商户自身
逐资产一行。四个数是四个桶,不是同一个数的四种口径:
available预付可用余额。所有成本都先冻结它 —— 它见底的表现是
你的会员开始拿到 service_unavailable;
frozen已为在途订单冻结、尚未结算的部分;payable待结算;custody你需要为你的会员实际持有多少。这一条不是我方欠你的钱,
是你欠你会员的钱。它与会员七桶合计的对比在
GET /v1/merchant/custody。
⚠ 五个金额都是定点整数串(无小数点),位数看同一行的
ledger_scale。display_scale 只截显示位,拿它定标会差几个数量级。
余额为 0 的资产不出现在这里 —— 这张表按你有过账的资产成行。
响应
200OK
{
"balances": [
{
"asset": "USDT",
"available": "1250000000",
"frozen": "80000000",
"payable": "0",
"custody": "9430000000",
"ledger_scale": 6,
"display_scale": 2
}
]
}403
insufficient_scope 缺 merchant:read请求
curl -X GET 'https://api.zise.com/v1/merchant/balances' \
-H 'x-auth-token: Bearer $TOKEN'const res = await fetch("https://api.zise.com/v1/merchant/balances", {
method: "GET",
headers: {
"x-auth-token": "Bearer $TOKEN",
},
});
// 金额按字符串读,别让它变成 number
const data = await res.json();import requests
res = requests.get(
"https://api.zise.com/v1/merchant/balances",
headers={
"x-auth-token": "Bearer $TOKEN",
},
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()req, _ := http.NewRequest("GET", "https://api.zise.com/v1/merchant/balances",
nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
res, err := http.DefaultClient.Do(req)
// 金额字段用 string 接,不要 float64HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.zise.com/v1/merchant/balances"))
.header("x-auth-token", "Bearer $TOKEN")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
// 金额字段用 String / BigDecimal,不要 double$ch = curl_init('https://api.zise.com/v1/merchant/balances');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-auth-token: Bearer $TOKEN',
],
]);
$res = curl_exec($ch);
// 金额用 bcmath / 字符串,不要 floatval
200
{
"balances": [
{
"asset": "USDT",
"available": "1250000000",
"frozen": "80000000",
"payable": "0",
"custody": "9430000000",
"ledger_scale": 6,
"display_scale": 2
}
]
}