Z Zise Developers English

销卡预检

GET /v1/cards/{id}/close-check scope: cards:read
代会员调用 · 必带 x-on-behalf-of

销卡不可逆。POST /v1/cards/{id}/close 会自动把卡内剩余全部退回(不受产品最低保留余额限制),到账后冻结再注销。日常POST /v1/cards/{id}/withdrawals 仍受最低保留约束,且不能传reason=close。

预检用来决定要不要点销、以及点了之后卡在哪一步:closePhase: idle = 可以发 close;sweeping / freezing / closing = 已经在跑,轮询本接口即可;blocked_hold = 有未结算授权,等结算;blocked_fee = 有未结清的消费手续费。

⚠ canClose: false 不再表示「请先自己调 withdrawals」。剩余低于最低保留时 canClose 仍为 false,直接 POST close 即可。pendingWithdraw: true 或 closePhase: sweeping = 清退还在路上,不要再发一笔。

⚠ 这个端点的字段名是驼峰(canClose / pendingWithdraw / closePhase),与全站其余端点的蛇形命名不一致 —— 这是我方的历史遗留,按驼峰解析。

路径参数

字段类型必填说明
id string 必填 卡 id
字段类型必填说明
x-on-behalf-of string 必填 代哪个会员调用

响应

200金额都是最小单位整数串,按同一份响应里的 scale 换算。 held = balance − withdrawable(可能含冻结行政锁)。 authHeld 才是未结算授权;注销按钮只看这一列。
{
  "balance": "8000000",
  "held": "0",
  "authHeld": "0",
  "withdrawable": "8000000",
  "canClose": false,
  "pendingWithdraw": false,
  "closeRequested": false,
  "closePhase": "idle",
  "scale": 6,
  "currency": "USD"
}
404not_found 卡不存在或不在这个会员名下
请求
curl -X GET 'https://api.zinfra.vip/v1/cards/{id}/close-check' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-on-behalf-of: $MEMBER_ID'
const res = await fetch("https://api.zinfra.vip/v1/cards/{id}/close-check", {
  method: "GET",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-on-behalf-of": "$MEMBER_ID",
  },
});
// 金额按字符串读,别让它变成 number
const data = await res.json();
import requests

res = requests.get(
    "https://api.zinfra.vip/v1/cards/{id}/close-check",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-on-behalf-of": "$MEMBER_ID",
    },
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()
req, _ := http.NewRequest("GET", "https://api.zinfra.vip/v1/cards/{id}/close-check",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-on-behalf-of", "$MEMBER_ID")
res, err := http.DefaultClient.Do(req)
// 金额字段用 string 接,不要 float64
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/cards/{id}/close-check"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-on-behalf-of", "$MEMBER_ID")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
// 金额字段用 String / BigDecimal,不要 double
$ch = curl_init('https://api.zinfra.vip/v1/cards/{id}/close-check');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-on-behalf-of: $MEMBER_ID',
  ],
]);
$res = curl_exec($ch);
// 金额用 bcmath / 字符串,不要 floatval
200
{
  "balance": "8000000",
  "held": "0",
  "authHeld": "0",
  "withdrawable": "8000000",
  "canClose": false,
  "pendingWithdraw": false,
  "closeRequested": false,
  "closePhase": "idle",
  "scale": 6,
  "currency": "USD"
}