Qeasy Cloud
Get Started

Authoritative Tutorial: Jushuitan QM Sales Outbound Order Query Interface Field Manual

· 高金凤· Engineering Best Practices· 10 views· 5 min read

What This Interface Solves

The Jushuitan QM jushuitan.saleout.list.query interface incrementally pulls sales outbound (delivery) orders by modification time and lands them into the local SQL Server table xsck. Typical scenarios include: localizing e-commerce outbound data, tracking shipment status, syncing logistics information, financial reconciliation, and bridging inventory and sales data with ERP/WMS systems. It is the key data channel connecting online transactions with offline fulfillment.

Interface Capability Overview

  • Authentication: Jushuitan QM uses application-level PartnerId + signature (token + timestamp encryption) authorization; the request header must carry the authorization parameters.
  • Request structure: POST format, JSON body. Key inputs: page_index (default 1), page_size (default 25, max 50), start_time / end_time (query by modification time, span ≤ 7 days), status (optional, see enum below), so_id (online order number, cannot be empty at the same time as the time condition).
  • Response structure: outer data contains page_index, page_size, has_next, and the line array datas; each record carries many fields, with io_id as the primary key.
  • Pagination mode: traditional pagination based on page_index, combined with has_next; it is recommended to set page_size to 50 to reduce request count.
  • Incremental mode: uses the modified field as the time window. The landing side must persist last_sync_time; after the initial full sync, run incremental windows of 1 hour to 1 day, with a typical crontab of 1 0,1,2 * * *.
  • Status enum: Archive (Archived), WaitConfirm (Pending Outbound), Confirmed (Outbound), Cancelled (Cancelled), Delete (Voided), OuterConfirming (External Shipping).

Typical Field Mapping

FieldTypeMeaningPractical Notes
io_idstringPrimary key of the outbound order, uniqueCore for deduplication; SQL Server primary key should use io_id directly
o_idstringJushuitan internal order numberLinks to sales order master data
so_idstringOriginal e-commerce platform order numberReconciliation and feedback with Taobao/JD/Pinduoduo
merge_so_idstringMerged-order master numberLinks to child orders in merged-order scenarios
shop_id / shop_namestringShop id / nameMulti-shop routing and filtering
co_id / wms_co_idstringCompany id / sub-warehouse idDistinguish outbound warehouse in multi-warehouse scenarios
modifiedstringLast modification timeBasis for incremental window, must be retained on the landing side
statusstringDocument status (see enum)WaitConfirm is the typical incremental starting point
pay_amount / paid_amount / free_amount / freightstringPayable / Paid / Discount / FreightAll strings; convert to DECIMAL when landing; handle empty strings
receiver_country/state/city/district/town/addressstringSix-level shipping addressSuggest to store in one redundant column to avoid 6-level joins
receiver_name / receiver_phone / receiver_mobilestringConsignee infoRemember to mask sensitive info
l_id / lc_idstringLogistics tracking number / carrier codeInputs for logistics feedback and tracking queries
io_date / pay_datestringOutbound time / payment timeTime strings need unified format (ISO 8601 recommended)
weight / f_weightstringEstimated weight / actual weightKey fields for billing reconciliation
itemsarrayOrder line arrayMust be expanded to multiple rows under items_* fields (see below)
batchsarrayBatch informationRequired for batch-managed items
snsarrayUnique/serial numbersRequired for serial-number-managed items
crawl_timestringETL landing timestampAuto-filled by the integration platform for troubleshooting

How to Configure on Qeasy Cloud

On the Qeasy Cloud data integration platform, this interface is typically packaged as the "Jushuitan QM · Sales Outbound Order Query" adapter. The typical configuration path is as follows:

  1. Datasource registration: Select the Jushuitan QM connector and fill in authentication parameters such as PartnerId, PartnerKey, and Token. On the target side, select SQL Server and configure the JDBC connection string and the target table xsck.
  2. Interface selection: Pick jushuitan.saleout.list.query directly from the source API list; the platform auto-parses request/response structures—no manual JSON Schema needed.
  3. Field mapper: The platform provides a built-in field mapper. Main-table fields can be mapped by drag-and-drop. For nested arrays like items, the mapper supports an "array expansion" mode, expanding items_sku_id, items_qty, items_sale_price, etc., into line columns with one click.
  4. Incremental strategy: Qeasy Cloud provides incremental configuration options based on the modified field. You can set the window length (≤ 7 days recommended), start page, and retry policy; the platform automatically maintains last_sync_time.
  5. Scheduling: Configure crontab (e.g., 1 0,1,2 * * *). The platform has built-in checkpoint resume and failure alerts. When landing into xsck, it supports automatic update on primary key conflict.

Cross-Scenario Practical Points

  1. Primary key strategy must be stable: Consistently use io_id as the SQL Server primary key, supplemented by id = {{o_id}}{{modified}} for idempotent deduplication, to avoid duplicate landing caused by Jushuitan status rollbacks.
  2. Incremental window must be ≤ 7 days: Jushuitan QM enforces a hard limit on time span; exceeding 7 days triggers an error. We recommend setting the window to 1–2 hours, with early-morning scheduled pulls, balancing real-time requirements and rate limits.
  3. Line items must be expanded: The items array cannot be JSON-stored as a single column; it must be expanded into items_sku_id / items_qty / items_sale_price etc., or downstream BI queries will be painfully slow. Same for batchs and sns.
  4. Amount fields are all strings: Jushuitan returns amounts as strings. When landing into SQL Server, convert to DECIMAL(18,2) and handle empty strings and negative numbers (discount scenarios) defensively.
  5. Status machine drives downstream flow: Do not treat Confirmed as the final state; when Cancelled / Delete appear, actively write back to ERP to avoid inflated inventory.
  6. Six-level address handled separately: Concatenating the six-level address into a single redundant column is better for queries than 6-level joins. Also remember to mask sensitive info before landing.

Pitfall Recap

  1. Window exceeding the limit breaks the task: One customer set the window to 8 days, and the interface directly returned time range exceeds 7 days, breaking the entire chain. A robust approach is to strictly enforce ≤ 7 days with runtime validation.
  2. items stored as JSON without expansion: One solution stuffed the entire items array into an nvarchar(max) column. Later, sales-line reports timed out due to full-table scans. The correct approach is to expand into line columns or create a separate xsck_items sub-table.
  3. Inconsistent time field formats: Jushuitan returns both yyyy-MM-dd HH:mm:ss and Unix timestamps. Storing them as-is caused downstream BI errors. A robust approach is to uniformly format to ISO 8601 at the source side.
  4. Status rollback creates duplicate rows: One customer used o_id + created as the primary key. When Jushuitan changed WaitConfirm to Confirmed, modified changed but created did not, producing multiple rows for the same logical order. The primary key must be io_id or id = {{o_id}}{{modified}}.
  5. Delayed logistics tracking-number feedback: Some platforms transmit shipment before the tracking number is fed back, so the first incremental pull may see l_id as empty. When logistics feedback arrives later, modified updates, and the incremental task will backfill it automatically—this is normal and should not be flagged as a bug.

When to Use

Suitable for e-commerce retail scenarios where Jushuitan outbound data must be localized to SQL Server/ERP for shipment tracking, financial reconciliation, inventory deduction, and BI analytics. Not suitable for sub-second real-time synchronization (the interface is modification-time based, so minute-level latency is inevitable); also not suitable for merchants without Jushuitan accounts or non-QM integration.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-036-sql-b141

Comments