Z Zise Developers

单个导出任务的状态(这是轮询口

GET /v1/reports/{id} scope: merchant:read
商户自身

轮询这里等 status: ready。这次调用会顺带把队列往前推一步

(只在真的有活时推),所以在没有定时任务的今天,它同时是这条线的

自愈通道 —— 重复调用无害。

⚠ 推进挂在后台,不会让这次请求等到报表生成完(那正是把它做成

异步任务要躲开的那个 CPU 时限)。所以你本次拿到的仍是当前状态,

再轮询一次即可。

status 五档:queued · building · ready · failed ·

expired。⚠ 认不出的值请原样回显,不要 default

download_url 不是一条免鉴权直链

  • 只有 status: ready 时它非 null
  • 它指向 GET /v1/reports/{id}/content,**取件仍要带

x-auth-token**(以及这把 Key 的 IP 白名单等全部约束)。

我方刻意不签一个带签名的永久 URL:签出去的链接一旦泄露就是永久可读,

而导出件里是你的全部经营数字

expires_atready 之后保留 7 天,到点我方删对象并把状态置

expired —— 经营数据不该无限期躺在对象存储里。过期后重新发起一次导出。

路径里的 id 带不带 rep_ 前缀都认(把我方发的 id 原样回填是

最自然的用法)。「不存在」与「属于别的商户」是同一个响应 ——

区分开就等于送出一个跨商户 id 探测接口。

路径参数

字段类型必填说明
id string 必填 任务 id,rep_<uuid> 或裸 <uuid> 都认

响应

200OK
{
  "id": "rep_4c8a10d2-91f7-4a3e-b0c6-52d8e7f19b34",
  "kind": "statements",
  "status": "ready",
  "rows": 1842,
  "bytes": 214093,
  "error": "",
  "download_url": "https://api.zise.com/v1/reports/rep_4c8a10d2-91f7-4a3e-b0c6-52d8e7f19b34/content",
  "expires_at": "2026-08-20T05:00:07.220Z",
  "created_at": "2026-08-13T05:00:00.000Z",
  "updated_at": "2026-08-13T05:00:07.220Z"
}
403insufficient_scopemerchant:read
404resource_not_found(含「属于别的商户」,同一响应)
请求
curl -X GET 'https://api.zise.com/v1/reports/{id}' \
  -H 'x-auth-token: Bearer $TOKEN'
const res = await fetch("https://api.zise.com/v1/reports/{id}", {
  method: "GET",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
  },
});
// 金额按字符串读,别让它变成 number
const data = await res.json();
import requests

res = requests.get(
    "https://api.zise.com/v1/reports/{id}",
    headers={
        "x-auth-token": "Bearer $TOKEN",
    },
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()
req, _ := http.NewRequest("GET", "https://api.zise.com/v1/reports/{id}",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
res, err := http.DefaultClient.Do(req)
// 金额字段用 string 接,不要 float64
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zise.com/v1/reports/{id}"))
    .header("x-auth-token", "Bearer $TOKEN")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
// 金额字段用 String / BigDecimal,不要 double
$ch = curl_init('https://api.zise.com/v1/reports/{id}');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
  ],
]);
$res = curl_exec($ch);
// 金额用 bcmath / 字符串,不要 floatval
200
{
  "id": "rep_4c8a10d2-91f7-4a3e-b0c6-52d8e7f19b34",
  "kind": "statements",
  "status": "ready",
  "rows": 1842,
  "bytes": 214093,
  "error": "",
  "download_url": "https://api.zise.com/v1/reports/rep_4c8a10d2-91f7-4a3e-b0c6-52d8e7f19b34/content",
  "expires_at": "2026-08-20T05:00:07.220Z",
  "created_at": "2026-08-13T05:00:00.000Z",
  "updated_at": "2026-08-13T05:00:07.220Z"
}