跳转到主要内容
GET
List purchase history
orders 端点返回您的购买历史,按时间倒序排列,使用键集分页。可按时间窗口和状态过滤,然后通过将 meta.next_cursor 作为 cursor 传回,遍历更早的页面。每个订单都附带逐件商品明细及其交付状态。 需要身份验证。 请将密钥作为 Authorization: Bearer csb_pub_... 发送。

查询参数

integer
默认值:"50"
每页结果数。最小 1,最大 100。
integer
仅返回在该 Unix 时间戳(秒)当时或之后创建的订单。
integer
仅返回在该 Unix 时间戳(秒)当时或之前创建的订单。
string
按订单状态过滤。可选值:completed、hold、delivering、pending、cancelled、failed 之一。
string
来自上次响应中 meta.next_cursor 的键集游标。传入以获取下一页。

响应字段

Order[]
必填
本页订单数组。
object
必填

示例请求

示例响应

订单失败的原因

状态为 failed 或 cancelled 的订单会用三个字段说明原因。其他任何状态下,这三个字段都为 null。
  • fail_reason —— 用于程序分支判断的代码,取值见下表。
  • fail_side —— 需要采取行动的一方:recipient、seller、buyer 或 market。
  • fail_message —— 一句英文说明:发生了什么、该怎么做。可展示给用户;程序逻辑请依据 fail_reason。
该列表可能会扩充。遇到不认识的 fail_reason 时,请按 unavailable 处理。逐件商品的 return_reason 保持不变。 一个失败的订单(仅保留与此相关的字段):

错误代码

授权

Authorization
string
header
必填

Send your key as a Bearer token on every request: Authorization: Bearer csb_pub_.... Generate keys in your CSBoard profile. Calls made with a key are metered only by that key's own limits — there is no per-IP limit on top — and every answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Bucket for the bucket the call spent. See Rate limits.

查询参数

limit
integer
默认值:50

Results per page. 1–100. Default 50.

必填范围: 1 <= x <= 100
start_unix_time
integer

Only orders created at or after this Unix timestamp (seconds).

end_unix_time
integer

Only orders created at or before this Unix timestamp (seconds).

status
enum<string>

Filter by order status.

可用选项:
completed,
hold,
delivering,
pending,
cancelled,
failed
cursor
string

Keyset cursor from a previous response's meta.next_cursor.

响应

A page of orders.

data
object[]
必填
meta
object
必填