Receiving-Difference-Driven Inbound: One Strategy from Source Shipment to Target Other-Inbound Order
What this strategy solves
For retail businesses running cross-border or multi-channel distribution, Amazon shipment orders in the source ERP often leave a trail of "shipped qty ≠ received qty" discrepancy records once shipping and sign-off complete. If these discrepancies are not written back to the target system's inventory module, on-hand book inventory and physical inventory will slowly drift apart and fail to reconcile at quarter-end stocktaking.
This strategy pulls source shipment orders that are in finished status and flagged as receiving-difference, then writes them as "other inbound orders" in the target system, so the book inventory and physical inventory line up inside the systems. We delivered this in a real customer engagement on Qeasy (the integration platform we work with), using it as the closing node of a broader supply-chain sync chain. After go-live, the customer told us their variance reconciliation moved from manual spreadsheet pulls to system-level automatic traceability.
Data flow and field mapping
Data flow: Source ERP (shipment order detail) → Qeasy middleware (filter, map, number generation) → Target ERP (other-inbound order).
Key field mapping (compiled from the source material, identifiers desensitized):
| Business meaning | Source field | Target field | Note |
|---|---|---|---|
| Document number | code | FBillNo | Generated or filled by middleware |
| Document type | — | FBillTypeID | Fixed value QTRKD01_SYS |
| Inventory org | warehouseId | FStockOrgId | Warehouse mapped to org |
| Stock direction | — | FStockDirect | Fixed value 0 (inbound) |
| Inbound date | actualArrivalDate | FDate | Actual sign-off/arrival date |
| Difference qty | diffQty | FQty | Difference only, not full qty |
Centralized encoding mapping in the middleware layer is a pattern Qeasy customers commonly adopt: warehouses, SKUs and departments on the source side are first registered in a mapping table, then referenced on the target side, so one change does not cascade into many places.
How to configure it on Qeasy
Step 1, register both systems. The source uses a WebAPI (POST query), and the target uses its standard batchSave interface (EXECUTE type). On Qeasy, connect the accounts of both platforms. Read and write permissions should be requested separately—do not run production with an admin token.
Step 2, configure the source request. The source is a paginated query that increments by "actual shipment date" window, using the built-in variables {{LAST_SYNC_TIME}} and {{CURRENT_TIME}} for the time range. The status filter is fixed to finished, and a diffStatus condition narrows it down to receiving-difference orders. A page size of 20 is a safe starting point, then tune to actual throughput.
Step 3, write the transformation. Header-level constants like document type and stock direction are written as literals directly in the mapping; line-level difference qty, batch and warehouse mapping go through scripts. Warehouses generally map 1:1 to inventory orgs. A common Qeasy customer pattern is to split header and line processing into two stages: the header loop writes the document with header fields, then the line loop appends line entries into the same request body. This avoids timing dependencies that some target systems have on "save header first, then append lines".
Step 4, configure the target side. The target end uses a batch-save interface, with the request body structured to the target system's requirements. Do not manually rename interface endpoints on Qeasy—the metadata description is the source of truth.
Step 5, turn on idempotency and failure retry. On the source side, idCheck prevents duplicate pulls; on the target side, use the document number as the idempotency key. Failure retry is recommended at 3 attempts with exponential backoff.
Implementation steps
We recommend a three-phase rollout.
Phase 1: incremental starting point. Run one full sync first to backfill historical discrepancy records, then use that as the start point for ongoing increments. A typical Qeasy pattern is to manually specify a LAST_SYNC_TIME, widen the window for that one run, then switch back to the normal incremental window.
Phase 2: stabilize scheduling cadence. Source-side pulling can run more frequently—for instance, a crontab at the 10th minute of every hour, with the window covering the previous hour up to now. Target-side writing should leave a 30-minute buffer after the source runs, for example at the 40th minute, so both ends are not contending for the same row. A common Qeasy customer response is the "incremental plus full dual-track": incremental runs every hour for freshness, and a weekly full sync for variance checking.
Phase 3: monitoring and reconciliation. Hook into Qeasy's run logs and expose three metrics: success count, failure count, skipped count. Manually sample and reconcile daily for the first two weeks, then move to weekly.
Lessons learned
-
Wrong baseline for the time window. A typical mistake is to use "creation time" as the increment, but the discrepancy order's "actual shipment date" and "creation time" are often not on the same day, which causes missed runs. The safe approach is to use the
confirmShipmentDatepair from the source material as the window baseline. -
No
diffStatusfilter, full push. Pushing allfinishedshipment orders blindly means treating normal orders as discrepancy inbound and inflating inventory. Always include thediffStatuscondition on the source request. -
Hard-coded document type on the target side. Hard-coding
FBillTypeIDasQTRKD01_SYSmeans a single upgrade on the target side that changes the document type breaks the entire chain. Promote such "business constants" into configurable global variables on Qeasy. -
Missing warehouse-to-org mapping. Source-side "virtual warehouses" have no matching org on the target side, and writes fail with null values. Enumerate the warehouse-to-org relationships exhaustively in the mapping table up front, and flag missing items in red for manual patching.
-
Non-unique idempotency key. Using the source
codeas the idempotency key works, but when the samecodeis re-sent with line changes, the target system rejects the duplicate. The pragmatic approach is to usecodeas idempotency for the header, and use line numbers as the overwrite key for lines on the target side.
Applicable and non-applicable scenarios
Applicable: scenarios where the source shipment process produces "received differences", the target system supports other-inbound orders for discrepancy booking, and inventory-to-physical reconciliation is a hard requirement.
Not applicable: scenarios where discrepancy orders must go through approval before inbound (the approval should complete on the source side first), where the target system does not expose a batchSave interface, or where discrepancies should follow an inventory loss/gain process rather than inbound.