Qeasy Cloud
Get Started

Authoritative Tutorial on the Kingdee Cloud "Query Sales Outbound Order" API Field Manual

· 陈洁琳· Engineering Best Practices· 23 views· 4 min read

What Problem Does This API Solve

In the integration between Jushuitan and Kingdee Cloud for retail e-commerce scenarios, after an online order is shipped, the sales outbound order from Kingdee must be pushed back to Jushuitan to complete status synchronization, reconciliation, and inventory deduction verification. This API uses executeBillQuery to pull sales outbound orders (SAL_OUTSTOCK) with filtering on approval date plus the Jushuitan order number, making it the critical data entry point on the "Kingdee → Jushuitan" direction of the sales closed loop.

Interface Capability Overview

  • Authentication: Kingdee Cloud private deployment, based on user identity tokens (data center + account set + app) to call the open platform API; the Qeasy adapter centrally manages credentials.
  • Request Method: POST, submitting queries through executeBillQuery, with FormId fixed as SAL_OUTSTOCK.
  • Response Structure: Flat structure where header and line items are merged; each record corresponds to one line entry, using FEntity_FENTRYID as the line primary key.
  • Pagination/Incremental Mode: Limit=2000, StartRow={{PAGINATION_START_ROW}}, TopRowCount=0; filter condition FApproveDate>='{{LAST_SYNC_TIME|datetime}}' and FSgtEOrderNo<>'', enabling incremental synchronization by approval date.
  • Metadata Conventions: number=FBillNo, id=FEntity_FENTRYID, idCheck=true, buildModel=false, autoFillResponse=true.

Typical Field Mapping

Field NameTypeMeaningPractical Notes
FIDstringOutbound order primary keyMaster unique identifier; use cautiously as a business key
FEntity_FENTRYIDstringLine entry primary keyThe true "unique key" for integration deduplication and incremental sync; this is what the Qeasy metadata id field maps to
FBillNostringOrder numberBusiness unique identifier; this is what the Qeasy metadata number field maps to
FBillTypeID_FNumberstringOrder typeXSCKD01/03/04/07_SYS correspond to standard/retail/standard/B2C; route by business logic
FDatestringBusiness dateDifferent from approval date; use with caution
FCustomerID_FNumberstringCustomer codeIn B2C scenarios this may be the member code
FShopNumber / FSALECHANNELstringShop / sales channelUsed for multi-store routing; must be included in mapping
FMaterialID_FNumberstringMaterial codeAligns with Jushuitan product SKU
FRealQty / FMustQtystringActual / expected qtyActual qty is key for pushing shipping status back to Jushuitan
FPrice / FTaxPrice / FAllAmountstringPrice / amountNote distinction between tax-included and tax-excluded; easy to trip up here
FStockID_FNumberstringOutbound warehouseWarehouse routing field
FReceiverName/Address/MobilestringConsignee infoIn B2C scenarios prefer the FReceiver series over FLinkMan
FLinkMan / FLinkPhonestringLegacy contact fieldsOld fields; recommend deprecating for new businesses
FCarriageNOstringLogistics waybill no.Synced to Jushuitan for logistics tracking
FSrcType / FSrcBillNo / FSoorDernostringSource order infoLinks back to upstream sales order
FSgtEOrderNo / F_SGT_TextstringJushuitan order numberThe "bridge field" for cross-system linkage; must be included in FilterString
FDocumentStatusstringDocument statusUsed to determine audit status; recommend syncing only audited documents

How to Configure on Qeasy

In the Qeasy data integration platform, calls to this API typically use the Kingdee Cloud adapter which encapsulates executeBillQuery. Under "Data Query Mode," configure FormId as SAL_OUTSTOCK and explicitly list the required fields in FieldKeys (avoid pulling all fields which slows down queries). The filter condition uses platform time variables like {{LAST_SYNC_TIME|datetime}} concatenated with strings, automatically advancing the cursor on each schedule.

The field mapper automatically recognizes the metadata conventions number=FBillNo and id=FEntity_FENTRYID, flattening the response into a "line entry" model that maps directly to Jushuitan's shipment details. Set the Target configuration to "Empty Write Operation" for a pure query strategy; downstream data cleaning and field mapping can then be done in Qeasy's transformer before chaining to write strategies.

A schedule of */5 * * * * is recommended, combined with incremental filtering, ensuring near real-time sync while keeping API pressure at a reasonable level.

Cross-Scenario Best Practices

  1. Bridge field must be explicitly filtered: FSgtEOrderNo<>'' is core; without it, unlinked internal outbound orders will also be pulled, causing dirty data.
  2. Approval date vs business date: The incremental cursor must use FApproveDate (approval date), not FDate (business date); otherwise backdated or modified orders will be missed.
  3. Line entries are the true unique unit: Since the response is a flattened header + line structure, the true idempotent key is FEntity_FENTRYID; the master key FID will repeat across multiple line items.
  4. Multi-store and multi-channel routing: The combination of FShopNumber, FSALECHANNEL, and FBillTypeID_FNumber can precisely distinguish B2C, retail, consignment, etc., avoiding mismatched store assignments.
  5. Consignee fields old and new coexist: FLinkMan/FReceiveAddress and FReceiverName/FReceiverAddress have similar meanings; for new business, unify on the FReceiver series, with FLinkMan kept only for legacy compatibility.
  6. Sync only audited documents: FDocumentStatus='A' (or the corresponding audit state) should be an implicit filter; syncing unaudited documents back to Jushuitan will cause incorrect shipping status marking.

Pitfall Review

  1. Setting Limit to 10000 causes timeouts: Kingdee private deployment limits rows per response; the safe approach is Limit=2000 with StartRow pagination. Qeasy's field mapper automatically advances pages.
  2. Missing idCheck causes duplicate rows: If idCheck=true is not set in metadata, Kingdee's response may produce duplicate rows from association queries; always enable primary key validation.
  3. Confusing tax-included vs tax-excluded amounts: Mistakenly treating FAllAmount (price + tax total) as FAmount (tax-excluded) when sending to Jushuitan will cause reconciliation mismatches — this is a common pitfall.
  4. Empty string check for Jushuitan order number: The filter FSgtEOrderNo<>'' in Kingdee must use single quotes around the empty string; in some versions <>"" doesn't work. The safe approach is to explicitly add quotes during platform variable concatenation.
  5. Different metadata for same FormId across scenarios: When multiple scenarios share the same FormId, the number/id/idCheck trio must be unified; otherwise the Qeasy adapter's cached metadata may overwrite each other, causing mysterious missing fields.

When to Use This API

Whenever the business involves a "Jushuitan (or other e-commerce platform) ↔ Kingdee Cloud" sales order closed loop and needs to push Kingdee outbound orders back upstream for shipping status synchronization, reconciliation, or logistics sync, this API is the top choice. However, for pure internal transfers, subcontracting, or scenarios that don't require syncing back to an online system, direct internal Kingdee document flow is sufficient — no integration needed.

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

Comments