← BACK TO THE BLOG

API integration: the hard part isn't the call, it's not breaking

Open laptop on a desk showing lines of code on the screen

Almost every data or AI project that comes through our door ends up in the same place: information has to move from one system to another and nobody is sure how. API integration is the default answer, and often the right one. But between "the ERP has an API" and "the data lands correctly every morning at six" there is a gap that gets paid for in project months and in calls from a customer who has been invoiced twice.

The hard part of an integration is not making the first call. That takes an afternoon. The hard part is what happens the day the destination system is down, the day the vendor changes a field without warning, and the day the same order comes in three times because someone retried.

This guide is about exactly that: what the real options are, when something far simpler than an API is enough, and the three or four technical details — retries, idempotency, ordering, traceability — that separate an integration lasting years from one somebody has to babysit every Monday.

What is an API integration and how does it differ from a webhook?

An API is a door a system opens so others can ask it for things or send it things. You ask, it answers. You hold the control: you decide when to call and what to request.

A webhook is the opposite: the source system notifies you when something happens. You publish an address, it sends you a message every time an order is created or a status changes. Control sits with whoever does the notifying.

The practical difference is not technical, it is operational:

The rule we apply: webhook to find out fast, API to reconcile. The webhook triggers the immediate reaction; a periodic query at the end of the day checks nothing is missing. Running webhooks alone and trusting they always arrive is the number one cause of silent gaps in data.

Every webhook integration needs a backup query. Without one you don't know what you've lost — you only know what you've received.

When is a file enough and when do you actually need an API?

Unpopular opinion: a fair share of the integrations we are asked to build do not need an API. They need a CSV in a folder at 03:00. And that is fine.

The right question is not "which is more modern?" but how long it takes the business to notice the data isn't there and what happens if it arrives an hour late. If the answer is "nothing", a well-built file drop is cheaper, easier to audit, and understandable by the admin who will look at it when it fails.

| Mechanism | Typical latency | Where it fits | Cost to maintain | |---|---|---|---| | Scheduled file (CSV/XML) | Hours | Bulk dumps, accounting, product masters | Low | | API polling | Minutes | Syncing orders, stock, customers between systems | Medium | | Webhook (real-time push) | Seconds | Alerting an operator, triggering a flow, payment gateway | Medium-high | | Message queue | Seconds | High volume, several consumers, spikes | High | | Shared database | Immediate | Almost never: couples two systems for life | Trap |

That last row deserves a warning. Reading another product's database directly is tempting — no need to ask anyone's permission — and it is the most expensive technical debt there is: the day the vendor changes the schema in an update, your integration breaks without anyone having touched it. If the database really is the only route, at least read from a view or a replica, never from production tables.

Which integration pattern should you use for each case?

Three patterns cover 90% of what a mid-sized company needs.

1. Master-replica sync. One system owns a piece of data and the others copy it. The customer is born in the CRM and is replicated to the ERP, or the other way round, but never both. It is the most boring pattern and the one that causes the fewest problems. It requires a business decision up front: who is the source of truth for each entity. If that decision has not been made, what you are about to build is not an integration, it is a conflict generator. We cover it in depth in the guide to integrating ERP and CRM.

2. Event-triggered process. Something happens — a quote is signed, an order comes in — and that kicks off a chain: create the record, notify, generate the document. Webhooks shine here, but every step has to be repeatable without damage.

3. Query on demand. You copy nothing: when someone opens the record, you ask the other system for fresh data. It avoids duplicates and drift, but makes you dependent on the other system being up and answering fast. Use it for data that changes a lot and is consulted rarely (available balance, exact stock), not for listings.

A fourth pattern shows up once there are more than three systems: the bus or middle layer. Instead of wiring everything to everything — six systems means fifteen possible connections — everything talks to one central point. It pays off from four or five systems upwards; below that, you are building a monster to solve a problem you don't have yet.

Retries, idempotency and ordering: the three that break integrations

This is where nearly all the real work sits.

Retries. Networks fail. The destination system goes down for ten minutes for an update. If your integration gives up on the first error, someone will have to fish the records out by hand. The standard practice is to retry with increasing backoff: 1 minute, 5, 15, 60, then push the message to a dead-letter queue a person reviews. What matters is not the number of retries: it is that the queue exists and that someone looks at it. An integration without a failure queue loses data silently.

Idempotency. If you retry, the same message can arrive twice. If the receiver creates an order every time it receives one, you have just duplicated the invoicing. Idempotent means processing the same message five times leaves the system exactly as processing it once. The practical approach: each message carries a unique identifier (the source order number, not one you generate) and the receiver stores the ones it has already seen. If it comes back, it is ignored and answered with "ok". It is half an afternoon of work and it prevents 80% of serious incidents.

Ordering. If "order created" and "order cancelled" arrive the wrong way round, you end up with a cancelled order coming back to life. Two fixes: process serially per entity (all events for order 1234 on the same thread) or carry a version number and discard whatever arrives late. The second is more robust and requires the source to provide it; if it doesn't, ask for the timestamp of the change, not of the send.

A fourth detail nobody mentions until it hurts: rate limits. Almost every commercial API caps requests per minute. If your initial load is 200,000 records and the API allows 60 calls a minute, the migration takes two days. That needs to be known before promising a date, not during go-live weekend.

How do you authenticate and secure an integration?

The bare minimum, without ceremony:

If personal data flows through the integration, the same rules apply as to any other processing: legal basis, minimisation and a record of where each thing goes. The guide to data governance covers who answers for each field.

What should you monitor to find out before the customer does?

A silent integration is not a healthy integration: it is one you can't tell is working. Four signals are enough to sleep well.

1. Heartbeats. If the process runs hourly and three hours have passed without a run, someone has to know. A process that gives no signal is worse than one that fails loudly. 2. Error rate per leg. Not "the integration is fine", but how many messages came in, how many were processed, and how many landed in the failure queue. 3. Accumulated lag. If the queue grows and never drains, there is a bottleneck even with zero errors. 4. Total reconciliation. Once a day: how many orders are in the source and how many in the destination for the same date? That is the check that catches gaps no runtime error reveals.

And one rule of coexistence: the alert has to reach a person with a name, not a shared inbox. If "the team" receives the alert, nobody does.

What should you demand before signing off an integration with a vendor?

Before committing to dates, ask in writing for:

If the answer to any of these is "we'll see", add a month to the schedule. That is not pessimism, it is experience: the timeline of an integration is not set by your code, it is set by the slower of the two systems.

Frequently asked questions

How long does an API integration take to build?

A simple one-way integration between two systems with documented APIs takes two or three weeks, testing included. What stretches the timeline is data mapping (which field here is which field there, and what to do with the ones that don't match) and permissions on the vendor's side, which often take longer than the development itself.

Is a no-code tool better than custom development?

For simple flows and low volume, a visual automation tool is faster and cheaper to maintain. When there are complex transformations, high volumes or traceability requirements, custom development ends up cheaper. The test: if you have to fight the tool more than twice to do something that is ten lines in code, change the tool.

What if the other system has no API?

There are more options than it seems: scheduled file exports, access to a database replica, or interface automation as a last resort. That last one is fragile — any screen change breaks it — and is only justified as a temporary bridge while a stable route is negotiated.

How often should you poll an API to keep systems in sync?

It is set by the business tolerance for delay, not by technical capacity. If nobody notices a fifteen-minute lag, polling every fifteen minutes is enough and saves you rate-limit trouble. Polling every minute "just in case" multiplies cost and blocking risk without anyone noticing the difference.

---

A well-built integration is invisible: the data shows up where it should and nobody talks about it. If someone in your company exports a spreadsheet every Monday to paste it into another system, there is a process there waiting to be looked at properly. In the audit we review the systems you have, what connects to what today, and which of those connections deserves to be built first; if you already know which one, let's talk about the specific case.

Shall we apply it to your case?

The 360° AI Audit turns these ideas into a concrete plan for your company: three weeks, fixed price and the full picture of your AI before spending a euro.

See the 360° Audit→ Let's talk↗