Qeasy Cloud
Get Started
POSThttps://open.youzanyun.com/api/youzan.trades.sold.get/4.0.1access_token(query 传参)

Query Sold Trades (youzan.trades.sold.get)

有赞交易列表查询接口,按创建/更新时间窗口分页拉取订单头、明细与支付信息,是订单同步与电商财务对账的核心取数口。

## Overview youzan.trades.sold.get queries the trades a shop has sold under given conditions, paging by creation or update window. It returns tid, status, payment, post_fee, order lines (title, quantity, price, paid) and buyer/consignee info. The API version (e.g. 4.0.1) is part of the path — a wrong version yields error 4005 (illegal API). ### Request essentials 1. POST with a JSON body (form also accepted); access_token rides in the URL query. 2. Paginate with page_no/page_size (100 or fewer); use start_created/end_created for creation windows or start_update/end_update for update windows — incremental sync takes the update semantics with a few minutes of overlap. 3. response.trades carries the orders and response.total_results the count; the status enum (WAIT_PAY, WAIT_SELLER_SEND_GOODS, WAIT_BUYER_CONFIRM_GOODS, TRADE_SUCCESS, TRADE_CLOSED, ...) separates fulfillment states from closed orders. 4. Amount semantics under refund: reconcile on payment minus refund_fee and join the refund-detail interfaces. ### Reconciliation use Qeasy's AI reconciliation pulls Youzan order receipts via this API and three-way matches them against WeChat Pay/Alipay statements and ERP receivables; discrepancies (amount mismatch, missing or extra orders) are auto-classified into a manual review queue. ### Operational tips Persist the watermark only after a window is fully paged, and deduplicate on tid plus order-line id because the same trade reappears across overlapping update windows. Youzan also pushes trade messages over its message channel — pairing push with periodic pulls gives both timeliness and completeness, with the pull path acting as the safety net for missed or lost pushes.

Code examples

curl
curl -X POST "https://open.youzanyun.com/api/youzan.trades.sold.get/4.0.1?access_token=TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"start_update":"2026-06-01 00:00:00","end_update":"2026-06-01 01:00:00","page_no":1,"page_size":100}'

Error codes

CodeMessageMeaning
4001非法请求地址路径格式错误,应为 /api/{api_name}/{api_version}
4005非法的APIapi_name 或版本不存在,核对版本号
4201非法的请求凭证token 无效或授权关系过期,重新获取
4101请求太频繁触发限流,降速重试