WDT Sales Order Line Detail Interface Field Handbook: Authoritative Tutorial from API to MySQL Table
What Problem Does This Interface Solve
In supply chain integration from WDT to MySQL, the line items of "completed" sales orders are the most critical downstream analytics data. The header tells you "which order," while each line in detail_list represents the actual SKU-level detail — SKU, specification, quantity, unit price, allocated shipping, line-level discount, payment and delivery status, and so on. This interface incrementally syncs the line items of status=2 sales orders into a MySQL table body, supporting localized reporting, profit accounting, inventory occupancy tracking, and platform reconciliation.
Interface Capability Overview
- Authentication: Invoked through the
QueryStrategyDataadapter encapsulated by the Qeasy Cloud Data Integration platform. Internal signing and session management are handled by the platform — no need to worry about tokens or signatures. - Request Structure: Core parameters include
status=2(completed),response_at_begin/response_at_end(10-digit Unix timestamp window), andpage_no/page_size(pagination parameters). - Response Structure: Returns an array of order header objects, each containing an embedded
detail_listarray. The actual data to land in the database is each line withindetail_list; header fields serve as context. - Pagination & Incremental Mode: Time-windowed incremental based on
response_at, typically a 15-minute cycle. Across cycles, theF_response_attimestamp is used as the watermark for miss/duplicate prevention.
Typical Field Mapping
Header Key Fields
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| trade_id | string | WDT order unique identifier | Used by line items to join the header — preserve as-is |
| trade_no | string | Business order number | Reconciliation primary key — do not mix with trade_id |
| shop_no | string | Shop code | Required in multi-shop scenarios; affects warehouse and inventory ownership |
| warehouse_no | string | Warehouse code | Determines the shipping warehouse for line items |
| pay_time / trade_time | string | Payment and order placement time | Reference for incremental window boundaries |
| detail_list | array | Line items array | Actual sync target; header only provides context |
Platform Extension Fields (F_ prefix)
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| F_status | string | Platform processing status | Not used in business mapping; for platform scheduling only |
| F_response_at | string | Data response timestamp | Key field for incremental watermark — must persist |
| F_created_at | string | Record creation time | Used to investigate duplicates and delays |
| F_result | string | Processing result | Entry point for failure diagnosis |
| F_respone | object | Raw response body | Used to recheck during exception post-mortem |
Line Item (detail_list) Key Fields
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| rec_id | string | Line item unique identifier | Target table primary key, overwrite on conflict — preserve as-is |
| trade_id | string | Associated header order ID | Join key between table body and header |
| src_oid / src_tid | string | Platform-side sub-order/transaction ID | Used for refund reconciliation and platform callbacks |
| goods_no / spec_no | string | Goods/specification business code | Core key for master data mapping |
| api_goods_id / api_spec_id | string | Platform-side goods/specification ID | Essential for cross-platform product matching |
| num / price / order_price | string | Quantity, unit price, line amount | All strings — cast to decimal before persistence |
| share_price / share_amount | string | Allocated unit price and amount | Result of order-level discount allocation — use for profit accounting |
| adjust / discount | string | Line-level adjustment and discount | Affects final receivable |
| refund_num / paid | string | Refund quantity, paid amount | Refund tracking |
| pay_status / refund_status | string | Line-level payment/refund status | Key for platform reconciliation |
| is_consigned / is_received | string | Whether shipped / received | Process node monitoring |
| stock_state | string | Inventory occupancy status | Basis for integration with inventory module |
| pay_time / modified_date | string/datetime | Payment time, modification date | Reference for incremental and reconciliation |
How to Configure on Qeasy Cloud
On the Qeasy Cloud Data Integration platform, this interface is typically configured using a two-stage approach: strategy adapter + field mapper.
- Source Adapter: Choose "WDT · Flagship Qimen" as the source, enable the
QueryStrategyDatastrategy query, and setstatus=2along with the time window parameters. The platform automatically handles signing, rate limiting, and pagination. - Field Mapper: For line items, flatten
detail_list[*]into a flat structure and map each field to the MySQL tablewdt_sales_trade_order_detail. Setrec_idas the upsert primary key; retaintrade_idfor header join. It is recommended to persist F_ prefix fields to dedicated columns for easier troubleshooting. - Scheduling Strategy: Configure a 15-minute cron cycle, persist
F_response_atas the watermark, and let it automatically chain across cycles.
Cross-Scenario Practical Essentials
- Line items are the real sync target: The header only provides context; the real data volume lives in
detail_list. Always flatten the array during configuration, or the table body will be empty. - rec_id must be persisted as-is: It is the unique primary key of the table body. The Qeasy Cloud field mapper outputs it as-is by default — do not apply secondary cleansing.
- Time window boundaries must align:
response_at_beginandresponse_at_endshould fall onpay_timeormodifiedof completed orders to avoid missing data. - All amount fields are strings:
num/price/order_price/share_amountetc. are all strings — cast to decimal before persisting to MySQL, otherwise aggregations will fail. - Prefer allocated fields over original price: For profit accounting, use
share_price/share_amountrather thanprice/order_price, otherwise order-level discounts will be "missed." - Store F_ fields separately: Do not mix them into the business field table; use a sidecar table or dedicated columns for fast backtracking during incidents.
Pitfall Post-Mortem
- Pitfall 1: Treating
detail_listas an ordinary field. Insufficient flattening causes the table body to contain only a header record while losing all line items. The safe approach is to explicitly flatten the array in the field mapper. - Pitfall 2: Using
pricefor profit-accounting unit price. After order-level discount allocation, the actual unit price isshare_price; usingpricedirectly inflates profit margins. - Pitfall 3: Wrong field used for the time window. Using
trade_timeas the incremental boundary also pulls in unpaid orders, causing line items and headers to have inconsistent statuses. Usepay_timeormodifiedinstead. - Pitfall 4: Ignoring
stock_state. It directly reflects inventory occupancy/release; omitting it from downstream available-inventory calculations triggers oversell alerts. - Pitfall 5: F_ fields accidentally used in business logic.
F_statusandF_resultare internal platform statuses; using them as business status filters produces a "all empty" phantom result.
When to Use This Interface
Suitable for local storage of completed sales order line items, profit analysis, inventory occupancy tracking, and e-commerce platform reconciliation. If you only need order headers or real-time orders, use the header strategy or a status≠2 query strategy. For refund line items, use the dedicated return-inbound linkage.