Yonyou U8 Purchase Receipt API Field Handbook: Cross-Solution Aggregation Tutorial
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_dateormodify_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
| Field | Type | Meaning | Practical Notes |
|---|---|---|---|
| bill_no | string | MES receipt number | Recommend a business prefix (e.g. RK_) to avoid clashes with manually keyed U8 numbers |
| bill_date | date | Receipt date | Must align with U8 accounting period; cross-period documents need special handling |
| purchase_order_no | string | Source PO number | Must already exist in U8, otherwise U8 will reject |
| supplier_code | string | Supplier code | Driven by a supplier mapping table; reconcile code conventions early |
| warehouse_code | string | Inbound warehouse code | Warehouse master must be synced before this document |
| dept_code | string | Business department code | Departments must be synced before warehouses |
| cPOCode | string | U8 source-document field | Must equal purchase_order_no, linking back to the PO |
| bNegative | int | Red/blue flag | 1 for returns/undo-receipts, 0 for normal receipts |
| material_code | string | Inventory code | Depends on completion of material master sync |
| quantity | decimal | Receipt quantity | Compare against the PO line's open quantity to prevent over-receipt |
| iPORowNo | int | Source-line number | Must exactly match the PO detail-line number |
| iPrice / iMoney | decimal | Unit price / amount | Tax-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
- 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.
- 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.
- 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.
- 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. - Choose incremental fields carefully:
modify_timeis affected by edits, whilebill_dateis the stable incremental key. If MES exposes an audit log, prefer that timestamp. - 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
bNegativeconstant. - Date-format inconsistency: MES produces
yyyy/MM/dd, U8 expectsyyyy-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_datebefore pushing and ensure global uniqueness ofcCode.
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.