Qeasy Cloud
Get Started

Sales Return Order Sync in Practice: A Strategy-Level Implementation from WMS to Kingdee

· 尹春锐· Integration Solutions· 30 views· 5 min read
WDTKingdee Cloud销售退货供应链集成轻易云策略同步

What This Strategy Solves

In one retail engagement, online return and exchange orders were created in the WMS, but finance closing and inventory accounting lived in the ERP. Without a bridge, refund amounts, cost allocation, and inventory accounts would drift apart, forcing the finance team to spend two or three days each month reconciling manually. The goal of this strategy is straightforward: take each return order from the source and land it as a sales return voucher in the target, so that the business document and the financial document are the same thing.

Data Flow and Field Mapping

The flow is unidirectional: Source (WMS) → Qeasy integration middleware → Target (Kingdee Cosmos). The middleware is not a dumb pipe; it handles field mapping, voucher state judgment, and the split-and-assemble of header and line data.

Key FieldSource (WMS)Target (Kingdee)Notes
Document No.Return/Exchange No.FBillNoPass-through from source; used as idempotency key
TypeReturn / Exchange flagBusiness typeOnly "return" is written; exchange is split into return + re-issue
CustomerCustomer archive IDF_CUSTMust be translated via the customer mapping table
ItemSKU codeFMaterialIdRequires the item sync to have run first
WarehouseReceiving warehouseFStockIdBound to inventory organization
Qty / AmountLine itemLine qty, line amountStrict 1:1 at line level
Business dateBusiness dateFDateUsed as the cutoff for incremental sync

A practical reality: the source "return/exchange order" is broader than the target "sales return voucher." The safe approach is to branch on business type at the source, push only pure returns, and split exchanges into two steps—otherwise downstream inventory and receivables will be corrupted.

How to Configure This in Qeasy

We use Qeasy (轻易云数据集成平台) as the integration backbone. The configuration has four parts.

1. Source connection. Register the WMS API in Qeasy, configure pagination and the timestamp field. Returns are normally pulled incrementally by "last modified time," with a one-time full load as the baseline.

2. Target connection. Register Kingdee's Save and Submit APIs. A detail that is easy to miss: Kingdee's Save and Submit are separate calls. The voucher must be saved and then submitted, otherwise the approval node will not advance.

3. Field mapping and code lookup. All code translations are maintained centrally in the mapping center so that, when items, customers, or warehouses change, only one place needs to be updated. Centralized code mapping is one of the most common patterns among Qeasy customers—it pays off especially when SKUs double three months later.

4. Flow orchestration. The strategy is orchestrated as three stages: fetch, transform, and write to target. Header and lines flow in two data streams: header as the main voucher, lines as children following the header. Staging header and lines separately is another standard Qeasy pattern; it prevents the half-baked state where the header succeeds but lines are missing.

Implementation Steps

Rollout has three phases, each with a clear trigger condition.

Phase 1: Item and customer pre-sync. A return voucher can only land in Kingdee if the items and customers already exist there. This phase must run first. Only after a full validation passes should the return voucher strategy be enabled.

Phase 2: Establish the incremental baseline. On-site, we freeze a "business cutoff point," for example, all return orders up to 23:59 on a given day. Vouchers before the cutoff go through the full-reload channel, backfilled by creation time; vouchers after the cutoff go through the incremental channel, polled every 5 minutes by "last modified time." Incremental plus full reload in parallel is a Qeasy standard pattern—it guarantees historical completeness while keeping daily sync stable.

Phase 3: Daily scheduling and monitoring. Return orders are time-sensitive but not second-sensitive: finance needs to see them by the next day. We schedule the integration every 5 minutes in Qeasy, with three retries on failure using exponential backoff, plus an alert to the ops channel. Two metrics deserve close attention: voucher success rate (should stay above 99%) and source-side backlog (if it crosses a threshold, the target is rejecting writes).

Lessons from the Field

Pitfall 1: Treating exchange orders as returns. A common mistake is to push every return/exchange voucher into Kingdee without discrimination, which causes the exchange "outbound—inbound" chain to be skipped and downstream inventory to be understated. The safe approach is to branch at the source and let exchanges follow a different strategy.

Pitfall 2: Item codes not pre-synced. During one on-site run, Kingdee returned "item does not exist." The reason was that the item sync strategy had not run, or had missed a batch of codes. Item sync is a hard prerequisite for return voucher sync—this order cannot be reversed.

Pitfall 3: Wrong field chosen as the incremental watermark. Using "creation time" as the watermark misses vouchers that were created earlier but modified later. The safe approach is to poll on "last modified time" and use the voucher number as the idempotency key.

Pitfall 4: Half-written lines. Without staged orchestration, the header succeeds while lines fail, leaving an "empty header" voucher. This is exactly why header and lines must be staged separately—slower is fine, half-baked is not.

Pitfall 5: Kingdee Submit API missed. Only the Save API was called, leaving the voucher in the "draft" state, invisible to finance. After configuration, always run the full chain: Save → Submit → Approve.

When This Strategy Fits, and When It Does Not

Fit: high-volume return vouchers that need to land in finance by the same or next day, with clear code-system differences between source and target, and a middleware layer for centralized mapping, in an on-premises deployment.

Does not fit: multi-bookset cross-organization scenarios, complex source-side approval flows that the target cannot absorb, or pure-exchange businesses (this strategy handles returns only; exchanges need a separate strategy).

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-kingdee-cloud-5710-new-386e71f9

Comments