Case study · 2023 · Integration · Partner messages
Webhook Gateway
The story of a small gateway that became critical overnight, and of how we rebuilt it without anyone noticing.
01 A gateway that became critical
It all started with our business applications. They are thick clients, installed at each of our customers, and they were never designed to receive anything from the web. So in 2023, we built a small gateway that receives partner messages and keeps them ready for each application. For three years, it did its job quietly, until the French e-invoicing reform came into view. Our gateway could already serve several clients, as long as each provider sorted its own sends client by client. Our invoicing provider, however, sent everything in one batch, so we could no longer tell who each message belonged to.
the workaround
02 Fix it or rewrite it
Before deciding, I asked the team to check a single point, namely whether we could receive those mixed messages and sort them ourselves. We could. Opening the code, though, the verdict was clear, because that sorting touched the core of the system and the old API had other weaknesses piling up. Fixing it meant rewriting it, and if we were going to rewrite it, we might as well do it properly.
Sorting by client left to each provider
A rules engine that sorts every message
A message received twice, stored twice
Received twice, stored only once
An unrecognised message, simply rejected
A quarantine, an alert, and someone who decides
A separate API and interface, 25 dependencies
One application, 10 dependencies
03 Choosing the tool for the problem
Our instinct would have been to stay on NestJS, which the team knows best. Yet for a service this simple, it meant a separate API and interface, with many parts to maintain, when we wanted exactly the opposite, a single application needing as little maintenance as possible. Since part of the team already knew PHP, the choice was between Symfony and Laravel, and rather than argue, we tried both.
Symfony or Laravel?
Symfony
The framework of the very first One Record API, widely used in France.
Laravel
The admin, the MCP server for agents, audit and roles, all as official packages. And our agents wrote reliable code in it far faster.
the trial decided04 Proving it before cutting over
Management backed us, because the rewrite promised simpler code, tested from its design and safer, without existing applications having to change anything. Thanks to our orchestrator, the writing went fast. The real work was then proving the new gateway behaved exactly like the old one, which is why the two ran side by side for six weeks, long enough to compare every message before e-invoicing went live.
zero difference in 6 weeks
05 And today
On the day, switching the traffic was enough, and nobody noticed. Since then, a message that matches no rule goes to quarantine instead of disappearing, and support handles it from an AI agent, with limited rights and actions announced by code before they are confirmed. Above all, the gateway has become so simple to run that it saves us a considerable amount of time. Adding a client, plugging in a partner or adjusting a rule now goes very fast, often straight from an agent through the MCP tools. And changing the product carries no fear, because everything is tested and contract tests check that nothing breaks for the applications that depend on it.
~600kmessages a month
What I would do differently
On the rewrite, I would honestly do the same again, because it is a modest-sized product and we made very few mistakes. It is the first version I would redo. It lacked a proper analysis at the start, tests designed in from the beginning and the guardrails we only added in the rewrite. It held for three years, but it should have been built to last from day one.