## Overview
inventory/query reads item stock in Jushuitan ERP and returns per-SKU quantities in the main and sub-warehouses. Unlike the order endpoint, it supports incremental pulls by stock modify time, which makes it suitable for minute-level inventory sync — the core data source for unified stock and oversell prevention.
### Request essentials
1. POST with Content-Type: application/json; common parameters are signed per the auth rules.
2. Business parameters: page_index, page_size, modified_begin/modified_end (stock modify-time window); sku_ids (comma-separated) for pinpoint queries and wms_co_id for a specific sub-warehouse.
3. The response array carries sku_id, qty (main-warehouse on hand), available_qty, lock_qty (allocated), wms_co_id and wms_qty (sub-warehouse figures).
4. Sellable semantics: use available_qty (or qty minus lock_qty), then split by shop quota. Pushing raw qty during promotion peaks guarantees overselling.
### Integration advice
- Drive the incremental cursor from modified_begin (the max modify time seen), overlapping the window by 1-2 minutes against boundary losses.
- Qeasy orchestrates Jushuitan stock → delta calculation → marketplace stock write-back, with alerting and automatic retry on write-back failures.
### Sub-warehouse semantics
Enterprise tenants run multiple sub-warehouses (wms_co_id) whose figures differ from the main warehouse — agree with the business which scope is authoritative for unified stock. In sub-warehouse mode, pull per warehouse, compute sellable quantities separately, then aggregate by each shop's owning warehouse before pushing. Mixing scopes sells warehouse A's stock into warehouse B's shops and strands orders.