Kingdee YXC Inventory Query API Field Handbook: Cross-Solution Practices to Stocktake Reconciliation
What This API Solves
In multi-system retail and distribution scenarios, ERP and WMS stock data often drift apart, leading to mismatched books and repeated stocktake corrections. The Kingdee YXC Instant Inventory API (SCM Inventory) exists precisely to push the ERP-side inventory baseline into a WMS-side stocktake document — using ERP as the source of truth and syncing quantities, batches, bins, and auxiliary attributes into the Qushuijade stocktake document so that one stocktake reconciles the books in a single pass.
API Capability Overview
- Authentication: Kingdee YXC Open Platform OAuth 2.0. Obtain an
access_tokenfirst, then send it as a Bearer token in the request header. - Request Method:
POST /jdy/v2/scm/inventory/list, JSON body. - Core Inputs:
modify_start_time/modify_end_time(millisecond timestamps, standard incremental window),page,page_size, plus optional filters such asmaterial_id/stock_id. - Response Structure: A paging object containing
data(the inventory list) andtotal_count. Each inventory object covers item, warehouse, bin, auxiliary attribute, batch, shelf life, and quantity dimensions. - Pagination Model: Classic page-number pagination (
page+page_size), default page size 10. Callers are advised to raise it to 50–200 to reduce round trips. - Incremental Strategy: Pull by
modify_timewith a sliding window built from platform variables{{LAST_SYNC_TIME}}000and{{CURRENT_TIME}}000.
Typical Field Mapping
| Field | Type | Meaning | Field Notes |
|---|---|---|---|
| material_id | string | Item primary key | Bound to metadata id, key validation on |
| material_number | string | Item business code | Bound to metadata number, anchor for cross-system matching |
| stock_id | string | Warehouse primary key | Together with stock_number, uniquely identifies a warehouse |
| stock_number | string | Warehouse code | Must map to the Qushuijade warehouse dictionary (main / return / inbound / defective) |
| sp_id / sp_number / sp_name | string | Bin triplet | Populated only when stock_id_is_allow_freight=true |
| aux_prop_id / aux_prop_number / aux_prop_name | string | Auxiliary attribute triplet | Maps to Qushuijade SKU spec dimension |
| batch_no | string | Batch number | Returned when batch management is enabled |
| qty | string | Instant stock quantity (base UoM) | Baseline field for the stocktake document |
| valid_qty | string | Available quantity | Reserves/locks deducted; valid_qty ≤ qty |
| qty_package / valid_qty_package | string | Whole + loose package total | Use for whole-package-managed items |
| kf_date / valid_date / kf_type / kf_period | string | Production / expiry / shelf life | Required for shelf-life-sensitive goods (food, cosmetics) |
How to Configure on Qeasy
On the Qeasy data integration platform, this API is wrapped as the "Kingdee YXC V2 SCM Inventory Adapter." The standard configuration path is as follows:
- Adapter Selection: Source system "Kingdee YXC V2", interface "Inventory Query."
- Metadata Binding: Bind
idtomaterial_id,numbertomaterial_number, and enableidCheckandautoFillResponse. - Field Mapper: In the visual mapping canvas, map
material_number→items.sku_id,stock_number→warehouse,qty→items.qty. The Qeasy field mapper automatically handles type conversion and null-value fallbacks. - Scheduling: Set the cron to
*/25 * * * *(every 25 minutes); the incremental window uses the built-in variables{{LAST_SYNC_TIME}}000/{{CURRENT_TIME}}000. - Target Configuration: Pick the Qushuijade stocktake upload interface, set
type=check(full overwrite),is_confirm=1,so_idto{{random}}, andremarkto "Kingdee Instant Inventory Sync."
Cross-Solution Practices
- Composite Key Awareness: Across multiple customer projects, any inventory record involving batches or auxiliary attributes will silently lose data if you only use
material_id + stock_id. Always addbatch_nooraux_prop_id; for bin-managed warehouses, also addsp_id. - qty vs. valid_qty Choice: For stocktake reconciliation scenarios, always use
qty(book balance) — do not letvalid_qty(reserves deducted) mislead you, or the gap will keep growing. - Pre-map the Warehouse Dictionary: Qushuijade's
warehouseis an enum (Kingdee codes must be translated into 1/2/3/4). Build the mapping table once in Qeasy's data-dictionary converter to avoid dirty data downstream. - Window for Batch / Shelf-Life Goods: Shelf-life-sensitive items must carry
kf_date/valid_dateinto the stocktake document's remark or extension fields; otherwise the expiry judgment becomes unreliable. - page_size Tuning: Kingdee's default of 10 per page is very slow for large warehouses. We explicitly raise it to 100–200, which combined with the 25-minute window keeps pace with writes.
- Resumable Pull: Persist the
LAST_SYNC_TIMEvariable. Qeasy persists it automatically, but pay attention to time zone and midnight boundary when crossing days.
Pitfall Postmortems
- No batch in strategy but deduped by batch_no: A retail client lost nearly 30% of records on their first stocktake because items had batches enabled but the strategy did not include
batch_noin the dedup key, causing multiple records to overwrite each other. - Auxiliary attributes vs. Qushuijade SKU mismatch: For color/size items, Kingdee uses auxiliary attributes while Qushuijade uses SKUs. Mapping directly on
material_idmakes Qushuijade unable to recognize specs. The safe approach is to appendaux_prop_numberto the SKU code suffix. - valid_qty misused as stocktake baseline: Writing
valid_qtyinto the stocktake quantity caused the stocktake variance to be "swallowed" by reservations, so books and stock never matched. - Whole vs. loose UoM confusion:
qty_packageandqtyare in different units. If you only takeqtyfor whole-package-managed items, you under-count by half. Always select the field according to the item's UoM policy. - Cross-time-zone timestamp drift: The incremental window occasionally missed data across midnight because Kingdee returns
modify_timein UTC+8 while the scheduler assumed UTC. The safe approach is to format the window variables inAsia/Shanghaiconsistently inside Qeasy.
When to Use
Choose this API when the enterprise treats ERP as the single inventory source of truth and needs to sync that baseline into a WMS stocktake document for a one-shot reconciliation. If you only need a stock alert or coarse dashboard, consider Kingdee's lightweight BI interface. If the systems already share an isomorphic inventory model, skip the stocktake route and use the inventory transfer interface instead.