Skip to content
← All articles
7 min read

System integration via API: webhooks, queues and retries

Connecting two systems is easy on a good day. The work is in the bad days: the other side is down, a request arrives twice, a field changes its format. This article describes how we design integrations so that failures are visible and recoverable.

Describe the data flow first

Before writing code, answer on paper: which system is the source of truth for each piece of data, what event triggers the exchange, which direction the data travels and how quickly it must arrive. Most integration bugs come from two systems each believing they own the same field.

Polling or webhooks

With polling you ask the other system for changes on a schedule: simple and predictable, but delayed and wasteful. With webhooks the other system calls you when something happens: fast, but you must be able to receive requests at any time and cope with ones you missed.

A robust setup often uses both: webhooks for speed and a periodic reconciliation job that catches anything that was lost.

Make operations idempotent

Networks retry, and so will you. If the same event arrives twice, the result must be the same as if it arrived once. Store the external event or request identifier and ignore repeats, or design updates as “set the state to X” instead of “add one”. Without this, retries turn into duplicate orders and double payments.

Put a queue between systems

Do not make the user wait for a slow third-party API. Accept the event, store it, answer quickly and process it in the background through a queue. A queue also smooths bursts, lets you pause processing when the other side is down and gives you a place to see what is waiting.

Retries, limits and failures

Retry temporary errors with growing delays; do not retry errors that will never succeed, such as invalid data. Respect the rate limits of the other API. Events that keep failing should land in a separate place where a person can inspect and re-run them, so that one bad record does not block everything behind it.

Security and observability

Verify webhook signatures or secrets, keep API keys out of the code and give each integration only the permissions it needs. Log every exchange with an identifier, and alert on growing queues and repeated errors. An integration nobody watches fails silently, and customers notice before you do. A detailed CRM and ERP case is in CRM and ERP integration.

Questions

FAQ

Didn't find an answer — ask on the call or in Telegram.

What if the other system has no API?

Options exist: file exchange, database access where permitted, or a documented import and export. What is possible is confirmed after inspecting the system and its terms of use.

How do you test an integration?

Against the other side’s test environment where one exists, and with recorded sample requests and simulated failures where it does not. The failure cases matter as much as the normal path.

Can you take over an existing integration that breaks?

Yes. We start by finding where it loses or duplicates data, add logging and then stabilize it, rewriting only the parts that cannot be fixed.

Related service

CRM, ERP and API integrations built for your workflows

When teams copy data between systems by hand, delays and mistakes become part of the process. We automate the exchange and make its status visible to the people running it.

Learn about the service
Other articles
Contact

Shall we discuss your task?

Thirty minutes on a call — and you understand the architecture, timeline and engagement format. No obligations.

Or message us on Telegram →Follow our Telegram channel →

Enter your Telegram or email so we can reply.

We reply within 15 minutes.