Qeasy Cloud
Get Started

Authoritative Tutorial: Interface Field Handbook for Kingdee Cloud Xingchen & LingXing ERP Supply Chain Integration

· 王浩宇· Engineering Best Practices· 20 views· 5 min read
金蝶云星辰ERP供应链集成接口字段手册轻易云FBA

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:

FieldTypeMeaningPractical Notes
sku / mskustringLingXing-side product unique codeUsed as cross-system join key, tightly bound to Kingdee number; case-sensitive, must preserve original value
supplier_code / supplier_idstringSupplier code/IDRequired for purchase inbound, purchase return, and subcontracting inbound; build the mapping table in advance
store_id / sidstringStore IDUsed as the customer field for sales outbound, sales return, and store profit documents
order_sn / bill_nostringBusiness document numberUsed as idempotency key to avoid duplicates; Amazon orders are concatenated as amazon_order_id-sid
bill_datedateDocument dateSourced from shipment_date, opt_time, stream_date, etc., normalized to YYYY-MM-DD
currencystringCurrency codeResolved via _findCollection from Xingchen currency table (number → id); default CNY
qty / change_qtynumericQuantityOutbound takes absolute value, inbound takes positive; FBA streams must be aggregated by unique_key before bill creation
operation_keyconstantActionTypically set to audit to auto-audit after creation, reducing manual intervention
bill_sourceconstantDocument sourceTypically set to ISV to flag third-party origin for audit traceability
remarkstringRemarksRecommend 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:

  1. 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.
  2. Field Mapper: Qeasy's field mapper supports four rule types: DIRECT, COLLECTION, TRANSFORM, and CONSTANT. For example, sku → material_number uses COLLECTION to look up via MongoDB, remark prefixing uses TRANSFORM, and bill_source=ISV uses CONSTANT. After configuration, the platform renders a visual wiring diagram for review.
  3. 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.
  4. Query-Only Strategies: Xingchen units of measure, materials, and transfer outbound use the QUERY_ONLY type without writing to a target system; they exist solely to complete lookups for primary keys.
  5. 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:

  1. 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.
  2. Choose idempotency keys close to business keys: Amazon orders use amazon_order_id-sid, after-sales uses rma_id, FBA streams use unique_key. These naturally unique business numbers are most reliable; do not use gmt_modified as an idempotency key because of timezone and precision issues.
  3. Incremental fields differ per source system: Different LingXing APIs use one of last_update_time, gmt_modified, create_time, or opt_time. Mark them per API in the solution; do not apply a one-size-fits-all rule.
  4. FBA streams are line-level data: Unlike the usual bill + detail structure, /cost/center/api/cost/stream returns line-level streams. You must aggregate by unique_key or business_number before generating inbound/outbound bills, otherwise many tiny bills will be produced.
  5. 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.
  6. Auto-audit is not default behavior: Most Kingdee bill APIs require explicit operation_key=audit to auto-audit after creation. Forgetting it causes a backlog of pending audit bills.

Pitfalls and Lessons Learned

  1. Low lookup hit rate on units of measure: Xingchen material base_unit_id is 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.
  2. FBA stream inbound/outbound direction reversed: business_type 215 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.
  3. Store ID and customer code mixed up: LingXing Amazon stores use sid, multi-platform stores use store_id. Build separate mapping tables for the two; do not share a single customer code, otherwise platform types get tangled.
  4. 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 to gmt_modified.
  5. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p6-233-erp-4589-7194

Comments