Qeasy Cloud
Get Started

Purchase Inbound Sync Strategy: From Marketing Cloud to Kingdee Cloud Xingshen

· 何金辉· Integration Solutions· 14 views· 4 min read
汤臣倍健营销云金蝶云星辰采购入库业务单据同步供应链集成Incremental Sync轻易云

What This Strategy Solves

In a real retail supply chain integration project, the Marketing Cloud aggregates large volumes of audited purchase inbound orders every day, while finance and inventory live in Kingdee Cloud Xingshen. Manual re-entry is slow and error-prone: status lag, mismatched supplier codes, and drifting line-item quantities all slow down closing and inventory turnover.

This strategy solves exactly one thing: pushing audited purchase inbound orders from Marketing Cloud to Kingdee Cloud Xingshen's inbound API in an incremental, code-mapped way, so that both sides share the same source, the same numbers, and the same timestamps. It is the business-document layer of supply chain integration, and it is implemented on the Qeasy Data Integration Platform.

Data Flow and Field Mapping

The overall flow is: Marketing Cloud (source) → Qeasy integration platform (middleware) → Kingdee Cloud Xingshen V2 (target). The source is a WebAPI query endpoint, the target is a WebAPI execute endpoint, and the middleware handles cleansing, mapping, and code translation.

Key field mapping (desensitized from source material):

Business MeaningSource Field (Marketing Cloud)Middleware HandlingTarget Field (Kingdee Cloud Xingshen)
Bill dateauditTimeTake audit time, format as datebill_date
Bill numbernumberPass through or generate by rulebill_no
Transaction typeFixed valueWrite constanttranstype = "2"
Supplier codesupplierCodeTranslate via supplier mapping tablesupplier_id
Remark / sourceremark, yxyNumberConcatenate: "{{remark}}-from Marketing Cloud-{{yxyNumber}}"remark
Material entriesmaterialLinesTranslate by material code mappingmaterial_entity
Status filterstatus = "1"Only audited—

The request header must carry tenantId (dealer id). The incremental starting point is injected into beginTime as {{LAST_SYNC_TIME|datetime}}, which is the key hook for subsequent incremental runs.

How to Configure on Qeasy

We usually configure the Qeasy platform on-site in these steps:

  1. Register source and target platforms: Register the connection info and authentication for Marketing Cloud and Kingdee Cloud Xingshen V2 respectively. The platform's platform_id and tenant identifiers are isolated per tenant to avoid cross-tenant data leakage.
  2. Configure the source data source: Select the WebAPI POST endpoint /erp/api/order/query/purInWarehsOrder, with tenantId, status, beginTime, and endTime as query conditions, and status fixed to audited (1).
  3. Configure the target data source: Select the WebAPI POST endpoint /jdy/v2/scm/pur_inbound, binding mapped fields such as bill_date, bill_no, supplier_id, and material_entity.
  4. Middleware mapping and scripts: This is the most error-prone part. We recommend centralizing code mapping — materials, suppliers, and customers all go through a unified mapping table rather than scattered hardcoding in each strategy. Process the header and body in two phases: first write the header and obtain the target system's internal id, then use that id to backfill line items.
  5. Scheduling and triggers: Configure crontab — the source polls every 3 minutes from 8 to 21, the target consumes every 4 minutes from 7 to 23, and the middleware provides buffering and reordering.

The three common Qeasy patterns — centralized code mapping, phased header/body processing, and dual-track incremental plus full sync — are all used in this strategy.

Implementation Steps

Phased scheduling is the key to keeping this strategy running stably:

  • Step 1: Define the incremental starting point. On first go-live, use beginTime to pull the last N days (e.g. 7 days) of audited orders as historical backfill; thereafter, use {{LAST_SYNC_TIME}} as the starting point for true incremental runs.
  • Step 2: Trigger full sync for verification. During windows of batch changes to materials or suppliers, we manually trigger a full comparison in Qeasy, confirm both sides are aligned, and then switch back to incremental.
  • Step 3: Lock in the scheduling cadence. Source */3 8-21 * * *, target */4 7-23 * * *, with staggered peaks to ensure dense synchronization during business hours while avoiding nighttime maintenance windows.
  • Step 4: Exception retry and alerting. Configure a retry policy in Qeasy (e.g. 3 retries with exponential backoff), and set separate alerts for persistently failing supplier codes and unmatched material codes.
  • Step 5: Reconciliation and archiving. After business hours each day, run a bill-number-dimension reconciliation, export the list of source-audited but target-not-written orders, and either manually supplement them or backfill.

Pitfall Review

  1. status filter must be hard-coded to audited. Leaving it empty or omitting it will push draft inbound orders too, generating unpostable reversing documents on the Kingdee side.
  2. tenantId cannot be omitted. Marketing Cloud is multi-dealer; omitting tenantId pulls orders from all dealers, causing cross-tenant data leakage that is extremely hard to trace.
  3. beginTime and endTime must share the same time base. Either both based on creation time or both on update time; mixing them causes missing or duplicate orders. Our safe approach is to use update time (timeType=1) uniformly, so that orders created early but audited late are not missed.
  4. supplier_id must be the target's internal id, not the source code string. Many teams push the source code directly, which causes the Kingdee side to reject or create duplicate suppliers. Always go through a unified supplier mapping table.
  5. Material codes in line items must also be mapped. Materials may have the same name but different codes, or the same code but different names, between the two sides. Make sure the middleware translates once before writing.

Applicable and Non-applicable Scenarios

Applicable: Marketing Cloud as the sales/dealer front end and Kingdee Cloud Xingshen as the finance/inventory back end, requiring audited purchase inbound orders to be synchronized incrementally so that business documents share the same source.

Not applicable: Scenarios where the source is in draft or partially audited state, scenarios requiring real-time second-level sync, or scenarios where the target is not Kingdee Cloud Xingshen but another ERP — the latter two require re-evaluating interface capabilities and scheduling granularity.

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

Comments