Qeasy Cloud
Get Started
POSThttps://{数据中心地址}/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvcLoginByAppSecret 会话

Real-time Inventory Query (STK_Inventory)

通过 ExecuteBillQuery 查询金蝶云星空即时库存表单 STK_Inventory,按物料、仓库、库存组织维度拉取库存量与可用量,用于库存同步与一盘货场景。

## Overview Kingdee K3 Cloud stores stock snapshots in the real-time inventory form (FormId: STK_Inventory), which is read through the same ExecuteBillQuery API. Rows are keyed by stock organization, material, warehouse, bin and lot, and expose on-hand quantity (FQty), available quantity (FAVBQty) and locked quantity (FLockQty) — the baseline data source for inventory sync, unified-stock and replenishment scenarios. ### Request essentials 1. Set FormId to STK_Inventory. Typical FieldKeys: FMaterialId.FNumber, FStockId.FNumber, FStockOrgId.FNumber, FQty, FAVBQty, FStockStatusId.FName. 2. The form is a snapshot without a modify-time column, so time-based incremental filtering is impossible. Best practice: page through the full snapshot, diff it against the previous snapshot inside the iPaaS, and only push the delta downstream. 3. Add FilterString FQty <> 0 to drop zero rows and cut payload size dramatically. 4. In multi-organization groups, filter per FStockOrgId to keep stock scopes isolated. ### Feeding replenishment models In Qeasy replenishment solutions, FAVBQty feeds the available-stock input; combined with open purchase orders and safety-stock thresholds it produces replenishment proposals that are written back as purchase requisitions. ### Performance notes Row count grows with the material × warehouse × lot combinations — several hundred thousand rows is common in trading companies. At 2000 rows per page, a full pull means dozens of requests, so run it off-peak and land the snapshot in a staging table. Downstream diffing and consumers should read the staging copy instead of rescanning the source ERP during business hours.

Code examples

curl
curl -X POST "https://demo.ik3cloud.com/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{"FormId":"STK_Inventory","FieldKeys":"FMaterialId.FNumber,FStockId.FNumber,FStockOrgId.FNumber,FQty,FAVBQty","FilterString":"FQty <> 0","StartRow":0,"Limit":2000}'

Error codes

CodeMessageMeaning
500ResponseStatus.ErrorCode=500字段标识或过滤条件错误,检查 FieldKeys 是否属于即时库存表单
-1会话失效需重新登录后再查询