Qeasy Cloud
Get Started

Practical Tutorial: Syncing LingXing ERP Transfer Orders to Kingdee Cloud Transfer Outbound Orders

· 王浩宇· Integration Solutions· 22 views· 5 min read

What This Strategy Solves (Scenario & Value)

In a multi-warehouse retail business, inter-warehouse transfers are a high-frequency daily operation: one ERP handles front-end fulfillment and inventory dispatch, while another handles financial accounting and inventory books. When a warehouse performs a transfer outbound in the source system but no corresponding transfer outbound document exists in the target system, the inventory books stay frozen. At month-end, the numbers do not reconcile, and finance ends up manually creating backfill documents.

This strategy addresses exactly that: it pushes transfer orders from the source ERP into transfer outbound documents in the target system according to defined rules, achieving 'one place of business document origination, synchronized inventory books on both sides.' After we onboard the workflow on the Qeasy data integration platform, cross-system transfer data shifts from asynchronous manual handling to scheduled automated synchronization.

Data Flow and Field Mapping (Source -> Middle Layer -> Target)

The overall chain is unidirectional: Source ERP (query API) -> Qeasy middle layer (aggregation, cleansing, mapping) -> Target system WebAPI (write transfer outbound document).

The source side uses a transfer order list query API, incrementally pulling by 'transfer time' with pagination support. The target side uses a WebAPI execution API that accepts JSON to directly generate the transfer outbound document. Key field mapping is as follows:

Business MeaningSource Field (LingXing)Middle Layer ProcessingTarget Field (Kingdee Transfer Outbound)
Document No.order_snDirect passbill_no
Outbound Datetransfer_timeDate formattingbill_date
Business TypeFixed valueConstanttrans_type (1 same-price)
Allocation RuleFixed valueConstantallocate_rule (1 by tax-included price)
Transfer StatusDerivedStatus enum mappingtrans_fer_status
Line ItemsMaterial/Qty/BatchLine item splitentries[]

We recommend handling the header and body in two phases: the header lands first, then line items follow according to dependency order, to avoid orphan documents with 'header but no body.'

How to Configure on Qeasy

On Qeasy, the core configuration for this strategy focuses on three areas.

First, source query parameters. Beyond the usual page and page_size, the key is search_date_type=2 (by transfer time) and the relative time variables for start_date/end_date: {{LAST_SYNC_TIME|date}} and {{CURRENT_TIME|date}}. This is the lifeline of incremental sync. Never hard-code a fixed date, or a backfill will pull the entire history in one shot.

Second, field mapping and encoding governance. A common Qeasy customer pattern is to centralize encoding mapping: material codes, warehouse codes, location codes are all defined in one intermediate mapping table. Any source system goes through this table before writing to the target. When onboarding a new warehouse, you only update the mapping table, not the strategy.

Third, target write. The target API is /jdy/v2/scm/inv_tfout. bill_no is passed directly from the source order_sn as the idempotency key to prevent duplicates. The three constant fields trans_fer_status, trans_type, and allocate_rule are fixed according to the target system convention. operation_key uses audit to auto-approve, reducing manual secondary operations.

Additionally, source-side ID check (idCheck: true) must be enabled so that source-side edits can be tracked back in time.

Implementation Steps

Phased scheduling is the prerequisite for a stable rollout. A typical cadence is:

Phase 1: Full Backfill (Cold Start) Before going live, run a full backfill covering a complete transfer cycle (for example, the past 30 days), confirming that document numbers, amounts, and quantities reconcile on both sides. In this phase, set start_date to a fixed date, and after the full backfill completes, switch to relative time variables.

Phase 2: Incremental Starting Point After full backfill succeeds, switch the strategy to incremental mode with the starting point aligned to the end-of-full-backfill timestamp. We recommend updating LAST_SYNC_TIME only after the source returns successfully, to avoid missing data due to pulling but not yet landing.

Phase 3: Schedule Frequency The source cron is 6-59/15 7-23 * * *, that is, every 15 minutes from 07:00 to 23:59 daily, avoiding peak hour spikes. The target cron is staggered by 4 minutes at 10-59/25 7-23 * * *. The staggering prevents the two sides from colliding; the source finishes a batch, and the target has buffer time to land it.

Phase 4: Monitoring and Reconciliation Reconcile daily for the first week after go-live, focusing on whether source document numbers appear 1:1 on the target side. Then switch to weekly reconciliation. Check run logs on Qeasy and filter by source on the target's transfer outbound list.

Lessons Learned

Pitfall 1: Relative time variables hard-coded Hard-coding start_date to something like 2025-11-01 causes a single pull to fetch an entire month, overwhelming the source system. The safe approach: use full mode before go-live, then immediately switch to {{LAST_SYNC_TIME|date}} after go-live.

Pitfall 2: Line item count exceeds the limit When source documents have many line items, the target API has a per-call line count limit; exceeding it causes failure. Recommend splitting into batches by line count on the Qeasy side, or pre-filtering oversized documents.

Pitfall 3: Status field semantics mismatch The source's 'transfer status' and the target's trans_fer_status value sets are not consistent (the target uses an enum like 0/1/2/3). Passing values as-is causes field validation failure. Always perform enum mapping in the middle layer instead of transparent passthrough.

Pitfall 4: Date attribution for cross-day/cross-month documents It is common for transfer order creation time and posting time to fall on different days. If the source's transfer time is used as the target's outbound date, reconciliation drifts across day boundaries. We recommend using the business 'posting date' as bill_date rather than the API-returned creation time.

Pitfall 5: Idempotency key conflict Re-runs or source-side back-pushes cause duplicates. bill_no must be passed directly from the source order_sn; do not add your own prefix. Once you change the idempotency key, all subsequent backfills become chaotic.

Applicable and Non-Applicable Scenarios

Applicable when cross-system inventory books must be reconciled, inter-warehouse transfer is a daily high-frequency operation, and both source and target expose open APIs. Not applicable when transfer business is heavily customized, when the two systems' inventory models differ dramatically (for example, batch/expiry dimensions do not align), or when the source does not support time-based incremental pull and can only do full polling. In the latter cases, the source data must first be governed before sync can be discussed.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-kingdee-cloud-erp-4589-n07350924-1bce8bd3

Comments