Qeasy Cloud
Get Started
POSThttps://api.wangdian.cn/openapi2/trade_query.phpsid + appkey + MD5 签名

Trade Query (trade_query)

旺店通企业版订单查询接口,按时间窗口分页拉取订单头、明细、支付与收件人信息,是电商订单出数到 ERP/财务对账场景的核心接口。

## Overview trade_query.php batch-queries orders inside WDT Enterprise ERP. It pages through time windows (created or last-modified) and returns order headers, item lines, payment data and buyer/consignee details — the core extraction point for order sync into finance systems, BI and three-way reconciliation. ### Request essentials 1. Build the common parameters (sid, appkey, timestamp, sign) per the signing rules; submit business parameters as form fields. 2. Pagination: pageno (0-based) and pagesize (100 or fewer recommended). 3. Time window: start_time/end_time (yyyy-MM-dd HH:mm:ss) plus the time type (created vs last modified). Keep windows small; during promotion peaks slice by hour. 4. Optional filters such as shop_no and status narrow the scan. ### Response structure On status = 0, data carries the total count and a trades array: trade_no (internal no), tid (platform no), shop_name, trade_status, pay_status, receiver fields, and goods_list with spec_no, num, price, paid. For reconciliation, focus on paid, post_fee and refund_status, and be careful with the amount semantics of orders under refund. ### Integration advice Qeasy increments on last-modified time and writes to the reconciliation store with trade_no + line sequence as the idempotency key. ### Operational tips Log the request window and page number with every call so gaps can be replayed precisely. When order numbers are recycled across shops, deduplicate on the combination of shop_no and trade_no. Keep an eye on platform-sensitive fields — buyer mobile numbers may be masked depending on the source platform, so downstream systems must tolerate partial masking instead of rejecting the record.

Code examples

curl
curl -X POST "https://api.wangdian.cn/openapi2/trade_query.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "sid=myshop&appkey=AK123&timestamp=1780000000&sign=SIGN" \
  --data-urlencode "start_time=2026-06-01 00:00:00" \
  --data-urlencode "end_time=2026-06-01 01:00:00" \
  -d "pageno=0&pagesize=100"

Error codes

CodeMessageMeaning
100sign 校验失败签名错误,检查参数排序与 secret
102appkey 无权限未开通 trade_query 接口授权
105timestamp 过期时间偏差超过 5 分钟