Kingdee Cloud Purchase Order Query API Field Manual & Practical Tutorial
What Problem Does This Interface Solve
In real procurement business, the purchase order is the central document connecting demand, suppliers, receiving, and warehousing. When we build integrations, we often need to pull purchase order data from Kingdee Cloud into a middleware layer and then push it to DingTalk for approvals, notifications, reports, or document reconciliation. This interface (executeBillQuery, FormId PUR_PurchaseOrder) is the standard entry point provided by Kingdee Cloud for querying purchase orders. It supports incremental filtering by approval date, paginated retrieval of line items, and basically covers all the fields needed for purchase order synchronization.
Interface Capability Overview
- Authentication: Standard Kingdee Cloud WebAPI authentication. On the Qeasy platform, it is usually handled by the connector once the account set is configured.
- Request:
POST, methodexecuteBillQuery, with input parametersFormId,FieldKeys,FilterString,Limit,StartRow,TopRowCount,OrderString. - Response structure: A flattened two-dimensional array. Each record corresponds to an order line; header-level fields are repeated on every line.
- Pagination pattern: Pagination via
Limit+StartRow, withTopRowCountreturning the total row count. We recommend 2000–5000 rows per page in practice, because larger sizes tend to trigger timeouts on the Kingdee side. - Incremental pattern:
FilterStringdefaults toFApproveDate>='{{LAST_SYNC_TIME|datetime}}'. A safer approach is to also includeFDocumentStatus='C'so that temporary or in-approval documents are not pulled. - Scheduling suggestion: This strategy uses
0-59/10 8-22 * * *, running every 10 minutes during business hours for near-real-time sync.
Typical Field Mapping
| Field | Type | Meaning | Practical Notes |
|---|---|---|---|
| FPOOrderEntry_FEntryId | string | Line entry primary key | Combine with FID to uniquely identify one row |
| FID | string | Document internal id | Internal unique id; use FBillNo for cross-system integration |
| FBillNo | string | Document business number | number and id in metadata are both mapped to this field; preferred when linking to DingTalk approval numbers |
| FBillTypeID_FNumber | string | Document type code | Common values: CGDD01_SYS standard purchase, CGDD02_SYS subcontracting |
| FBusinessType | string | Business type | CG, WW, ZCCG, ZYCG, FYCG, VMICG, etc. |
| FDocumentStatus | string | Document status | Z temporary / A created / B approving / C approved |
| FDate | datetime | Order date | Business date |
| FSupplierId_FNumber | string | Supplier code | Key linkage to supplier master data across systems |
| FPurchaseOrgId_FNumber | string | Purchase org code | Required in multi-org scenarios; used as data permission boundary |
| FMaterialId_FNumber | string | Material code | Matched against material master data |
| FQty | float | Order quantity | Base quantity |
| FPrice | float | Unit price excluding tax | Be careful to distinguish from FTaxPrice |
| FTaxPrice | float | Unit price including tax | Used for financial reconciliation |
| FEntryTaxRate | string | Line tax rate % | Stored as string; remember to convert to decimal |
| FEntryAmount | float | Line amount excluding tax | |
| FAllAmount | string | Line amount including tax | Stored as string |
| FDeliveryDate | datetime | Delivery date | Commonly used for scheduling and DingTalk reminders |
| FReceiveQty | float | Cumulative received quantity | Used for progress updates |
| FRemainReceiveQty | float | Remaining receive quantity | Drives DingTick receive reminders |
| FStockInQty | float | Cumulative stock-in quantity | |
| FRemainStockINQty | float | Remaining stock-in quantity | |
| FEntryNote | string | Line note |
In Qeasy's field mapper, FBillNo is usually auto-recognized as the business number key, while FPOOrderEntry_FEntryId is recognized as the line key. When mapping to the downstream generic model, fields with the _FNumber suffix such as FSupplierId_FNumber / FMaterialId_FNumber / FPurchaseOrgId_FNumber can be uniformly replaced with generic supplier_code / material_code / org_code.
How to Configure on Qeasy
- Select the Kingdee Cloud adapter in the Qeasy connector and fill in the account set and authorization information.
- Create a data query strategy, choose the
executeBillQueryaction, and set FormId toPUR_PurchaseOrder. - In the field mapper, tick the required
FieldKeys. The platform automatically categorizes them into primary key, code, and ordinary tags. - The recommended incremental condition is
FApproveDate>='{{LAST_SYNC_TIME}}' and FDocumentStatus='C', so that non-approved documents are excluded. - Set the Target to a "write null operation". This strategy is then a pure query strategy, and downstream strategies push the data into DingTalk.
- In Qeasy's scheduling center, configure a crontab that runs every 10 minutes during business hours; pause during off-hours to save quota.
Cross-Scenario Practical Points
- Use FBillNo as the main linkage key: The internal FID is invisible across systems, and almost every downstream depends on FBillNo.
- Flat result + line primary key: The result is a flat order-line structure. Reconciliation must use the combination FID + FPOOrderEntry_FEntryId.
- Double-check the incremental field: Kingdee's
FApproveDatemay be rewritten in unapprove/re-approve scenarios, which can cause data loss in increments. A safe approach is to combine it with the document status filter and supplement it with periodic full reconciliation. - Multi-organization isolation: When retail stores and subsidiaries share one Kingdee environment, be sure to add
FPurchaseOrgId_FNumberto the FilterString to prevent data cross-contamination. - Be explicit on price/tax conventions: FPrice and FTaxPrice, FEntryAmount and FAllAmount are easily mixed. Make sure to agree on ex-tax vs. tax-inclusive conventions with finance before integration.
- Tune page size: The Kingdee server imposes limits on the row count per response. In real projects we usually set Limit to 2000, which balances throughput and avoids timeouts.
Pitfall Recap
- Wrong FilterString time format: Kingdee requires
yyyy-MM-dd HH:mm:ss. Passing a timestamp or a date-only string causes errors or empty results. - Incremental field rewritten, data missed: After unapprove and reapprove,
FApproveDateis updated and intermediate states can be missed. We recommend also trackingFModifyDateas a fallback. - Empty supplier/material codes: Some documents are in temporary status or failed imports, so key code fields may be missing. Validate required fields before pushing into DingTalk.
- Inconsistent amount field types:
FAllAmountis string, whileFEntryAmountis float. Forgetting to convert types leads to precision loss during aggregation. - Confusing document type with business type:
FBillTypeID_FNumberis the document template, whileFBusinessTypeis the business classification. The two are not one-to-one, so make sure you understand them correctly when classifying.
When to Choose
When your scenario is syncing Kingdee Cloud purchase orders to a middleware layer, DingTalk approvals, financial accounting, or reporting systems, this interface is the best choice. If you only need document header summaries, you may consider the lighter Query interface, but as soon as line items, price/tax, and receiving/stock-in progress are involved, you must use executeBillQuery with FormId PUR_PurchaseOrder.