Authoritative Tutorial on the Kingdee Cloud Skylight Material Query API Field Handbook (Guanyi Cloud × Kingdee Sales Order Domain Practice)
What Problem Does This API Solve
Material master data in Kingdee Cloud Skylight is the backbone of sales, purchasing, inventory, and production. In multiple retail enterprises implementing the "Guanyi Cloud × Kingdee sales order" integration, almost everyone relies on the executeBillQuery API to paginate the BD_MATERIAL form by modification time, completing cross-system product archive alignment, license keep-alive, and material validation before downstream document writing. Although the strategy is named "for refreshing Kingdee license, do not close," it actually plays the role of a master data channel.
API Capability Overview
- Entry point: Kingdee Cloud Skylight open platform
executeBillQuery, formBD_MATERIAL(Material Master). - Authentication: Cloud Skylight user identity authentication (account + integration secret), accessed via HTTP/HTTPS WebAPI.
- Request structure:
FormId=BD_MATERIAL,FieldKeys(comma-separated field collection),FilterString(e.g.,FModifyDate>='{{LAST_SYNC_TIME|datetime}}'),Limit(default 2000),StartRow(supports the{{PAGINATION_START_ROW}}variable). - Response structure: JSON array; each row is one material record, fields ordered per
FieldKeys; referenced objects use theMain.SubPropertyformat (e.g.,FBaseUnitId.FNumber). - Pagination/Incremental mode: Offset-based pagination via
StartRow + Limit; incremental relies on theFModifyDatetimestamp; strategy type is QUERY with Target as "empty write," pure query without writing to a target. - Scheduling suggestion: crontab
*/30 * * * *. In Qeasy, it is typically orchestrated as an independent "keep-alive query strategy" decoupled from formal sync strategies.
Typical Field Mapping
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| FMasterId | string | Material primary key, metadata id | The unique anchor for cross-system mapping; persist it first |
| FNumber | string | Material code, metadata number | Core key for aligning with Guanyi Cloud product codes |
| FName | string | Material name | Used in document display; confirm Chinese encoding |
| FBaseUnitId_FNumber | string | Base unit code | Inconsistent units directly break inventory conversion |
| FMaterialGroup_FNumber | string | Material group code | Affects downstream document defaults |
| FErpClsID | string | Material attribute (finished/semi-finished/raw) | Strongly tied to sales order type |
| FCreateOrgId_FNumber / FUseOrgId_FNumber | string | Creation org / Usage org | Multi-org clients must distribute by org dimension |
| FIsSale / FIsPurchase / FIsProduce / FIsSubContract / FIsInventory / FIsAsset | string | Business usage flags | Must validate before downstream writes, otherwise Kingdee rejects |
| FDocumentStatus / FForbidStatus | string | Data status / Forbidden status | Only sync "audited and not forbidden" data |
| FStockId_FNumber | string | Default warehouse code | Wrong warehouse mapping skews outbound orders |
| FSafeStock | string | Safety stock | Numeric type returned as string; conversion needed |
| FIsBatchManage / FIsKFPeriod / FIsSNManage | string | Batch / Shelf-life / Serial number management | Determines whether downstream documents must carry batch info |
| FExpPeriod | string | Shelf-life | Watch out for unit (day vs. month) |
| FDefaultVendor_FNumber | string | Default vendor code | Default value source for purchase orders |
| FSalePrice_CMK / FVIPPrice_CMK / FPurPrice_CMK | string | Retail / VIP / Purchase unit price | _CMK often denotes a specific org or price system; confirm meaning with customer |
| FGROSSWEIGHT / FNETWEIGHT / FLENGTH / FWIDTH / FHEIGHT / FVOLUME | string | Weight and dimensions | Numeric fields returned as strings; explicit cast required |
| FOldNumber | string | Old material code | Used for historical data migration tracing |
| FBARCODE | string | Barcode | Aligned with PDA / scanner scenarios |
| FPOBillTypeId_FNumber / FProduceBillType_FNumber / FSubBillType_FNumber | string | Purchase / Production / Subcontract doc type code | Determines downstream document type |
| FFixLeadTime / FVarLeadTime | string | Fixed / Variable lead time | Affects MRP calculation |
| FOrderQty / FMinQty / FMaxQty / FMaxPOQty / FMinPOQty / FIncreaseQty | string | Purchase and sales batches | String numbers; beware of implicit loss during conversion |
How to Configure on Qeasy
On the Qeasy Data Integration platform, this API is typically packaged as a "Kingdee Cloud Skylight Material Query" adapter. Configuration has three core steps:
- Access authentication: Fill in the Cloud Skylight account's API address, account, and integration secret; the platform automatically completes the OAuth-style identity exchange.
- Metadata configuration: Bind
idtoFMasterIdandnumbertoFNumber. Select fields via the visual "field mapper." Bind the incremental field uniformly toFModifyDate. - Strategy orchestration: Since this strategy is essentially a "keep-alive + master data channel," choosing "empty write" for Target is sufficient. If you need to sync materials to Guanyi Cloud, create a separate SYNC strategy. In the Qeasy field mapper, you can drag-and-drop
FNumber→ Guanyi product code,FName→ product name,FBaseUnitId_FNumber→ base unit — no SQL required.
Cross-Scenario Practical Points
- Use
FMasterId+FNumberdual anchor for idempotency: Relying solely on code easily conflicts across account sets during merging; a composite unique index of primary key + code is the most robust approach. FModifyDatemust carry timezone: When Kingdee's timestamp lacks timezone, cross-day syncs suffer "yesterday's material only arrives today" delay. The safe practice is to persist inyyyy-MM-dd HH:mm:ssformat within the FilterString.- Unpack reference fields: Kingdee's nested structures like
FBaseUnitId.FNumbermust be flattened in the Qeasy mapper; otherwise the downstream ODS cannot persist nested objects. - Business usage flags must be filtered up front:
FIsSale='1',FForbidStatus='A'(not forbidden),FDocumentStatus='C'(audited) form the sales-order-eligible material trinity; none can be missing. - Decouple keep-alive from business: Run keep-alive queries alone at
*/30 * * * *so they don't compete with formal syncs for license concurrency and avoid peak-hour rate limits. - Price field suffixes need scrutiny: Suffixes like
_CMKand_ORGcarry different meanings across customer scenarios; the first thing to confirm when onboarding a project is "which org or price system does this suffix represent?"
Pitfall Review
- Pitfall 1: Default Limit of 2000 hits the ceiling: Kingdee's max single response is 2000 rows; excess is truncated. Fix: In the Qeasy paginator, bind
StartRowto{{PAGINATION_START_ROW}}and loop until the returned row count is less than Limit. - Pitfall 2: Numeric fields are all strings: Fields like
FSafeStockandFExpPeriodreturn as strings even when they are numeric in business. Direct persistence yields the awkward "string 10 greater than string 9 but less than string 2." Fix: Add atoNumber()conversion in the mapper. - Pitfall 3: Forbidden materials still get synced:
FForbidStatus='B'means forbidden; without filtering, they will be referenced by downstream sales orders as usable materials. Fix: Hard-filterFForbidStatus='A'in the FilterString. - Pitfall 4: Multi-org clients experience material mix-ups: The same material may share a code across orgs but have different
FMasterIdvalues; cross-org sync will overwrite org A's material into org B. Fix: UseFUseOrgId_FNumberas a partition key when writing downstream. - Pitfall 5:
_CMKprice field returns nothing: In some customer scenarios, the org corresponding to_CMKis unauthorized, and the API returns null without erroring. Fix: In Qeasy, configure "skip on null + log alert" for this field to avoid silent loss.
When to Use
Choose this API when you need to incrementally pull material master data from Kingdee Cloud Skylight, prepare preconditions for sales order sync, or simply keep the API license alive. If your downstream is not Kingdee (e.g., writing to a custom OMS), it is recommended to first extract data via a QUERY strategy, then build a separate SYNC strategy to write to the target system, avoiding tight coupling. For pure write scenarios, use the save/batchSave APIs instead of reusing this query.