Z Zise Developers 简体中文

Sandbox: available simulated card transaction scenarios

GET /v1/sandbox/card-scenarios scope: cards:read
Merchant account

Available only in the sandbox. Live credentials return 404, not 403: this capability must not exist in production. The check is whether the merchant resolved from the current token is a sandbox shadow entity.

Each scenario includes expect, describing what should happen. It is the same text used for our internal assertions. Use it as the acceptance criterion rather than the status code alone.

The list grows as we add scenarios; do not hardcode it in your implementation.

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 (not paginated).
{
  "data": [
    {
      "key": "auth_ok",
      "label": "消费成功(授权+入账)",
      "category": "issuing",
      "type": "transaction",
      "expect": "过⑤号凭证 · 已使用额度 +金额 · 可用额度 −金额 · 不计风控"
    },
    {
      "key": "chargeback",
      "label": "拒付争议(2006)",
      "category": "issuing",
      "type": "transaction",
      "expect": "记一条 chargeback 风控事件 · 免罚 0 次 · 每次 10 USD · 3 次冻卡"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
404Not in the sandbox environment.
Request
curl -X GET 'https://api.zinfra.vip/v1/sandbox/card-scenarios' \
  -H 'x-auth-token: Bearer $TOKEN'
const res = await fetch("https://api.zinfra.vip/v1/sandbox/card-scenarios", {
  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/sandbox/card-scenarios",
    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/sandbox/card-scenarios",
    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/sandbox/card-scenarios"))
    .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/sandbox/card-scenarios');
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": [
    {
      "key": "auth_ok",
      "label": "消费成功(授权+入账)",
      "category": "issuing",
      "type": "transaction",
      "expect": "过⑤号凭证 · 已使用额度 +金额 · 可用额度 −金额 · 不计风控"
    },
    {
      "key": "chargeback",
      "label": "拒付争议(2006)",
      "category": "issuing",
      "type": "transaction",
      "expect": "记一条 chargeback 风控事件 · 免罚 0 次 · 每次 10 USD · 3 次冻卡"
    }
  ],
  "next_cursor": null,
  "has_more": false
}