Z Zise Developers

取消预览(能不能取消 · 退多少)

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

先看再取消。 退款按阶段递减 —— 还没报给上游时全退,进了制卡就只退一部分 —— 而取消不可逆。不先让用户看见退多少就点下去,那笔差额永远说不清。

cancellable: false 时不要画那颗按钮。stage 是这一单走到哪一档了;认不出的值原样回显,别 default 成「处理中」。

refund_total 已经是最终数(开卡费与邮费各按各的比例算完加起来),不用再乘任何比例。

路径参数

字段类型必填说明
id string 必填 申请单 id。带不带 cap_ 前缀都收。
字段类型必填说明
x-on-behalf-of string 必填

响应

200OK
{
  "stage": "submitted",
  "cancellable": true,
  "asset": "USDT",
  "ledger_scale": 6,
  "refund_total": "20.00"
}
404not_found 单不存在,或不在这个会员/这个商户名下
请求
curl -X GET 'https://api.zise.com/v1/cards/applications/{id}/cancel-preview' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-on-behalf-of: $MEMBER_ID'
const res = await fetch("https://api.zise.com/v1/cards/applications/{id}/cancel-preview", {
  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.zise.com/v1/cards/applications/{id}/cancel-preview",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-on-behalf-of": "$MEMBER_ID",
    },
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()
req, _ := http.NewRequest("GET", "https://api.zise.com/v1/cards/applications/{id}/cancel-preview",
    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.zise.com/v1/cards/applications/{id}/cancel-preview"))
    .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.zise.com/v1/cards/applications/{id}/cancel-preview');
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
{
  "stage": "submitted",
  "cancellable": true,
  "asset": "USDT",
  "ledger_scale": 6,
  "refund_total": "20.00"
}