Z Zise Developers

沙盒 · 清掉投递记录与调用日志

POST /v1/sandbox/reset scope: merchant:read
商户自身 x-idempotency-key

清两张表:merchant_webhook_deliveries(Webhook 投递记录)与

merchant_api_logs(API 调用日志),并把四家上游的行为注入删掉。

账本分录、订单、会员一条都不删。 账本是追加写的,删它等于教你

一个在生产上做不了的动作 —— 而沙盒的全部意义是「与生产一样」。

删单留凭证还会造出一个「有账没单」的状态,那在生产上是一次事故的形状。

所以重置之后余额不会归零:那是对的。要花掉就下单,要更多钱就用水龙头。

字段类型必填说明
x-idempotency-key string 必填 UUID v4

响应

200已清理(cleared 逐表给删掉的行数)
{
  "ok": true,
  "cleared": {
    "merchant_webhook_deliveries": 412,
    "merchant_api_logs": 5031
  },
  "note": "账本分录与订单不删 —— 账本是追加写的,删它等于教你一个在生产上做不了的动作。"
}
404不在沙盒环境
请求
curl -X POST 'https://api.zise.com/v1/sandbox/reset' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-idempotency-key: $IDEMPOTENCY_KEY'
const res = await fetch("https://api.zise.com/v1/sandbox/reset", {
  method: "POST",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-idempotency-key": "$IDEMPOTENCY_KEY",
  },
});
// 金额按字符串读,别让它变成 number
const data = await res.json();
import requests

res = requests.post(
    "https://api.zise.com/v1/sandbox/reset",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-idempotency-key": "$IDEMPOTENCY_KEY",
    },
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()
req, _ := http.NewRequest("POST", "https://api.zise.com/v1/sandbox/reset",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-idempotency-key", "$IDEMPOTENCY_KEY")
res, err := http.DefaultClient.Do(req)
// 金额字段用 string 接,不要 float64
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zise.com/v1/sandbox/reset"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-idempotency-key", "$IDEMPOTENCY_KEY")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
// 金额字段用 String / BigDecimal,不要 double
$ch = curl_init('https://api.zise.com/v1/sandbox/reset');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-idempotency-key: $IDEMPOTENCY_KEY',
  ],
]);
$res = curl_exec($ch);
// 金额用 bcmath / 字符串,不要 floatval
200
{
  "ok": true,
  "cleared": {
    "merchant_webhook_deliveries": 412,
    "merchant_api_logs": 5031
  },
  "note": "账本分录与订单不删 —— 账本是追加写的,删它等于教你一个在生产上做不了的动作。"
}