Qeasy Cloud
Get Started

Jushuitan Warehouse Query API Field Handbook: A Practical Tutorial from Pagination to Main-Sub Warehouse Mapping

· 吕修远· Engineering Best Practices· 17 views· 4 min read
JushuitanKingdee Cloud仓库主数据供应链集成接口字段手册轻易云

What This API Solves

In the supply chain integration between Jushuitan and Kingdee Cloud Skyline, warehouse master data is the foundational field for all inbound/outbound documents, inventory transfers, and purchase receipts. Across multiple client projects, we have found that as long as warehouse master data is not fully pulled or properly mapped, downstream document synchronization will trigger a chain of issues such as "warehouse not found" or "code mismatch". The Jushuitan /open/wms/partner/query API is precisely designed to pull the full sub-warehouse list in one go, establishing a mapping between Jushuitan-side warehouses and Kingdee-side warehouse codes, thereby paving the way for inbound/outbound document synchronization.

API Capability Overview

Authentication: Standard OAuth/AppToken authentication on the Jushuitan open platform; the access_token must be carried in the request header.

Request Structure: HTTP POST with a request body containing pagination parameters page_index (starting page, mapped to the platform placeholder {{PAGINATION_START_PAGE}}) and page_size (records per page, mapped to {{PAGINATION_PAGE_SIZE}}, defaulting to 30). Jushuitan WMS adopts a "main warehouse-sub warehouse" architecture, so a single call returns both main and sub warehouse records.

Response Structure: Returns a JSON array of sub-warehouse records. Each record contains core fields: wms_co_id (sub-warehouse ID), name (sub-warehouse name), co_id (main warehouse company ID), is_main (whether it is the main warehouse).

Pagination & Incremental Mode: The platform uses classic page-number pagination, which requires configuring a loop pull logic in the Qeasy Cloud Data Integration adapter. The scheduled task is typically set to 10-59/59 7-23 * * * (executed every 59 minutes between 7 and 23 o'clock), covering business peak hours. The Target is configured as "write null operation", indicating this is a pure query strategy, often serving as the starting point of the master data synchronization chain.

Typical Field Mapping

Field NameTypeMeaningPractical Notes
wms_co_idintUnique identifier of the sub-warehouse within Jushuitan WMSActs as the primary key for cross-system integration, mapped to Kingdee warehouse codes
namestringDisplay name of the sub-warehouse/warehouseUsed for business display and as an auxiliary search field
co_idstringThe main warehouse company ID it belongs toUsed for grouping and filtering by main warehouse in multi-warehouse scenarios
is_mainstringWhether it is the main warehouse, "true"=main warehouseUsed to distinguish main from sub warehouses; main warehouse usually serves as the default

How to Configure on Qeasy Cloud

In the Qeasy Cloud Data Integration platform, calling this API typically follows the "Jushuitan WMS Adapter + Pull Strategy" combination. Specifically:

  1. Adapter Selection: Choose the Jushuitan WMS adapter in the source system component and fill in AppKey/AppSecret to complete the authentication binding.
  2. Field Mapper: The Qeasy Cloud field mapper automatically recognizes the four core fields — wms_co_id, name, co_id, is_main — and exposes them to downstream as metadata (id mapped to wms_co_id, number mapped to name).
  3. Pagination Loop: Configure the pagination loopper via the {{PAGINATION_START_PAGE}} and {{PAGINATION_PAGE_SIZE}} placeholders to automatically iterate through all pages.
  4. Scheduling Configuration: Set the scheduled task to 10-59/59 7-23 * * *, triggering every 59 minutes during business hours to ensure newly added sub-warehouses are captured in time.
  5. Target Side: This strategy sets Target to "write null operation" without writing to the target system; it serves only as the "upstream data source" for subsequent document synchronization chains.

Cross-Solution Practical Highlights

From multiple client projects involving Jushuitan-Kingdee integration, we have distilled the following common practices:

  1. Pull warehouses before running documents: Warehouse master data must be synchronized ahead of inbound/outbound and purchase documents; otherwise downstream strategies will fail due to missing warehouse codes.
  2. Handle main and sub warehouses separately: After retrieving records with is_main="true", it is recommended to add a "derived field" in the Qeasy Cloud field mapper to mark the main warehouse for default warehouse logic.
  3. Maintain the code mapping table independently: The mapping between Jushuitan wms_co_id and Kingdee warehouse codes should be maintained in a separate mapping table strategy for easier manual supplementation and auditing.
  4. Low frequency of warehouse changes: Warehouse master data changes infrequently; a daily or per-59-minute pull cadence is sufficient, no need for high-frequency real-time sync.
  5. Disable idCheck: This strategy sets idCheck: false, meaning primary key validation is disabled because it is a pure query strategy; primary key validation is left to the downstream write strategy.
  6. Enable autoFillResponse: autoFillResponse: true allows response fields to be auto-filled, eliminating the need for manual schema registration.

Pitfall Retrospective

  1. Pitfall: Using name as the primary key — Jushuitan allows duplicate sub-warehouse names, so name is not unique; this is a common stumbling block. The safe approach is to explicitly bind id to wms_co_id in the Qeasy Cloud metadata.
  2. Pitfall: Ignoring the is_main filter — Downstream Kingdee typically only receives sub-warehouses, not main warehouses; without filtering, the main warehouse will be erroneously synced, causing duplication or conflicts.
  3. Pitfall: Hardcoding pagination parameters — Some engineers hardcode page_index to 1, resulting in only the first page being pulled. Always use the {{PAGINATION_START_PAGE}} placeholder to let the platform auto-increment.
  4. Pitfall: Wrong cron window — Writing cron as */59 * * * * does not work in Qeasy Cloud because the platform requires a six-field cron expression; always use a six-field expression such as 10-59/59 7-23 * * *.
  5. Pitfall: access_token expiry not refreshed — Jushuitan tokens expire in 2 hours by default; long-running batch tasks easily get a 401 midway. The safe approach is to enable auto-refresh in the Qeasy Cloud authentication component.

When to Use

This API applies to all scenarios where "Jushuitan serves as the WMS master data source and needs to synchronize warehouse master data to Kingdee Cloud Skyline", typical of retail, e-commerce, and distribution industry supply chain integrations. Note: it is a pure query API and does not write to the target system. If your goal is to establish a Jushuitan-Kingdee warehouse code mapping or to provide upstream data source for inbound/outbound document synchronization, choose this API; if you need to directly synchronize warehouse data to the target database, it should be used together with a "write-type" strategy.

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

Comments