Kingdee Cloud Outbound Application API Field Handbook: Guanyi Supply Chain Integration Tutorial
What This API Solves
Kingdee Cloud's Outbound Application is the source document for downstream operations such as sales shipments and e-commerce fulfillment. In supply chain integration scenarios, retail or e-commerce businesses typically need approved documents from Kingdee to flow into Guanyi to create sales orders. This API uses ExecuteBillQuery with an incremental filter by approval date and the status flag FDocumentStatus='C' (approved only), synchronizing Outbound Applications from Kingdee into Guanyi to enable a B2B-to-B2C downstream flow.
API Capability Overview
- Authentication: User/password login against the Kingdee Cloud private deployment, hitting the WebAPI via POST. The FormId is
STK_OutStockApply. - Request structure: Core parameters are
FormId,FilterString,FieldKeys,Limit,StartRow, andTopRowCount. TheFilterStringfollowsFApproveDate>='{{LAST_SYNC_TIME|dateTime}}' and FDocumentStatus='C'. - Response structure: A
Resultarray is returned. Each record carries base fields (Id, Number, Status) plus business fields; the line item fieldBillEntryis a nested array. - Pagination: Use
StartRow+Limit(default 2000 per page, adjustable) to iterate the master document set; line items are returned inline. - Incremental mode: Approval date is the cursor. The schedule runs every 10 minutes from 7 to 23 to capture newly approved or changed documents.
Typical Field Mapping
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| BillNo | string | Outbound Application business number | The number metadata maps to FBillNo; acts as the cross-system reconciliation key |
| DocumentStatus | string | Document approval status | Must equal C (approved); draft/in-progress documents should not be pushed |
| ApproveDate | string | Approval time | Incremental cursor field; ensure the date format matches LAST_SYNC_TIME |
| StockOrgId_Number | string | Application organization code | Maps to Guanyi warehouse/organization; be aware of code differences across orgs and books |
| CustId_Number | string | Customer code | Maps to Guanyi shop_code; recommend centralizing the mapping via CASE |
| DeptId_Number | string | Department code | Decide per business whether to push this to Guanyi |
| Date | string | Application date | Maps to Guanyi deal_datetime; mind the time zone |
| Note | string | Reason / remarks | Can be passed through as a buyer note or memo |
| BillEntry | array | Line items (material, qty, warehouse, etc.) | Maps to Guanyi details; map material code, inventory org, etc. line by line |
| F_UQRW_Text3~7 | string | Custom texts (receiver, province/city/district) | Naming varies across customers; normalize aliases in Qeasy's field mapper |
| F_UQRW_Remarks | string | Custom memo (receiver address) | Concatenate province/city/district + detailed address into Guanyi receiver_address |
| CancelStatus / CancelDate | string | Cancel status / time | Sync cancel status to Guanyi to prevent further fulfillment |
| FCloseStatus / FCloseFlag | string | Close status / manual close | Closed documents should not generate new orders downstream |
How to Configure in Qeasy
On the Qeasy Data Integration Platform, this API is typically packaged as a "Kingdee Cloud query adapter":
- Source adapter: Choose the Kingdee Cloud connector and configure the private address, account set, and user credentials. Sensitive fields are encrypted on the platform side.
- API template: The platform ships a visual panel for
ExecuteBillQuerywith theSTK_OutStockApplymetadata pre-loaded.FieldKeyscan be generated by ticking the required fields. - Filter conditions:
FilterStringsupports the template variable{{LAST_SYNC_TIME|dateTime}}, and the platform automatically injects the last sync timestamp without manual stitching. - Field mapper: The mapper recognizes Kingdee's Id/Name/Number triplets and splits them into separate columns, making one-to-one mapping to Guanyi fields straightforward. Custom fields (
F_UQRW_*) are exposed by their raw keys so engineers can define target aliases themselves. - Target write: Configure the target as Guanyi sales order creation
gy.erp.trade.add. Qeasy automatically validates required fields such asshop_code,details, andreceiver_*per Guanyi's constraints.
Cross-Scenario Best Practices
- Approval date is the most reliable incremental cursor: prefer
FApproveDateoverFModifyDateto avoid re-pushing the same document after a reject/resubmit cycle. - The triplet pattern is Kingdee's universal language: organization, department, customer, and person all expose Id+Name+Number. Cross-system reconciliation almost always uses
_Number;_Idis only used for in-Kingdee joins. - Always process the full
BillEntryarray: material codes, requested quantities, inventory org, and line remarks must all be mapped into Guanyidetails, otherwise downstream rows will be missing. - Custom field naming varies by customer:
F_UQRW_*is one customer's prefix; others may useF_Text*,F_YT*, etc. Maintain an "alias table" in metadata management since it's impossible to enumerate them generically. - Status linkage must be closed-loop: sync both cancel status (
CancelStatus) and close status (FCloseStatus) to the Guanyi side, otherwise a document already canceled in Kingdee may continue to generate push orders and shipments downstream. - Multi-org, multi-book requires separate strategies: in the same Kingdee deployment with different books/orgs, configure distinct Source settings and filter conditions to prevent data crosstalk.
Pitfall Retrospectives
-
Pitfall 1: Unapproved documents are also pushed. Missing
FDocumentStatus='C'inFilterStringcauses drafts/in-progress documents to be synced to Guanyi; they get pushed again when approved, producing duplicates. Safe approach: always include theCcondition in the filter, and add a DocumentStatus assertion in Qeasy's mapper. -
Pitfall 2: Only the first line item is taken.
BillEntryis an array; a single Kingdee request can return 100+ paginated lines, and limiting viaFilterStringrow numbers is ignored. Safe approach: either bumpLimitto pull everything in one shot, or enable Qeasy's "inline line item pagination" switch. -
Pitfall 3: Custom fields come back empty. Kingdee's custom fields must be explicitly listed in
FieldKeys; otherwise the response simply omits the field and the frontend only seesnull. Safe approach: add all required custom fields toFieldKeysand declare them in metadata alongsidenumber/id. -
Pitfall 4: Customer code mapping chaos. Using
CustId_Numberdirectly asshop_codebreaks when one customer corresponds to multiple shops. Safe approach: maintain a customer-code-to-shop-code mapping table inside Qeasy's CASE function, and split orders one-to-many as needed. -
Pitfall 5: Time zone and date format mismatch. Kingdee's approval date is local time, while Guanyi's
deal_datetimedefaults to UTC, leading to a few hours of drift. Safe approach: explicitly declare the time zone (default +08:00) in the platform transformer instead of relying on the runner's local zone.
When to Use
This pattern fits hybrid retail/e-commerce architectures where Kingdee Cloud acts as the ERP master data and approval gate, and Guanyi Cloud serves as the e-commerce order storefront. The typical scenario is distributing B2B-approved documents into B2C sales orders downstream. Boundary: it only suits incremental sync of approved documents, not draft collaboration or workflow intermediate states. If real-time push is required, switch to webhook/event triggers instead of polling.