Purchase Inbound Sync Strategy: From Marketing Cloud to Kingdee Cloud Xingshen
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 Meaning | Source Field (Marketing Cloud) | Middleware Handling | Target Field (Kingdee Cloud Xingshen) |
|---|---|---|---|
| Bill date | auditTime | Take audit time, format as date | bill_date |
| Bill number | number | Pass through or generate by rule | bill_no |
| Transaction type | Fixed value | Write constant | transtype = "2" |
| Supplier code | supplierCode | Translate via supplier mapping table | supplier_id |
| Remark / source | remark, yxyNumber | Concatenate: "{{remark}}-from Marketing Cloud-{{yxyNumber}}" | remark |
| Material entries | materialLines | Translate by material code mapping | material_entity |
| Status filter | status = "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:
- Register source and target platforms: Register the connection info and authentication for Marketing Cloud and Kingdee Cloud Xingshen V2 respectively. The platform's
platform_idand tenant identifiers are isolated per tenant to avoid cross-tenant data leakage. - Configure the source data source: Select the WebAPI POST endpoint
/erp/api/order/query/purInWarehsOrder, withtenantId,status,beginTime, andendTimeas query conditions, andstatusfixed to audited (1). - Configure the target data source: Select the WebAPI POST endpoint
/jdy/v2/scm/pur_inbound, binding mapped fields such asbill_date,bill_no,supplier_id, andmaterial_entity. - 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.
- 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
beginTimeto 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
statusfilter 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.tenantIdcannot be omitted. Marketing Cloud is multi-dealer; omittingtenantIdpulls orders from all dealers, causing cross-tenant data leakage that is extremely hard to trace.beginTimeandendTimemust 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.supplier_idmust 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.- 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.