Sales Order Sync from E-commerce Mid-ile to ERP: A Single-Strategy Deep Dive
What this strategy solves
A home-apparel brand runs its multi-store business on an e-commerce mid-platform (Jushuitan) and its back-office accounting on an ERP (Kingdee Cosmos). Once the two books drift apart, customer service sees shipment counts that never match what finance sees as outbound. The sales-outbound sync strategy pushes the daily shipments from the mid-platform into the ERP under a single agreed definition, so inventory, receivables, and cost accounting share one source of truth. It looks like simple document forwarding, but the choice of code mapping, phased scheduling, and incremental start point decides whether the books reconcile three months later.
Data flow and field mapping
Documents leave the source mid-platform, pass through the Qeasy integration platform for cleansing and code mapping, and land as sales-outbound bills in the ERP. The header carries shop, warehouse, customer, currency, and document date; the body carries SKU, quantity, unit price, and batch.
Key field mapping (selected; actual project mapping is governed by the customer's signed agreement):
| Business meaning | Source mid-platform | Qeasy middle layer | Target ERP |
|---|---|---|---|
| Document number | io_id / so_id | Preserved with prefix | FBillNo |
| Shop / Org | shop_id | Lookup table to org code | FOrgId / FShopId |
| Warehouse | warehouse | Warehouse code mapping | FStockId |
| Customer | receiver + shop | Concatenated or mapped virtual customer | FCustId |
| Item code | sku_id | Mapped via item master strategy | FItemId |
| Quantity | qty | UOM conversion | FQty |
| Unit price | price | Tax-included / excluded switch | FPrice |
| Document date | created / modified | Use approval time | FDate |
| Note / logistics | lgh_company, lcv | Written to text field | FNote |
A recurring engineering trap: shop IDs and ERP org codes are two separate worlds and must never be copied across. The reliable approach is to maintain one organisation-mapping dataset inside Qeasy and let every downstream strategy reference it — change once, propagate everywhere.
Configuring it on Qeasy
On the Qeasy data integration platform, this type of strategy typically follows these configuration points:
- Data source registration. Source points to the source mid-platform's sales-outbound interface; target points to the ERP's sales-outbound save interface. Credentials are kept at the connector level, never hard-coded into the strategy.
- Metadata and field mapping. The source schema is pulled by Qeasy; mapping is done visually with one-to-one assignments or expressions. For shop-to-org or SKU-to-item lookups, use the lookup component so the translation happens in the middle layer.
- Centralised code mapping. Organisation, item, customer, warehouse, and currency mappings are stored as auxiliary datasets in Qeasy and referenced by multiple strategies. Each strategy does not maintain its own copy.
- Header and body in stages. Land the header first — document number, org, customer, date, note — and verify those fields are stable. Then write the body line by line. When something breaks, this separation makes it obvious whether the header or the body is at fault.
- Exception and retry. Tag each document as success, failure, or skipped. Failed documents go into a tolerance queue and can be re-run manually or automatically. A single bad body line should not block the entire header.
- Logs and reconciliation. Strategy logs record both source document numbers and target document numbers. A reconciliation view flags rows where quantity or amount disagree across sides, supporting month-end checks.
Implementation steps
We recommend three phases; out-of-order execution usually causes rework.
- Phase 1: Pin down the incremental start point. On site, work with sales, warehouse, and IT to pick the increment cut-over — usually the ERP go-live date or the first day of a chosen month. Anything before that runs as a one-off full backfill. For the increment key, use the source's approval/modified timestamp rather than creation time, otherwise late-approved documents are missed.
- Phase 2: Full backfill trigger. For pre-cutover documents, run a one-off full reload. During the backfill, disable downstream triggers and reverse-writes on the ERP side so the flow stays strictly one-way. After completion, validate amounts, SKU counts, and batches; only then switch to daily scheduling.
- Phase 3: Scheduling frequency and monitoring. Daily increments follow the business tempo — most home-apparel brands run two or three times per day, once before the morning peak and once after the business close. Schedule by time window plus queue rather than a fixed cron tick, to avoid backlog build-up when a run is missed.
Lessons from the field
- Using creation time as the increment key silently drops back-dated documents. Some source documents are entered late; their creation time is older than the increment window while their approval time is inside it. Reliable practice is approval time plus a manual "starting document number" fallback.
- Shop code and org code get mixed up. One shop maps to one org, but the same org may own multiple warehouses. Keep the two hops separate; do not collapse them into a single mapping.
- Tax-included vs tax-excluded mismatch. The source mid-platform returns tax-included prices; the ERP's default outbound document is tax-excluded. Passing the value straight through makes amounts disagree. Add a tax-switch expression in the middle layer, or maintain a dedicated price list on the ERP side.
- Batch and expiry fields are easy to forget. Not every home-apparel SKU carries a batch, but when one does, a wrong batch invalidates the whole document. Promote batch to a first-class validated field in Qeasy; empty batches go straight to the tolerance queue.
- Header saved but body rows fail, leaving an orphan document. When body rows partially fail, the ERP often retains a half-written document. Make header write and body write atomic, or actively void the header if the body write fails entirely.
When it fits and when it does not
Fits: multi-store retail, brand-direct plus authorised-reseller mix, home / apparel / daily-goods where the sales mid-platform and the ERP are separate systems, daily document volume from a few thousand to tens of thousands, and the business requires same-day or near-real-time reconciliation.
Does not fit: pure offline distribution, very low document volume that does not justify system integration, B2B high-value orders (where native ERP sales-order entry is preferable to outbound-document forwarding), and scenarios requiring two-way synchronisation of inventory and logistics. Two-way cases are better modelled as a combination of one-way queues rather than a single outbound sync.