Logo Codebaker
IT

How to Integrate Your Management System, E-commerce and Other Software Through Custom APIs

With a bespoke API layer acting as the meeting point between systems: one source of truth per entity, e-commerce → middleware → ERP → warehouse → courier, real time where it matters and batch where it is enough.

How to integrate an ERP, an e-commerce and other software via APIs

You integrate them by building a layer of custom APIs — a middleware — that acts as the meeting point between the systems instead of wiring them together in pairs. For each entity (customer, item, price list, stock, order) you establish which system holds the truth, you define the data contract, you develop the middleware that exposes REST or GraphQL APIs and propagates events via webhooks, you choose per flow between real time and batch, and you add queues, retries, idempotency and logs. The typical result is one single chain: e-commerce → API middleware → management system/ERP → warehouse → courier, with the same data travelling through every system without anyone retyping it.

The difference between an integration that holds and one that breaks every week is not the protocol you pick, but two decisions taken before any code is written: who holds the truth for each piece of data and what happens when something goes wrong. Anyone can write a flow that works on a good day; a production integration is one that notices by itself when it stops working. Codebaker, a software house based in Bologna and founded in 2019, designs integrations on exactly this basis — including towards management systems that expose no modern APIs.

api-middleware-between-erp-ecommerce-and-warehouse

yellow dot
architecture

A hub, not a spider web

The most natural way to start — wire the e-commerce straight to the management system, then the management system to the warehouse, then the e-commerce to the courier — is also the one that ages worst. With four systems connected in pairs there are six possible links, with five there are ten: every new sales channel multiplies the work, and every upgrade of one system risks breaking several flows at once. A central API layer flips the geometry: each system talks only to the middleware, which knows everyone's formats and translates. Adding a marketplace, a second courier or a CRM then means writing a single adapter, not rewriting the existing integrations. It is also where logs, alerts and reconciliation concentrate: one single place to look when an order has not arrived.

integrating-a-legacy-as400-system-with-no-apis

yellow dot
legacy

Even when the ERP has no APIs

«Our management system is old, it cannot be connected to anything» is the sentence we hear most often, and it is nearly always false. A system that exposes no REST APIs still exposes something: its data, callable native procedures, structured files, services that can be surfaced. The work consists in building an integration layer that talks to the system in the ways it does support and translates everything outward into clean, documented APIs. The legacy system is neither modified nor replaced: it keeps doing exactly what it has always done, while the rest of the company stops depending on its limits. At Conor this meant connecting a B2B e-commerce with native iOS and Android apps to an AS400 system, in real time, for more than 5,000 customers a day and over 300,000 orders a year.

The architecture in six steps

This is the journey an order takes in a well-designed integration, from the customer's click to the delivery notification.

yellow dot

1. The e-commerce captures the order

The customer orders while seeing their own price list and real availability, because prices and stock already arrive from the management system through the middleware. The order is created with a unique identifier.

yellow dot

2. The middleware validates and normalises

The API layer receives the order, checks the data against the business rules (credit limit, minimum order, blocked items), converts formats and queues it towards the management system.

yellow dot

3. The ERP registers the order

The order enters the system that holds the truth on customers and documents, exactly as if the back office had typed it in. No double data entry, no copy-pasting from an email.

yellow dot

4. The warehouse picks and confirms

The picking list reaches the handhelds or the shop-floor terminals; the quantities actually picked travel back, update stock and generate a partial order if something is missing.

yellow dot

5. The courier receives the shipment

The middleware calls the carrier's APIs, generates the labels and receives the tracking code, which is written both onto the document in the ERP and into the customer's private area.

yellow dot

6. Events travel back via webhooks

Delivery status, delivery notes and invoices climb back up the chain and become visible to the customer without anyone sending an email. Every step is traced, with logs and alerts on interrupted flows.

Every step rests on skills we cover in-house: from custom web APIs to custom e-commerce development, from payment gateway integration to legacy software modernisation.

What travels through the APIs, and how often

Before any technology talk, this has to be settled: for each entity, which system is in charge, in which direction the data travels and whether real time is genuinely needed.

EntitySource of truthDirectionRecommended frequency
Customer master dataManagement system / ERPERP → e-commerceFrequent batch, real time on credit limits
Item catalogueERP or PIMERP → e-commerceBatch (several times a day)
Price lists, including customer-specific onesManagement system / ERPERP → e-commerceReal time
Warehouse stockERP / WMSERP → e-commerceReal time
OrdersE-commerce (then ERP)E-commerce → ERPReal time
Delivery notes and invoicesManagement system / ERPERP → customer areaDaily batch
Delivery statusCourierCourier → middleware → ERP and customerWebhook, as soon as available
Returns and credit notesManagement system / ERPTwo-wayBatch, with reconciliation

The rule of thumb: real time on whatever blocks a sale (price, availability, credit limit, order), batch on everything else. Demanding real time everywhere raises cost and fragility without adding value.

Custom APIs, standard connectors, iPaaS or files: the comparison

All four routes are legitimate, but they hold under different conditions. Here is how they behave on the criteria that matter once the integration is in production.

CriterionCSV/EDI files over FTPStandard connectors / iPaaSPoint-to-point APIsBespoke middleware (Codebaker)
Initial costLowLow-mediumMediumMedium-high, but reusable
Recurring costAlmost noneFee by volume or connectorMaintenance onlyMaintenance only, no subscription
Real timeNoPartialYesYes, where it genuinely matters
Error handlingManual, after the factWhatever the product providesTo implement for every pairCentralised: queues, retries, idempotency, alerts
Unusual business rulesHardOnly if the connector foresaw themYes, but duplicated on every flowYes, in a single place
Legacy systems with no APIsOften the only quick routeRarely supportedComplexYes: a dedicated layer, as on AS400
Scaling to new systemsLowGood if the connector existsLow: links grow exponentiallyHigh: one adapter per new system
Ownership and lock-inNo lock-inDependency on the platformYour codeYour code, standard and open technologies

The five mistakes that make an integration fail

1. Not deciding who holds the truth

If the customer record can be edited both in the e-commerce and in the management system, sooner or later the two versions drift apart and nobody knows which one is right. For every entity, exactly one source system must be designated; the others read. It is the cheapest decision to take at the start and the most expensive to repair afterwards.

2. Treating integration as the last task

When integration is postponed to the end of the project, acceptance testing reveals that an indispensable field does not exist in the source system, or that a business rule makes the planned flow impossible. It is the single most frequent cause of overrun in the projects we inherit. The data contract must be written before either end is developed.

3. Designing only the happy path

The complete order that leaves, arrives and gets delivered is ten per cent of the work. The rest is the edge cases: partial order, item out of stock after confirmation, order amendment, return, customer blocked for exceeding their credit limit, price changed between basket and confirmation. If they are not defined during analysis, the code will define them at random.

4. No error handling, retries or idempotency

Systems are not always reachable and messages sometimes arrive twice. Without queues and retries, two minutes of unavailability become a lost order; without idempotency, a repeated webhook becomes a duplicated order. Both are cheap to design in and very expensive to add after the first incident.

5. No monitoring in production

An integration that stops silently is worse than one that does not exist, because the company keeps trusting the data. You need searchable logs, an error dashboard and an alert that reaches somebody: an interrupted flow must be discovered by the system, not by the customer phoning in.

Integrations in production: the numbers

Frequently asked questions on API integration

How do I integrate my management system, e-commerce and other software through custom APIs?

You integrate them by building a layer of custom APIs — a middleware — that acts as the meeting point between the systems instead of wiring them together in pairs. The path has five moves: first, decide for each entity (customer, item, price list, stock, order) which system holds the truth, so there are never two versions of the same data; second, write the data contract, meaning which fields travel, in which format and under which validation rules; third, develop the middleware that exposes REST or GraphQL APIs, normalises the formats and propagates events via webhooks; fourth, choose for each flow whether real time is genuinely needed or a periodic batch is enough; fifth, add queues, retries, idempotency and logs, because a serious integration is not one that works, it is one that notices when it stops working. The typical result is the chain e-commerce → API middleware → management system/ERP → warehouse → courier, with a single piece of data travelling through every system without anyone retyping it.

Which data is typically exchanged between an e-commerce and a management system?

There are six recurring entities. From the management system towards the e-commerce travel customer master data with credit limits and terms, the item catalogue with descriptions and attributes, price lists (often customer-specific in B2B) and warehouse stock. From the e-commerce towards the management system travel the orders and, downstream, delivery notes and invoices come back for the customer to consult. The sixth entity is the delivery status, which arrives from the courier and must be visible both in the management system and in the customer's private area. In B2B, stock levels and customer-specific price lists are usually the flows that genuinely require real time, because a wrong price or an out-of-date availability generates an order that has to be cancelled.

My management system is old and has no APIs: can it still be integrated?

Yes, and it is one of the cases we handle most often. When the management system exposes no modern APIs, we build a dedicated integration layer that talks to it in the ways it does support — direct data access, native procedures, structured files, services exposed by the middleware — and translates all of it outward into clean REST APIs. The management system is neither modified nor replaced: it keeps working exactly as before, while the rest of the world talks to the layer. That is precisely what we did at Conor, where a B2B e-commerce with native iOS and Android apps and a web version synchronises in real time with an AS400 system, handling more than 300,000 orders a year and 5,000 customers a day.

Custom APIs, standard connectors or file exchange: which is better?

It depends on how standard your flows are. File exchange (CSV or EDI over FTP) is cheap and still holds up well for batch flows towards external partners, but gives you neither real time nor fine-grained error handling. Standard connectors and iPaaS platforms work well when both systems are widely used products and the fields line up, but they become expensive and brittle as soon as unusual transformations are needed; they also introduce a subscription and a dependency on the platform vendor. Custom APIs have a higher initial cost, but they cover any business rule, remain your property and are the only route when one of the systems is legacy or when the integration logic is itself part of your competitive advantage. In practice many companies use a mix: custom APIs for the critical flows, batch files for the marginal ones.

Do I really need real-time synchronisation on all data?

No, and demanding it is one of the most common ways to inflate the cost of an integration with no benefit. Real time is needed where stale data produces an immediate commercial error: stock levels, customer-specific price lists, credit limits, order status. For full master data, history, statistics and accounting reconciliation, a periodic alignment is more than enough, and it is also more robust because it tolerates a system being temporarily unavailable. The rule of thumb we apply is: real time on whatever blocks a sale, batch on everything else.

How much does it cost to integrate an ERP and an e-commerce via APIs?

A bounded integration on a few flows towards a system that already exposes documented APIs typically falls in the €5,000-15,000 band; a complete integration layer between e-commerce, management system, warehouse and couriers, with error handling and reconciliation, falls in the €15,000-50,000 band; architectures spanning several systems, several sites or high volumes go beyond €50,000. The variable that moves the price most is not the number of entities but the quality of the available interfaces: connecting to an ERP with documented REST APIs costs a fraction of building a layer towards a system that has none.

Which mistakes make an integration project fail?

Five, in our experience. First: not deciding which system holds the truth for each entity, and ending up with two customer records that drift apart. Second: treating integration as the last task of the project rather than an architectural requirement, only to discover at acceptance testing that an indispensable field does not exist. Third: ignoring the edge cases — partial orders, returns, changes after confirmation, blocked customers — which are the majority of the real work. Fourth: providing no error handling, retries or idempotency, so a lost webhook becomes a lost order and nobody notices for days. Fifth: not monitoring the flows in production, which is like having a fire alarm with no siren.

How do you stop an order from being lost or duplicated?

With three standard mechanisms we design in from the start. Idempotency: every message carries a unique identifier, so if it is sent twice the receiving system recognises it and does not create a second order. Queues with retries: if the management system is momentarily unreachable, the message is not discarded but retried at increasing intervals until it succeeds. Reconciliation: a periodic check compares totals across systems and flags discrepancies. On top of these sits monitoring with alerting, because an interrupted flow must be discovered by the system, not by the customer phoning in.

Who owns the APIs you develop?

The client. The integration layer, the code and the documentation belong to the company, built on standard, open technologies. This is a substantial difference from subscription connectors: if tomorrow you change e-commerce platform or want to connect a second sales channel, the middleware is already there and it is yours, and the APIs talking to the management system do not have to be rebuilt. It is also why an integration investment, done well, amortises across the next project instead of starting from zero.

Let's get your systems talking

Tell us which systems you run today — management software, e-commerce, CRM, warehouse, couriers — and where somebody is still retyping data by hand. We will map the flows, tell you what genuinely needs real time and which integration is worth doing first. The preliminary analysis and the quote are free.