Qeasy Cloud
Get Started

Purchase Inbound Sync Tutorial: Moving Documents from Marketing Cloud to Finance ERP

· Integration Solutions· 16 views· 4 min read
汤臣倍健营销云金蝶云星辰采购入库同步供应链集成轻易云Field MappingIncremental SyncERP

What This Strategy Solves

In supply chain operations, the purchase inbound document is the real evidence of "goods received, invoice matched." The concrete scenario we address: a retail enterprise accumulates a large volume of audited purchase inbound orders in the marketing cloud side every day, and those orders must be carried over to the downstream finance ERP's purchase inbound module to serve as the source data for cost accounting and accounts payable. It looks like "pull + push," but three obstacles — code mapping, time windows, and document status — can easily cause mismatches between the two sides if mishandled.

Data Flow and Field Mapping

The overall chain is "source system → Qeasy Data Integration Platform → target system."

The source interface is a query-style WebAPI. Its core inputs are the dealer identifier, a time window, and the document status. We let Qeasy roll the time window automatically using "last sync time," and we fix the status field to "audited (already shipped out)" so that un-audited documents do not pollute the downstream.

The target interface is an execute-style WebAPI that writes the purchase inbound document and its material entries. The key field mapping is:

Business MeaningSource FieldMiddle LayerTarget Field
Document dateauditTime{{auditTime|date}}bill_date
Document numbernumber{{number}}bill_no
Transaction typefixed value"Purchase Inbound" constanttranstype
Supplier codesupplierNumbercode lookupsupplier_id
Material entriesmaterialLineslist iterationmaterial_entity
Remark / sourceremark + yxyNumbertemplate compositionremark

Centralized code mapping is a common practice among Qeasy customers: keep the "source supplier → target supplier code" and "source material → target material code" tables in one place rather than scattered across scripts. When a new supplier is added or an SKU is changed, only the mapping table needs to be updated, not the strategy itself.

How to Configure on Qeasy

On the Qeasy Data Integration Platform, this strategy is a typical "Query + Execute" combination. There are four configuration points:

  1. Source data source: bind the marketing cloud adapter and fill in the dealer identifier and time-window fields. Use {{LAST_SYNC_TIME\|datetime}} for the start time, and the current scheduling time for the end time, so that the pull is driven by the "last updated" window.
  2. Data processing: use Qeasy's field-mapping component for the header; use the list-iteration component for material entry lines; route supplier code and material code through code-lookups respectively; when a code cannot be found, route the record to an exception branch that writes to a reconciliation log instead of pushing directly to the target.
  3. Target data source: bind the downstream ERP's purchase inbound API, and centralize the transaction-type constant, the remark template, and the document date formatting inside the request template.
  4. Scheduling policy: source side runs every 3 minutes during business peaks; target side writes every 4 minutes. The two schedules are offset to avoid instantaneous congestion. Enable the resume-from-breakpoint switch on the source side.

Implementation Steps

We break the strategy rollout into three phases:

  • Phase 1: increment baseline. Use a one-off full script to backfill the last three days of audited inbound orders into the downstream as the "baseline." This step is critical — without it, the increment will never catch orders earlier than "last sync time," and the two sides will be misaligned from day one.
  • Phase 2: full-trigger validation. Run a full pull in the test environment and reconcile four elements: document number, amount, quantity, and supplier. Then pick three special documents (gift items, zero unit price, multiple entries) and validate each individually.
  • Phase 3: production scheduling. Source side every 3 minutes, target side every 4 minutes, both limited to business hours (e.g. 08:00–21:00); do not run during the small hours so that the downstream maintenance window is preserved. Qeasy supports status-based filtering so that only "audited" inbound orders are pulled — this prevents un-audited documents from being repeatedly fetched and disturbing the downstream document state.

After going live, we recommend keeping a one-week dual-track period: keep the manual entry path in the downstream finance ERP as the "shadow ledger" and the integration channel as the "comparison ledger." Only after the difference between the two drops close to zero should the manual path be retired.

Pitfall Retrospective

The following are issues we have repeatedly seen at customer sites:

  • Pitfall 1: the start time window is set incorrectly. The typical mistake is using "creation time" as the increment anchor, but the creation time and audit time of an inbound order often differ by several days, leading to missed orders. The safer approach is to use "last updated time" as the increment key, and validate completeness with one week of retroactive data during testing.
  • Pitfall 2: the document status filter is too careless. The source status status=1 means "audited (already shipped out)," but some upstream systems also write back an intermediate state, which causes repeated pulls. Be sure to additionally check "audit time is not empty" in Qeasy's filter component.
  • Pitfall 3: the supplier code is hardcoded. Hardcoding the supplier code in the target field means the strategy breaks the moment a new supplier is added. This is exactly what "centralized code mapping" is meant to solve.
  • Pitfall 4: the material entry list is not de-duplicated. The same SKU may appear on multiple lines in the source due to batch or gift rules. Direct iteration and pushing will violate the uniqueness constraint downstream. The safer approach is to aggregate by SKU first and then push downstream.
  • Pitfall 5: overnight runs collide with downstream maintenance. With no business-hour constraint, downstream rejections occur in the small hours, and the next-day retries collide with backfill traffic. Business-hour scheduling is basic hygiene.

Applicable and Non-applicable Scenarios

Applicable: cross-system purchase inbound document movement, where the source is a marketing/trading system, the target is a finance ERP, the daily volume ranges from hundreds to a few thousand documents, and the source has a time-window query interface. Non-applicable: source systems that lack an audit-time field, target ERPs that rely primarily on manual entry, and use cases that require sub-second real-time synchronization — those need event-driven, not polling, integration.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p158a24-kingdee-cloud-4452-n5cf5f3b1-a7eb328f

Comments