## 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.