In brief
ERP integration works well when it uses the interfaces the system vendor provides, has agreed master data, and tolerates repeated messages. There are four patterns to choose from: file exchange, API calls, asynchronous messages, and events. Most problems come not from the technology but from the data: different item codes, units of measure, statuses, and no single owner of the master records. The most dangerous antipattern is writing directly to ERP tables.
Four ERP integration patterns
An ERP is usually the system that posts, settles, and plans, so every other system wants to send something to it or read something from it. The online store sends orders, the warehouse system confirms shipments, the MES reports production, the bank returns statements.
| Pattern | How it works | When it fits | Risk |
|---|---|---|---|
| File exchange | export and import of CSV, XML, or EDI files at set times | large batches once a day, external partners, legacy systems | latency, partially loaded files |
| API calls | a system calls an ERP service and waits for the response | checking item availability, a customer's price | dependence on real-time ERP availability |
| Asynchronous messages | a message goes to a queue, and the ERP processes it at its own pace | orders, shipment confirmations, documents | duplicates, ordering, the error queue |
| Events from the ERP | the ERP publishes changes, for example through CDC or a vendor mechanism | distributing changes in prices, stock levels, and statuses to many systems | technical changes instead of business facts |
In SAP, the equivalents of these patterns include IDoc for messages, BAPI and RFC for function calls, and OData services for APIs. Other ERP systems have their own interfaces, but the division stays the same. In practice one company uses several patterns at once, and the layer that organizes them is sometimes an integration bus or an event platform, which we compare in the article ESB or event-driven architecture.
Master data: everything else depends on it
Most ERP integration errors are really master data errors: records for items, customers, suppliers, units of measure, and price lists. An order from the store will not get into the ERP if the item has a different code in the store or the customer has no record.
Before building the integration, you need to settle:
- which system is the source of truth for each master record and who can change it;
- how identifiers map between systems and where that map is stored;
- how to convert units, for example pieces in the store, cartons in the warehouse, pallets at the carrier;
- what the status dictionaries look like, because “shipped” in the store and “closed” in the ERP are often different things.
A shared data model for the integration, called canonical, reduces the number of mappings: each system translates its data into one format, instead of having a separate map to every other system.
Pitfalls that return in every project
The same mistakes appear in ERP integrations in retail, manufacturing, and finance:
- Writing directly to ERP tables. Quick at the start, but it bypasses business logic, validations, and posting, and it stops working when the system is upgraded. ERP vendors usually do not support this kind of integration.
- No idempotency. A message resent after a timeout creates a second order or a second invoice. Every document must carry an identifier from the source system, and the ERP or the integration layer rejects duplicates.
- No ordering. An order correction arrives before the order itself. A queue keyed by document, or a layer that holds the message until the parent document appears, helps.
- Time zones and posting dates. An order placed at 23:30 in another time zone lands on a different day and in a different accounting period.
- ERP limits and windows. The ERP processes nightly batch jobs and month-end close; an integration that sends thousands of calls during that time slows down the whole system.
- ERP customizations. Custom fields and extensions that the integration does not know about break the mappings after every change.
Error handling and reconciliation
A message that the ERP did not accept must neither disappear nor block the whole flow. A proven setup is a dead letter queue with a description of the cause, a view for a business user who can fix the data and resend the message, and an alert when the queue grows.
The second line of defense is reconciliation. Every day you compare the count and total of documents on both sides: orders in the store against orders in the ERP, warehouse shipments against delivery notes, bank statements against settled payments. A difference means a lost or duplicated document, before a customer or accounting notices it.
Part of this work, for example retyping orders from emails and PDF files into the ERP or explaining rejected documents, can be taken over by AI Workers, which we write about in the article AI Workers and ERP.
Testing ERP integrations
ERP integrations most often break after changes, not at the first deployment: after an ERP upgrade, a configuration change, a new field in the store. That is why you need:
- an ERP test environment with a configuration matching production and master data close to production;
- a regression test suite for every flow: valid document, duplicate, missing master record, correction, cancellation;
- performance tests for batch flows, for example the nightly order import or month-end close;
- tests after every ERP upgrade, before the change reaches production.
An example of an integration in which the ERP, the warehouse, and multichannel sales had to speak the same language is described in the scenario integrating an online store with marketplaces and a warehouse system. Deploying a new ERP at a plant is shown in the scenario SAP S/4HANA deployment in manufacturing and plant intralogistics.
Questions and answers
Should you integrate with an ERP through an API or through files?
It depends on what the flow needs. An API fits questions that need an answer immediately, such as item availability. Asynchronous messages handle documents better, because they do not depend on the ERP being available at a given moment. Files remain a reasonable choice for large batches once a day and for partners that have no other option.
When you replace an ERP, do you have to rebuild all the integrations?
Some of them, certainly, because the interfaces and the data model change. An integration layer with a canonical model limits the cost: external systems talk to that layer rather than directly to the ERP, so on replacement you rewire the mappings on one side. Without such a layer, every integration needs a change in both systems.
Who should be responsible for ERP integrations?
Technically, the integration or platform team, which maintains the flows, monitoring, and error queues. The process owners are responsible for the data and business rules: sales for orders, logistics for shipments, finance for postings. Without an owner on the business side, faulty messages wait in the queue because nobody knows who should decide on the fix.
How do you integrate an ERP running on IBM i?
The same way as other systems: through a layer that exposes the ERP logic as an API or messages, rather than writing to database files from outside. IBM i has its own mechanisms for this, from web services to data queues. The options are described in the article IBM i and modern applications.