Syncing Xiekeyun Pricing Orders to Kingdee Cloud Purchase Price Lists: A Single-Strategy Tutorial
What This Strategy Solves
A manufacturing client's procurement team had been stuck on the same problem for years: prices negotiated in an external sourcing system had to be re-entered into the ERP by hand. Even after re-entry, the two systems drifted apart within three months — tax-inclusive prices went stale, tax rates were missed, and effective dates were wrong. We used the Qeasy data integration platform to deliver a single sync flow — Xiekeyun pricing order → Kingdee Cloud purchase price list — that pushes the vendor, material, tax-inclusive price, tax rate, and effective/expiry dates from the pricing order straight into the Kingdee Cloud purchase price list. Once it's in, purchasing can pull prices directly from the price list and the dual-entry problem disappears.
Data Flow and Field Mapping
The data flow is one-way: Xiekeyun (source) → Qeasy integration platform (middleware, responsible for field conversion and line construction) → Kingdee Cloud (target). The source API /pricingOrder/getDetail.json is a single-record query endpoint keyed by the pricing order number prcXkNo. Its response contains both header-level fields (pricing order number, vendor code, vendor name, comparison URL) and line-level fields (material code, tax-inclusive price, tax rate, effective date, expiry date).
Header-level field mapping:
| Business Meaning | Source Field | Target Field | Mapping Type |
|---|---|---|---|
| Pricing order number (business trace key) | prcXkNo | F_UQTJ_HJD | DIRECT |
| Vendor code | innerVendorCode | FSupplierID | DIRECT |
| Source document number | sourceXkNo | F_UQTJ_LYDH | DIRECT |
| Price-comparison URL | priceUrl | F_UQTJ_URL | DIRECT |
| Document name | innerVendorName + timestamp | FName | TRANSFORM |
| Purchasing organization | — | FCreateOrgId | CONSTANT=100 |
| Price list object | — | FPriceObject | CONSTANT=A |
| Price type | — | FPriceType | CONSTANT=2 |
| Currency | — | FCurrencyID | CONSTANT=PRE001 |
| Default price list flag | — | FDefPriceListId | CONSTANT=true |
Line-level mapping (FPriceListEntry, value references lineList):
| Business Meaning | Source Field | Target Field | Conversion Notes |
|---|---|---|---|
| Material code | productCode | FMaterialId.FNumber | Must match Kingdee material master |
| Tax-inclusive price | taxPrice | FTaxPrice | Pass-through numeric value |
| Tax rate | taxRate | FTaxRate | Confirm percentage vs decimal |
| Effective date | effectiveDate | FEffectiveDate | int timestamp → yyyy-MM-dd |
| Expiry date | invalidDate | FExpiryDate | int timestamp → yyyy-MM-dd |
Target-side otherRequest is fixed: FormId=PUR_PriceCategory, IsAutoSubmitAndAudit=true, Operation=Save — save implies auto-submit and auto-approve.
How to Configure in Qeasy
In Qeasy, this strategy is set up as a source QUERY + target EXECUTE combination. The source metadata declares API /pricingOrder/getDetail.json, method POST, primary key prcXkNo. Among the request parameters, erpCode reads from the environment variable {{ERP_CODE}}, prcXkNo is passed in by the upstream scheduler, and isCreateViewUrl is fixed at 1.
The target metadata declares Save, method POST, idCheck=true, business object PUR_PriceCategory. The mapping layer binds source fields according to the table above. The critical part is the line level: the source response is flat, so the data flow must construct a lineList array that the target field FPriceListEntry references via value=lineList. This way, whether the source returns a single line or multiple line items, Kingdee parses them correctly into multiple price list entries.
Three response patterns we often see on customer sites: (1) centralized code-mapping management — vendor, material, organization, and currency lookups are kept in one mapping table instead of scattered across strategies; (2) header and body phased rollout — first prove the header (pricing order number, vendor) works, then add line items; (3) incremental + full-replay dual track — daily incremental sync plus an occasional full replay during go-live or data repair windows.
Implementation Steps
Roll it out in three phases:
Phase 1: Incremental start. Pull active, non-expired pricing orders from Xiekeyun (one record at a time by prcXkNo). Sync the header only. Confirm that the vendor code resolves to Kingdee's vendor master, that FName is concatenated correctly, and that the target Save returns success. The goal of this phase is "the document lands in the database."
Phase 2: Full replay. Once master data is in place, open up the line-level mapping, complete the lineList construction logic and date conversion, and trigger a full backfill covering the last 3–6 months of pricing orders so that the historical price list in Kingdee aligns with Xiekeyun. The goal of this phase is "historical data reconciles."
Phase 3: Scheduling. The crontab is best set to run once a day in the early morning (the 1 1 1 1 1 five-field syntax is the Qeasy private-deployment standard). Day-to-day, the flow runs incrementally — new or changed pricing orders land in Kingdee on T+1. Once a month or once a quarter, run a full reconciliation comparing amounts and effective dates between the two systems.
Lessons Learned
1. Code mapping not designed upfront → numbers drift after 3 months. This is the most common pitfall. innerVendorCode on the source side and FSupplierID on the Kingdee side both look like codes, so people pass them through directly. But if Kingdee's vendor master is keyed by internal ID rather than business code, the source business code simply won't resolve. The safe approach is to align the vendor and material cross-reference tables before go-live, and add an _findCollection lookup in the data flow as a safety net.
2. Misjudging the line structure. The source metadata flattens line-level fields such as taxPrice and productCode into the response, which makes it look like a single-line document. In reality, when a pricing order covers multiple materials, the Xiekeyun API may return a nested array (such as details_list). You must verify the real response shape during integration with live data. A typical mistake is hard-coding the mapping for a single line, which causes multi-material pricing orders to sync only the first material's price.
3. Date format surprises. effectiveDate and invalidDate are int on the source side. They could be Unix seconds, Unix milliseconds, or yyyyMMdd integers — and each one converts differently. Confirm the real meaning of the source field before integration, or the target will receive a flood of 1970-01-01 or invalid dates and the price list will never become effective.
4. Constants don't match the target environment. FCreateOrgId=100 and FCurrencyID=PRE001 are fixed constants that look convenient, but if the customer's target environment uses different codes, the save will fail. Add comments to the constant configuration and allow override via environment variables.
5. Duplicate document names. Concatenating innerVendorName + timestamp reduces collisions, but if the timestamp precision is too low (only down to the minute), names can still clash. If the client has audit requirements on document naming, increase the timestamp precision to seconds and append the prcXkNo suffix.
When This Strategy Fits — and When It Doesn't
Fits: scenarios where vendor sourcing results must become the ERP's purchase price list — typical in manufacturing, retail, and trading enterprises with stable pricing-order structures and aligned master data. Doesn't fit: scenarios where source pricing orders are voided frequently without a status field, where the target environment's currency or organization isn't configured, or where prices are required in real time (sub-second) rather than T+1.