Z Zise Developers 简体中文

Sandbox: clear delivery records and API logs

POST /v1/sandbox/reset scope: merchant:read
Merchant account Requires x-idempotency-key

Clears two tables: merchant_webhook_deliveries for webhook delivery records and merchant_api_logs for API call logs, and removes behavior injections for all four upstreams.

Does not delete any ledger entries, orders, or members. The ledger is append-only; deleting it would teach an operation that cannot be performed in production, undermining the sandbox's purpose of matching production. Deleting orders while retaining journals would also leave ledger entries without orders, a production incident pattern.

Balances therefore do not reset to zero. To spend funds, create orders; to add funds, use the faucet.

FieldTypeRequiredDescription
x-idempotency-key string Required UUID v4

Response

200Cleared; cleared reports the number of deleted rows per table.
{
  "ok": true,
  "cleared": {
    "merchant_webhook_deliveries": 412,
    "merchant_api_logs": 5031
  },
  "note": "账本分录与订单不删 —— 账本是追加写的,删它等于教你一个在生产上做不了的动作。"
}
404Not in the sandbox environment.
Request
curl -X POST 'https://api.zinfra.vip/v1/sandbox/reset' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-idempotency-key: $IDEMPOTENCY_KEY'
const res = await fetch("https://api.zinfra.vip/v1/sandbox/reset", {
  method: "POST",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-idempotency-key": "$IDEMPOTENCY_KEY",
  },
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.post(
    "https://api.zinfra.vip/v1/sandbox/reset",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-idempotency-key": "$IDEMPOTENCY_KEY",
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("POST", "https://api.zinfra.vip/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)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/sandbox/reset"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-idempotency-key", "$IDEMPOTENCY_KEY")
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/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);
// Use bcmath / strings for amounts, not floatval.
200
{
  "ok": true,
  "cleared": {
    "merchant_webhook_deliveries": 412,
    "merchant_api_logs": 5031
  },
  "note": "账本分录与订单不删 —— 账本是追加写的,删它等于教你一个在生产上做不了的动作。"
}