Qeasy Cloud
Get Started

Kingdee Cloud Purchase Order Query API Field Manual & Practical Tutorial

· Engineering Best Practices· 4 views· 4 min read
Kingdee CloudDingTalk采购订单接口字段手册轻易云钉钉集成Incremental Sync

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, method executeBillQuery, with input parameters FormId, 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, with TopRowCount returning 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: FilterString defaults to FApproveDate>='{{LAST_SYNC_TIME|datetime}}'. A safer approach is to also include FDocumentStatus='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

FieldTypeMeaningPractical Notes
FPOOrderEntry_FEntryIdstringLine entry primary keyCombine with FID to uniquely identify one row
FIDstringDocument internal idInternal unique id; use FBillNo for cross-system integration
FBillNostringDocument business numbernumber and id in metadata are both mapped to this field; preferred when linking to DingTalk approval numbers
FBillTypeID_FNumberstringDocument type codeCommon values: CGDD01_SYS standard purchase, CGDD02_SYS subcontracting
FBusinessTypestringBusiness typeCG, WW, ZCCG, ZYCG, FYCG, VMICG, etc.
FDocumentStatusstringDocument statusZ temporary / A created / B approving / C approved
FDatedatetimeOrder dateBusiness date
FSupplierId_FNumberstringSupplier codeKey linkage to supplier master data across systems
FPurchaseOrgId_FNumberstringPurchase org codeRequired in multi-org scenarios; used as data permission boundary
FMaterialId_FNumberstringMaterial codeMatched against material master data
FQtyfloatOrder quantityBase quantity
FPricefloatUnit price excluding taxBe careful to distinguish from FTaxPrice
FTaxPricefloatUnit price including taxUsed for financial reconciliation
FEntryTaxRatestringLine tax rate %Stored as string; remember to convert to decimal
FEntryAmountfloatLine amount excluding tax
FAllAmountstringLine amount including taxStored as string
FDeliveryDatedatetimeDelivery dateCommonly used for scheduling and DingTalk reminders
FReceiveQtyfloatCumulative received quantityUsed for progress updates
FRemainReceiveQtyfloatRemaining receive quantityDrives DingTick receive reminders
FStockInQtyfloatCumulative stock-in quantity
FRemainStockINQtyfloatRemaining stock-in quantity
FEntryNotestringLine 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

  1. Select the Kingdee Cloud adapter in the Qeasy connector and fill in the account set and authorization information.
  2. Create a data query strategy, choose the executeBillQuery action, and set FormId to PUR_PurchaseOrder.
  3. In the field mapper, tick the required FieldKeys. The platform automatically categorizes them into primary key, code, and ordinary tags.
  4. The recommended incremental condition is FApproveDate>='{{LAST_SYNC_TIME}}' and FDocumentStatus='C', so that non-approved documents are excluded.
  5. Set the Target to a "write null operation". This strategy is then a pure query strategy, and downstream strategies push the data into DingTalk.
  6. 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

  1. Use FBillNo as the main linkage key: The internal FID is invisible across systems, and almost every downstream depends on FBillNo.
  2. Flat result + line primary key: The result is a flat order-line structure. Reconciliation must use the combination FID + FPOOrderEntry_FEntryId.
  3. Double-check the incremental field: Kingdee's FApproveDate may 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.
  4. Multi-organization isolation: When retail stores and subsidiaries share one Kingdee environment, be sure to add FPurchaseOrgId_FNumber to the FilterString to prevent data cross-contamination.
  5. 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.
  6. 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, FApproveDate is updated and intermediate states can be missed. We recommend also tracking FModifyDate as 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: FAllAmount is string, while FEntryAmount is float. Forgetting to convert types leads to precision loss during aggregation.
  • Confusing document type with business type: FBillTypeID_FNumber is the document template, while FBusinessType is 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p2-447-aaa9

Comments