Kingdee Cloud Material Query API Field Handbook (for ZhiZhang Platform)
What This API Solves
The material master data (BD_MATERIAL) in Kingdee Cloud is the central foundation of an enterprise supply chain. When platforms like ZhiZhang, e-commerce middleware, or logistics systems need to align material codes with Kingdee, retrieve specifications/barcodes/dimensions, or confirm default sales and shipping organizations, executeBillQuery is typically used in a read-only fashion to pull material master data and hand it to downstream systems for mapping or initialization. This strategy queries only and does not write back, making it suitable as a "baseline snapshot" or the first step in an upstream sync chain.
API Capability Overview
- Authentication: Kingdee Cloud WebAPI with user/app-key based authentication, invoked via the API gateway.
- Method: POST, endpoint
executeBillQuery, business object FormId fixed asBD_MATERIAL. - Request Body: Includes
FormId,FilterString,Limit(default 2000),StartRow(default 0), and optional field selection (FieldKeys). - Response Structure: A two-dimensional array returned in the
Resultfield, where the first row is the field names followed by data rows;metadatausesFNumberfor bothidandnumber. - Pagination: Offset-based pagination using
StartRow + Limit; loop until the returned row count is less thanLimit. - Incremental Mode:
FilterStringconstrainsFApproveDate > '{{HOURE_AGO_5|datetime}}', syncing only materials approved within the last 5 hours. Typical schedule is0-59/5 7-23 * * *(every 5 minutes from 07:00–23:59). - Target Side: Target is configured as a "write-empty" operation — a pure query strategy with no target system writes.
Typical Field Mapping
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| FMATERIALID | string | Entity primary key | Unique identifier in Kingdee; the master index for cross-system linking and dedup |
| FNumber | string | Material code | Business key; both id and number use FNumber; one-to-one mapping with ZhiZhang product code |
| FName | string | Name | For display and human identification |
| FSpecification | string | Specification | Often used as subtitle in ZhiZhang |
| FDescription | string | Description | Long text, may not be enabled in some Kingdee versions |
| FMaterialGroup_FNumber / FName | string | Material group code/name | Filter: LEFT(FMaterialGroup.FNumber,2)='01' |
| FBaseProperty | string | Material group code (extended) | May overlap/relate with FMaterialGroup |
| FErpClsID | string | Material attribute | Distinguishes finished goods / raw materials / semi-finished |
| FCategoryID | string | Inventory category | Mandatory filter |
| FCreateOrgId_FNumber | string | Creation organization | Mandatory filter |
| FUseOrgId_FNumber | string | Use organization | Mandatory filter; strategy constrains to 100 |
| FIsSale | string | Allow sale | Mandatory filter; boolean flag |
| FStockId_FNumber | string | Default warehouse | Default stock warehouse code |
| FApproveDate | string | Approval date | Core field for incremental filtering |
| FBaseUnitId_FName | string | Base unit | Label says "base unit code" but value is often the name — verify per environment |
| FBARCODE | string | Barcode | Key field for ZhiZhang scanning |
| FLENGTH / FWIDTH / FHEIGHT | string | Length / Width / Height | Used for logistics volume calculation and freight estimation |
| F_POKM_SaleOrg | string | Default sales organization | Extended field; POKM is the extension identifier |
| F_POKM_StockOrg1 | string | Default shipping organization | Extended field; relied on by logistics/warehousing |
How to Configure on QeasyCloud
In the QeasyCloud Data Integration Platform, this API is typically encapsulated by the "Kingdee Cloud Query Adapter" with three configuration steps:
- Adapter Selection: Choose
Kingdee Cloud - executeBillQueryas the source adapter, set FormId toBD_MATERIAL, and configure authentication using the Kingdee WebAPI user authorization. - Metadata Mapping: The QeasyCloud field mapper automatically converts the two-dimensional response array into structured fields.
FNumberserves as both id and number, and the platform uses it for idempotent deduplication;FApproveDateis bound directly to the incremental variableHOURE_AGO_5. - Scheduling and Target: Set Target to "write-empty" or route it to the next processing node (e.g., "Kingdee Material => QeasyCloud => ZhiZhang Product"). QeasyCloud's built-in scheduler parses the
0-59/5 7-23 * * *expression directly, eliminating the need for additional scripts.
Cross-Scenario Best Practices
- Use FNumber as the Business Key: Across multiple customer projects, metadata consistently maps both id and number to FNumber — the most reliable anchor for cross-system alignment.
- Organization Dimensions Are Mandatory: FCreateOrgId, FUseOrgId, FCategoryID, and FIsSale are almost always required in production; otherwise Kingdee returns massive result sets and times out.
- FilterString Defines the Incremental Cadence: Use FApproveDate with
HOURE_AGO_5to enforce a 5-minute window — timely without full scans; running in two phases (full + incremental) is the safe approach. - Extended Fields Must Be Explicitly Selected: F_POKM_SaleOrg, F_POKM_StockOrg1, F_POKM_XNFL and similar extended fields must be declared in FieldKeys; otherwise they are not returned by default.
- Base Unit Label vs Value Mismatch: FBaseUnitId_FName is labeled "base unit code" but typically returns the name. Add a "unit normalization" cleansing node in QeasyCloud when mapping.
- Don't Set Limit Too High: The default 2000 is an empirical safe value. In production, requesting more than 5000 rows in a single call frequently causes timeouts or memory pressure on Kingdee.
Troubleshooting Replays
- Filter Order Causes Index Invalidation: Putting
LEFT(FMaterialGroup.FNumber,2)='01'first andFUseOrgId.FNumber='100'later caused full table scans in some projects — the safe approach is to put high-selectivity fields (organization, date) first. - F_POKM_XNFL in FilterString but Not in Response: This is Kingdee's common pattern of "filter but don't expose" for extended fields; newcomers often think it's a missing field, but it is by design.
- Approval Date Time Zone Mismatch: The Kingdee server's default time zone differs from local by 8 hours, causing
HOURE_AGO_5to pull what looks like "5 hours ago" but is actually "13 hours ago". Explicitly set the time zone in QeasyCloud. - Multiple FBARCODE Rows: A single material may have multiple barcodes in Kingdee, and the API returns them as separate rows — downstream ZhiZhang must merge and deduplicate.
- Misunderstanding Limit: Many engineers treat
Limitas "only this many records total" on first contact with executeBillQuery, not realizing it is the page size — you must loop until the returned count is less thanLimit.
When to Use
This API fits scenarios where you need to periodically pull material master data from Kingdee Cloud for downstream ZhiZhang, e-commerce middleware, or logistics systems to align or initialize. It is not suited for write-back, triggering Kingdee workflows, or real-time reverse lookups. An incremental cadence of 5–15 minutes is recommended, and it performs best when the material scale is within the hundreds of thousands.