Authoritative Tutorial on the Kingdee Cloud "Query Sales Outbound Order" API Field Manual
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 throughexecuteBillQuery, with FormId fixed asSAL_OUTSTOCK. - Response Structure: Flat structure where header and line items are merged; each record corresponds to one line entry, using
FEntity_FENTRYIDas the line primary key. - Pagination/Incremental Mode:
Limit=2000,StartRow={{PAGINATION_START_ROW}},TopRowCount=0; filter conditionFApproveDate>='{{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 Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| FID | string | Outbound order primary key | Master unique identifier; use cautiously as a business key |
| FEntity_FENTRYID | string | Line entry primary key | The true "unique key" for integration deduplication and incremental sync; this is what the Qeasy metadata id field maps to |
| FBillNo | string | Order number | Business unique identifier; this is what the Qeasy metadata number field maps to |
| FBillTypeID_FNumber | string | Order type | XSCKD01/03/04/07_SYS correspond to standard/retail/standard/B2C; route by business logic |
| FDate | string | Business date | Different from approval date; use with caution |
| FCustomerID_FNumber | string | Customer code | In B2C scenarios this may be the member code |
| FShopNumber / FSALECHANNEL | string | Shop / sales channel | Used for multi-store routing; must be included in mapping |
| FMaterialID_FNumber | string | Material code | Aligns with Jushuitan product SKU |
| FRealQty / FMustQty | string | Actual / expected qty | Actual qty is key for pushing shipping status back to Jushuitan |
| FPrice / FTaxPrice / FAllAmount | string | Price / amount | Note distinction between tax-included and tax-excluded; easy to trip up here |
| FStockID_FNumber | string | Outbound warehouse | Warehouse routing field |
| FReceiverName/Address/Mobile | string | Consignee info | In B2C scenarios prefer the FReceiver series over FLinkMan |
| FLinkMan / FLinkPhone | string | Legacy contact fields | Old fields; recommend deprecating for new businesses |
| FCarriageNO | string | Logistics waybill no. | Synced to Jushuitan for logistics tracking |
| FSrcType / FSrcBillNo / FSoorDerno | string | Source order info | Links back to upstream sales order |
| FSgtEOrderNo / F_SGT_Text | string | Jushuitan order number | The "bridge field" for cross-system linkage; must be included in FilterString |
| FDocumentStatus | string | Document status | Used 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
- Bridge field must be explicitly filtered:
FSgtEOrderNo<>''is core; without it, unlinked internal outbound orders will also be pulled, causing dirty data. - Approval date vs business date: The incremental cursor must use
FApproveDate(approval date), notFDate(business date); otherwise backdated or modified orders will be missed. - 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 keyFIDwill repeat across multiple line items. - Multi-store and multi-channel routing: The combination of
FShopNumber,FSALECHANNEL, andFBillTypeID_FNumbercan precisely distinguish B2C, retail, consignment, etc., avoiding mismatched store assignments. - Consignee fields old and new coexist:
FLinkMan/FReceiveAddressandFReceiverName/FReceiverAddresshave similar meanings; for new business, unify on the FReceiver series, with FLinkMan kept only for legacy compatibility. - 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
- Setting Limit to 10000 causes timeouts: Kingdee private deployment limits rows per response; the safe approach is
Limit=2000with StartRow pagination. Qeasy's field mapper automatically advances pages. - Missing
idCheckcauses duplicate rows: IfidCheck=trueis not set in metadata, Kingdee's response may produce duplicate rows from association queries; always enable primary key validation. - Confusing tax-included vs tax-excluded amounts: Mistakenly treating
FAllAmount(price + tax total) asFAmount(tax-excluded) when sending to Jushuitan will cause reconciliation mismatches — this is a common pitfall. - 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. - Different metadata for same FormId across scenarios: When multiple scenarios share the same FormId, the
number/id/idChecktrio 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.