Authoritative Tutorial: Interface Field Handbook for Kingdee Cloud Xingchen & LingXing ERP Supply Chain Integration
What This Interface Solves
In a typical architecture where cross-border e-commerce operations are separated from SME financial accounting, LingXing ERP serves as the business master system handling orders, purchasing, inventory adjustments, and FBA cost streams, while Kingdee Cloud Xingchen handles inventory valuation, costing, and vouchers. A stable interface layer is required to bi-directionally synchronize products, suppliers, stores, sales outbound, purchase inbound, adjustment orders, FBA cost streams, transfer orders, and profit data, eliminating manual re-entry and reconciling book-to-physical differences.
Interface Capability Overview
Authentication: Kingdee uses an OAuth 2.0 style authorization with AppKey + AppSecret to obtain an access_token. Tokens have an expiration window, so the integration platform must run a "Get Token" strategy first and auto-renew before expiry. LingXing uses AppKey + AppSecret signature-based authentication passed via request headers.
Request/Response Structure: Kingdee Cloud Xingchen APIs are uniformly POST JSON with paths such as /jdy/v2/scm/sal_out_bound, /jdy/v2/scm/pur_inbound, and /jdy/v2/pm/subm_prodin. Responses include success, data, and error fields. LingXing APIs are mostly GET with pagination, on paths like /erp/sc/data/mws/orders, /erp/sc/routing/storage/inbound/getOrders, and /cost/center/api/cost/stream, returning cursor-based or page-based results.
Pagination and Incremental Sync: LingXing supports multiple timestamp fields as incremental cursors, including last_update_time, gmt_modified, create_time, and opt_time. First-time deployment or historical backfill runs full sync, then switches to incremental. Kingdee query-only strategies (Xingchen units of measure, materials, transfer outbound) supply lookup completion for joins.
Data Flow: Primary direction is "LingXing → Kingdee", covering master data, sales outbound, sales returns, purchase inbound/return, adjustment orders, FBA streams, transfer orders, and store profit. Reverse direction is "Kingdee → LingXing" for subcontracting inbound bills writing back to purchase orders.
Typical Field Mappings
The table below summarizes the most repeated field mappings across multiple customer implementations:
| Field | Type | Meaning | Practical Notes |
|---|---|---|---|
| sku / msku | string | LingXing-side product unique code | Used as cross-system join key, tightly bound to Kingdee number; case-sensitive, must preserve original value |
| supplier_code / supplier_id | string | Supplier code/ID | Required for purchase inbound, purchase return, and subcontracting inbound; build the mapping table in advance |
| store_id / sid | string | Store ID | Used as the customer field for sales outbound, sales return, and store profit documents |
| order_sn / bill_no | string | Business document number | Used as idempotency key to avoid duplicates; Amazon orders are concatenated as amazon_order_id-sid |
| bill_date | date | Document date | Sourced from shipment_date, opt_time, stream_date, etc., normalized to YYYY-MM-DD |
| currency | string | Currency code | Resolved via _findCollection from Xingchen currency table (number → id); default CNY |
| qty / change_qty | numeric | Quantity | Outbound takes absolute value, inbound takes positive; FBA streams must be aggregated by unique_key before bill creation |
| operation_key | constant | Action | Typically set to audit to auto-audit after creation, reducing manual intervention |
| bill_source | constant | Document source | Typically set to ISV to flag third-party origin for audit traceability |
| remark | string | Remarks | Recommend prefixing (e.g., "LingXing", "LingXing After-sales") for source distinction and easier troubleshooting |
How to Configure on Qeasy
In the Qeasy Data Integration Platform, this Kingdee-LingXing solution is typically split into 29 independent strategies orchestrated through the strategy scheduler with dependency relationships. Key configuration steps:
- Authentication Pre-step: Create a "Get Token" strategy at the top of the strategy list as the auth prerequisite for all subsequent Kingdee API calls. The platform automatically caches the token and refreshes it before expiry.
- Field Mapper: Qeasy's field mapper supports four rule types: DIRECT, COLLECTION, TRANSFORM, and CONSTANT. For example,
sku → material_numberuses COLLECTION to look up via MongoDB,remarkprefixing uses TRANSFORM, andbill_source=ISVuses CONSTANT. After configuration, the platform renders a visual wiring diagram for review. - Master Data First: The platform auto-schedules based on the dependency graph. Master data strategies (product → material, supplier, store → customer) run before business documents, ensuring downstream lookup hit rates.
- Query-Only Strategies: Xingchen units of measure, materials, and transfer outbound use the
QUERY_ONLYtype without writing to a target system; they exist solely to complete lookups for primary keys. - Idempotency and Retry: The platform auto-enables business-key idempotency per strategy, e.g.,
order_sn,rma_id,amazon_order_id-sid. Single-row failures do not block subsequent rows; failed items enter the retry queue and trigger alerts.
Cross-Scenario Practical Points
Drawing from multiple customer projects, we distill these common lessons:
- Mapping tables must go live before business documents: SKU, customer, supplier, and warehouse code mapping tables are the foundation of all business documents. Any missing mapping causes the entire bill to fail.
- Choose idempotency keys close to business keys: Amazon orders use
amazon_order_id-sid, after-sales usesrma_id, FBA streams useunique_key. These naturally unique business numbers are most reliable; do not usegmt_modifiedas an idempotency key because of timezone and precision issues. - Incremental fields differ per source system: Different LingXing APIs use one of
last_update_time,gmt_modified,create_time, oropt_time. Mark them per API in the solution; do not apply a one-size-fits-all rule. - FBA streams are line-level data: Unlike the usual bill + detail structure,
/cost/center/api/cost/streamreturns line-level streams. You must aggregate byunique_keyorbusiness_numberbefore generating inbound/outbound bills, otherwise many tiny bills will be produced. - Subcontracting inbound is a reverse write-back: This is the only "Kingdee → LingXing" direction and is easy to miss in dependency orchestration. Be sure to create a dedicated strategy and explicitly depend on LingXing product master data already being synced.
- Auto-audit is not default behavior: Most Kingdee bill APIs require explicit
operation_key=auditto auto-audit after creation. Forgetting it causes a backlog of pending audit bills.
Pitfalls and Lessons Learned
- Low lookup hit rate on units of measure: Xingchen material
base_unit_idis an ID, not a name. Without first running the "Xingchen Units of Measure" query strategy, material sync will fail entirely. The safe approach is to make that query strategy a hard prerequisite. - FBA stream inbound/outbound direction reversed:
business_type215 and 220 are both outbound (FBA removal, inventory outbound); only 25 is inbound (inventory inbound). In real projects we have seen 215 mistakenly treated as inbound, causing inventory direction reversal that later required manual write-offs. - Store ID and customer code mixed up: LingXing Amazon stores use
sid, multi-platform stores usestore_id. Build separate mapping tables for the two; do not share a single customer code, otherwise platform types get tangled. - Lost data when switching from full sync to incremental: During first-time full backfill, using an incremental field as the query condition misses historical untouched records. The safe approach is to first run a full sync by
create_time, then switch togmt_modified. - Token expiry causes batch failures: If Kingdee token expiry is not auto-renewed ahead of time, the entire batch fails at peak hours. Qeasy's token caching and renewal strategy avoids this, but in manual calls always add retries.
When to Use
This integration solution fits cross-border e-commerce or new retail enterprises where LingXing is the business master system and Kingdee Cloud Xingchen is the financial accounting system for bi-directional sync. If the enterprise uses only one system, or uses higher Kingdee editions such as Kingdee Cloud Galaxy or Cosmic, the API paths and fields differ and require re-adaptation.