Authoritative Tutorial on Kingdee Cloud Inventory Balance (executeBillQuery) Interface Field Handbook — Online Warehouse Inventory Query in Practice
What This Interface Solves
In a retailer's e-commerce operation, online-warehouse inventory must be synchronized at high frequency between Kingdee Cloud and the storefront platform: the order system pulls sellable stock for allocation, operations reconciles balances, and the business monitors near-expiry batches. This interface (executeBillQuery against STK_Inventory) returns only the online-picking-enabled warehouses' inventory balances incrementally by FUpdateTime, and serves as the core entry point for online-warehouse sellable sync and reconciliation.
Capability Overview
- Authentication: User/application auth under a private deployment of Kingdee Cloud; session credentials are carried in request headers. In Qeasy Cloud, this is typically wrapped inside the adapter's "Connection" panel, with the platform handling token refresh.
- Request structure:
POST /executeBillQuery, with the Form field fixed atSTK_Inventory. Optional field filters includeFID,FStockId,FMaterialId,FBaseQty,FBaseAVBQty,FLot,FUpdateTime. Also supportsFilterString(SQL-style composite),Limit(default 20), andStartRow(default 0). - Response structure: A two-dimensional result set whose first row is the field name and whose subsequent rows are data. In metadata,
id=FIDandnumber=FMaterialId_FNumber. - Pagination mode:
Limit + StartRowpaging. This strategy pulls incrementally every five minutes (07:00–23:59), withFilterStringautomatically substituting{{LAST_SYNC_TIME|datetime}}; Qeasy Cloud's scheduler persists the cursor. - Write strategy: The Target side is configured as a no-op, so this is a query-only strategy whose results are dropped into the Qeasy Cloud data middle layer for downstream subscription.
Typical Field Mapping
| Field | Type | Meaning | Practical Notes |
|---|---|---|---|
| FID | string | Inventory record primary key | The cross-system reconciliation anchor; always use as the idempotency key |
| FStockId_FNumber | string | Warehouse code | Returns only online-picking warehouses (F_POKM_onlinepicking='1'); align with the downstream warehouse dictionary |
| FMaterialId_FNumber | string | Material code | Qeasy Cloud's mapper automatically extracts the _FNumber suffix as the business code |
| FBaseQty | string | On-book quantity | Basic-unit quantity; strings must be explicitly cast to numeric in the mapper |
| FBaseAVBQty | string | Available quantity | Net of allocations and holds; this is the true sellable field |
| FLot | string | Lot number | Empty for non-lot-managed materials; downstream must null-coalesce |
| FUpdateTime | string | Last update time | Incremental cursor; a string timestamp requiring careful timezone handling |
| FStockStatusId | string | Inventory status | Determines whether the row counts toward sellable; filtering frozen/QA is critical |
| FOwnerId_FNumber | string | Owner code | Mandatory in multi-owner scenarios to avoid contaminating external stock |
| FKeeperId_FNumber | string | Keeper code | Used for accountability in multi-org deployments |
| FStockOrgId_FNumber | string | Inventory org code | Use as a filter dimension in cross-org scenarios |
| FProduceDate / FExpiryDate | string | Production / expiry date | Near-expiry monitoring fields; map to ISO date |
| FMtoNo | string | Plan trace number | Lot + plan number can uniquely identify an on-hand record |
| FSpecification | string | Specification | Comes from the material master; used for SKU display |
| FStockLocId02~08 | string | Multi-level locations | Real values reside at FStockLocId.FF10000x.FNumber; Qeasy Cloud expands them automatically |
| FOwnerTypeId | string | Owner type ID | Distinguishes internal / customer / vendor-owned stock |
How to Configure on Qeasy Cloud
- Source adapter: Select the "Kingdee Cloud - Query" type, fill in the private-deployment address, account set, and authentication. Qeasy Cloud wraps the
executeBillQuerycall automatically. - Business object:
STK_Inventory; the platform fetches field metadata and prefills the primary key and number. - Filter template: Set
FilterStringtoFUpdateTime >= '{{LAST_SYNC_TIME|datetime}}' and FStockId.F_POKM_onlinepicking ='1'; Qeasy Cloud substitutes placeholders at every dispatch. - Field mapper: Map the
_FNumberseries to downstream business codes. ConvertFBaseQty/FBaseAVBQtywithto_number(). Normalize datetime fields withparse_datetime(). - Target side: Configure a no-op; the query result lands in the Qeasy Cloud middle layer for downstream subscribers (sales-outbound, sellable sync, reconciliation).
- Scheduling:
3-59/5 7-23 * * *; Qeasy Cloud's scheduler manages cursor persistence and retries automatically.
Cross-Scenario Practical Points
- Online-warehouse vs offline-picking filter: Kingdee uses
FStockId.F_POKM_onlinepicking='1'to mark online warehouses; this is critical for e-commerce. Forgetting it pulls offline stock into the storefront and causes overselling. - Sellable ≠ on-book: Always map
FBaseAVBQty, neverFBaseQty, when syncing sellable stock. - String numerics need casting: All quantities come back as strings. Without an explicit cast in the mapper, downstream comparisons break (
"100"vs100.0). - Incremental cursor management:
FUpdateTimeis a string, and>=comparisons can be case-sensitive in some databases. A robust pattern is uppercase normalization plus an exact timestamp. - Lots and locations are routinely null:
FLotandFStockLocId02~08are null when batch management or multi-level locations are disabled. Downstream writes must null-coalesce; do not treat null as empty string. - Status-code filtering: Rows whose
FStockStatusIdis not "Available" (frozen, QA) must be excluded from sellable sync. The safe approach is a conditional-expression second filter inside the mapper.
Pitfalls and Fixes
- Missing
F_POKM_onlinepickingfilter: In one customer rollout the team forgot the online-warehouse filter and synced offline wholesale stock into the e-commerce front end, triggering large-scale overselling. Fix: the FilterString must carry the clause, and Qeasy Cloud should hold an assertion-based unit test for it. - Duplicate incremental pulls: When
FUpdateTimeis a string,>=semantics can be inconsistent across databases. Use uppercase normalization and an exact-timestamp comparison in the mapper. _FNumbervs_FNamemismatches: Engineers sometimes mapFNumber(code) andFName(name) interchangeably, causing warehouse/material reconciliation to display names instead of codes. Pin the mapping to*_FNumber.- String accumulation on quantity fields: Downstream inventory roll-ups concatenate instead of sum because the values are
"100.00". The mapper must cast to numeric. - Misaligned location-level count: Kingdee supports multi-level locations; some customers use only three levels, yet the integration treats every
FStockLocId02~08as required, breaking non-null validation. Bind enabled levels to the customer's master-data configuration.
When to Choose
Choose executeBillQuery against STK_Inventory when you need to frequently pull online-warehouse sellable / on-book inventory from Kingdee Cloud for distribution to storefront, WMS, or reconciliation systems. For inventory writes or transactional locking, switch to save-class APIs — query-only strategies do not apply.