Qeasy Cloud
Get Started

Yonyou U8 Purchase Receipt API Field Handbook: Cross-Solution Aggregation Tutorial

· 系统管理员· Engineering Best Practices· 23 views· 4 min read
四化智造MES(WEB)用友U8用友U8MES采购入库Field MappingSupply Chain轻易云

What This Interface Solves

In MES-ERP supply chain integration, the "MES Purchase Receipt → U8 Purchase Receipt" interface is one of the most critical transaction-level endpoints. It reflects real-time inbound movements on the shop floor into U8's inventory ledger, ensuring consistency of source data for cost accounting, inventory reports and accounts payable. This tutorial aggregates multiple customer projects into a reusable field-and-configuration handbook.

Interface Capability Overview

  • Authentication: U8's open platform typically uses an account set + application server + authorized user pattern. In Qeasy, this is exposed via the "U8 Connector" with username/password credentials managed by the platform vault.
  • Request Structure: A two-level header + detail-row (array) structure. The header carries the bill number, date, supplier, warehouse, department and remarks; detail rows expand materials, quantities, unit prices and source-row numbers.
  • Response Structure: Returns the document number, save result and row-level error information. U8 allows partial row-level success, so the platform must validate line by line.
  • Pagination / Incremental Mode: The MES source typically pulls incrementally by bill_date or modify_time; first-time initialization runs full sync. U8 has no standard pagination, so idempotency is enforced by deduplicating on the document number.

Typical Field Mappings

FieldTypeMeaningPractical Notes
bill_nostringMES receipt numberRecommend a business prefix (e.g. RK_) to avoid clashes with manually keyed U8 numbers
bill_datedateReceipt dateMust align with U8 accounting period; cross-period documents need special handling
purchase_order_nostringSource PO numberMust already exist in U8, otherwise U8 will reject
supplier_codestringSupplier codeDriven by a supplier mapping table; reconcile code conventions early
warehouse_codestringInbound warehouse codeWarehouse master must be synced before this document
dept_codestringBusiness department codeDepartments must be synced before warehouses
cPOCodestringU8 source-document fieldMust equal purchase_order_no, linking back to the PO
bNegativeintRed/blue flag1 for returns/undo-receipts, 0 for normal receipts
material_codestringInventory codeDepends on completion of material master sync
quantitydecimalReceipt quantityCompare against the PO line's open quantity to prevent over-receipt
iPORowNointSource-line numberMust exactly match the PO detail-line number
iPrice / iMoneydecimalUnit price / amountTax-inclusive flag must match U8 master, otherwise cost anomalies appear

How to Configure on Qeasy

On the Qeasy data-integration platform, the U8 Purchase Receipt endpoint is encapsulated by the "Yonyou U8 Adapter". Configuration usually takes three steps. First, in "Data Source" choose the U8 adapter and fill in the account set, server and authorized user. Second, in the "Field Mapper" use visual drag-and-drop to build the mappings above; the platform auto-detects DIRECT / COLLECTION / TRANSFORM / CONSTANT mapping types. Finally, in "Strategy Orchestration" hang this strategy behind the Purchase Order strategy and set up an incremental schedule on bill_date. Qeasy's field mapper also auto-handles code mapping and date-format conversion; exceptions land in the "Exception Center" for retry.

Cross-Solution Practice Points

  1. Master data must precede transactional documents: Materials, suppliers, warehouses, departments and units must all be synced before any purchase receipt, otherwise U8 rejects due to missing foreign keys.
  2. Strict source-document validation: U8 Purchase Receipt requires the source PO to exist and be open. Validate upstream in MES and filter out invalid documents before pushing.
  3. Code mapping is the hidden pitfall: Identical materials often have different codes between MES and U8; build an independent code-mapping table — Qeasy's COLLECTION mapping plugs straight into it.
  4. Build separate strategies for red vs blue documents: Returns and undo-receipts should use a dedicated "Purchase Receipt (Red)" strategy with bNegative=1. Do not attempt to push negative quantities through the blue interface — U8 will reject.
  5. Choose incremental fields carefully: modify_time is affected by edits, while bill_date is the stable incremental key. If MES exposes an audit log, prefer that timestamp.
  6. Tiered retry for exceptions: Differentiate retry intervals for network glitches, U8 table locks and field-length overflow. Qeasy's "Exception Center" can auto-route by error code.

Pitfall Retrospective

  • Missing warehouse codes causing whole-batch failures: In one project, MES had 200+ warehouses while U8 only pre-loaded 50, driving a >30% batch failure rate. The safe approach is to run a "U8 warehouse master comparison" first, then manually or via a remediation endpoint fill the gaps.
  • Pushing receipts against closed POs: A closed PO in U8 no longer accepts receipts. Add a "PO status write-back" branch in the strategy, or have MES validate before pushing.
  • Red/blue direction reversed: An undo-receipt was pushed via the blue interface, inflating inventory instead of reducing it. This is a common trap — the safe pattern is two independent strategy templates, distinguished explicitly by the bNegative constant.
  • Date-format inconsistency: MES produces yyyy/MM/dd, U8 expects yyyy-MM-dd. A subtle cross-platform trap; Qeasy's TRANSFORM mapping auto-handles it.
  • Duplicate document numbers: MES allows the same number to be re-submitted; U8 raises a uniqueness error. Always dedupe on bill_no + bill_date before pushing and ensure global uniqueness of cCode.

When to Use

This interface is a must-have in MES-ERP integrated supply-chain scenarios — typically discrete manufacturers needing real-time inbound movements reflected in U8 for cost and inventory accounting. Out of scope: when the enterprise runs U8 Cloud or U9 (field names diverge), or when purchasing is fully initiated on the ERP side.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/engineering/hb-p6-071-4a57

Comments