Qeasy Cloud
Get Started

FBA Transit-Loss Replenishment Cost Streams to Stepwise Transfer-In: A Qeasy Hands-On Guide

· 尹春锐· Integration Solutions· 5 views· 4 min read
Kingdee CloudERPFBA途损补回分步式调入单轻易云供应链集成

What This Strategy Solves

In cross-border retail, FBA warehouses frequently incur "transit loss" — goods lost, damaged, or reconciled differently between domestic shipment and the Amazon warehouse. The source ERP records these events as cost streams under the type "FBA transit-loss replenishment" (business_types=11), while the target ERP expects a stepwise transfer-in document to post the entry properly.

It may look like a simple "stream → document" transformation, but the real headaches are cross-month extraction, deduplication by source document number, dynamic lookup of organizations and owners by warehouse, and readable document numbers. In one real engagement, we packaged this into a single schedulable strategy on the Qeasy data integration platform and ran it stably for three quarters.

Data Flow and Field Mapping

Flow: source ERP (cost stream API /cost/center/api/cost/stream) => Qeasy middleware layer => target ERP (batch save batchSave).

Key field mapping (desensitized):

Business meaningSource (source ERP)MiddlewareTarget (target ERP)
Unique keyunique_keyPass-throughSuffix of FBillNo
Document number—concat('FBA transit-loss','-',RIGHT(unique_key,12))FBillNo
Business typebusiness_types=11Filter condition—
Datestream_datePass-throughFDate
Stock-in orgwh_name_findCollection lookup by nameFStockOrgID
Ownerwh_nameReuse lookup resultFOwnerIdHead
Owner type—Fixed constantFOwnerTypeIdHead=BD_OwnerOrg
Bill type—Metadata configFBillTypeID

The middleware does two jobs: resolve warehouse names into the target ERP's stock organization/owner IDs, and prefix the document number so finance can recognize a transit-loss-replenishment bill at a glance.

How to Configure on Qeasy

On the Qeasy strategy canvas, this strategy has three stages:

  1. Source component: pick the "source ERP / cost stream" interface, method=POST. Hard-code business_types=11 and query_type=01 (inventory action date) in the request body. Date range uses a _function expression to fetch "the 1st to the last day of the previous month". This is the on-site pattern we keep seeing — centralized code mapping, keeping type and date values at the source rather than re-translating them in the middle.

  2. Transform component: use Qeasy's field-mapping canvas for warehouse-name → org-ID lookup and document-number concatenation. idCheck=true and number=unique_key ensure the same stream never generates a duplicate transfer-in bill.

  3. Target component: the target ERP's batchSave. Org IDs reference a warehouse-to-org mapping collection maintained inside Qeasy, and the owner type is hard-coded as BD_OwnerOrg.

Implementation Steps

We recommend a three-phase rollout:

  • Phase 1 — incremental starting point. Set the crontab to manual trigger at month start to fetch the previous full month, and reconcile quantities and amounts on both sides. The source crontab is 5 17 8 8 * *, the target is 5 20 8 8 * * (8th of each month). The target runs 3 hours later to leave time for extraction and dedup.
  • Phase 2 — full-volume trigger. Run continuously for 3 months, confirming each monthly transit-loss-replenishment stream lands as a 1:1 transfer-in bill in the target with a unique document number.
  • Phase 3 — stable scheduling. Open the crontab for automatic monthly runs, enable Qeasy's exception alerts and rerun mechanism, and escalate manually when a save fails.

This is the typical "incremental + full-volume dual-track" pattern at customer sites: full validation during development, incremental only after go-live.

Pitfalls We Have Hit

  1. Cross-month extraction is dangerous. The source explicitly states "no cross-month" for start_date / end_date. Use "the 1st to the last day of the previous month". Never shortcut to "the 1st of this month to today" — that day's data is not closed and will cause duplicates.
  2. Do not hard-code org IDs. Stock organizations in the target ERP vary by tenant. Always use _findCollection by name, otherwise switching tenants breaks the entire pipeline.
  3. Watch document-number length. We use RIGHT(unique_key,12). One customer once tried the full string and hit length truncation on FBillNo, breaking month-end reconciliation. Truncating the last 12 characters is the safe choice — it preserves uniqueness while controlling length.
  4. Stock org and owner are two separate systems. Beginners often conflate them. Here FStockOrgID and FOwnerIdHead both reference the same warehouse mapping, but their semantics differ — never merge them.
  5. Mind the dependency order. This strategy depends on prior A-sequence (product) and B-sequence (supplier) master-data sync. If materials haven't synced first, the target ERP will reject the bill with "material does not exist".

When to Use and When Not to Use

Use when: a cross-border retail/manufacturing enterprise uses a source ERP as the front-end business system and a target ERP as the back-end finance/supply-chain system, and needs to settle monthly cost streams like transit-loss replenishment, over-receipt, or reconciliation adjustments as formal documents. Do not use when: the stream must post in near-real-time (minute-level); the source business type is not 11 — other transfer or inventory-counting scenarios require separate field mapping.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-kingdee-cloud-erp-9642-fba-fba-17bf8210

Comments