When an integration retries, the order arrives twice

An integration creates the same record twice because a timeout does not say whether the first send worked. The source system tries again, and the destination cannot tell it is the same order. The way out is to give every operation a unique identifier and to decide, in the design, what happens when it arrives again.
Why does an integration duplicate the order?
Because the network does not deliver certainty. When the sales system sends an order to the ERP and no response returns, two worlds are possible: the order never arrived, or it arrived and the confirmation got lost. From the sender's side, the two look identical.
Malcolm Featonby's article in the Amazon Builders' Library describes this exact standoff. When a call that creates a resource times out, retrying can produce two resources where one was intended, with consequences the author calls dire. Waiting does not settle it, because the doubt remains. Giving up does not either, because sometimes the order really never arrived.
Retrying is the sensible choice in most cases, which is why integrations retry on their own. The problem is not the attempt. It is the destination, which treats the second arrival as a new order.
What does the technical documentation propose?
An identifier generated by the sender, unique per operation. Amazon calls it a client request identifier: requests from the same caller with the same identifier are treated as the same operation. On the second arrival, the destination creates nothing. It returns a response equivalent to the first, so the sender moves on as if it had received the confirmation the first time.
Stripe's documentation describes the same mechanism for its payments API. With an idempotency key, the client can repeat the call after a connection failure without creating a second object. Stripe stores the status code and body of the first response and returns them on repeats. If the same key arrives with different parameters, the API refuses, to prevent misuse.
There is one piece the Amazon text makes explicit: recording the identifier and executing the operation must happen together, or not at all. If the identifier is saved and the operation fails, the retry is ignored and the order never exists.
The subject is moving toward standardization. A draft from the IETF HTTPAPI working group, draft-ietf-httpapi-idempotency-key-header (revision 08, dated October 22, 2026), proposes a standard header for this identifier. As of this revision, it is not a published standard, and it is best read as a sign that the practice is common enough to deserve one.
Which decisions does the design have to make?
Three, and none of them is about tooling.
The first is where the identifier is born. It must be created once, in the system that originates the operation, and reused on every attempt. If each attempt generates a new identifier, the destination never recognizes the repeat.
The second is how long the destination remembers. Stripe states that, in version 1 of its API, keys may be removed after at least 24 hours. That number is Stripe's, not a rule. What matters for your operation is the question: what is the longest plausible delay between the first attempt and the last? A queue that sits idle over a weekend needs a longer memory than a web form.
The third is what the destination answers to the repeat. The right answer is not "this order already exists", which the sender would read as a failure. It is the result of the first send, identical to what it would have received.
What does this look like in a mid-sized company?
The example below is a hypothesis to illustrate, not a measured case. A distributor has a sales system and an ERP connected by an integration. At month end the ERP slows down, and some writes take longer than the wait limit. The sales system gets no confirmation and sends again.
In some of those cases, the first send had already been saved. The ERP now holds two identical orders. Inventory picks twice and finance sees two entries. The customer may receive two charges or two deliveries. Nobody sees the error at the time, because each system, on its own, worked. Whoever finds it is the person who reconciles at the end of the week, comparing line by line.
With the identifier, the second send reaches the ERP, which recognizes the operation and returns the result of the first. Nothing is created. The sales system keeps the confirmation it was waiting for. The cost sits in the initial design, and the gain shows up as an absence of work: reconciliation stops hunting for duplicates.
In operations that sync later, such as Reatop, which records hospital waste in the field, offline, syncing afterwards, resending is part of the routine. There, the question about repeats is worth asking from the first day of the project.
How does the board see the result?
Through what the operation stops doing. I did not find a reliable public indicator for how often integrations duplicate records in mid-sized companies, and this article will not invent one. The number that matters is yours, and it comes from a simple count in your own operation.
Count, per month, how many duplicate records the operation finds and corrects, how long each correction takes and who does it. That is the current cost. After the change, the same count shows whether the design works. If the count does not drop, the identifier is not being reused across attempts, and that is a useful finding.
This reasoning is a relative of your automation stopped, when will you find out: the failure that makes no noise tends to be the one that takes longest to surface. And the list of five failures that break internal system integrations helps show where else the link between systems tends to give way.
Frequently asked questions
How do I measure the result, if what changes is something that stops happening?
By counting duplicates before and after. Duplicate records found per month, time spent correcting each one, and who corrects them. If the count shows hours of reconciliation every week, that is the cost the project needs to remove, and the comparison lives inside your own operation.
Will this take a lot of my team's time to implement?
The costliest effort is design: deciding where the identifier is born, how long the destination remembers and what it answers to a repeat. It is a conversation between the people who operate and the people who build, and its length depends on how many integrations exist. The cost grows when the decision is postponed, because the fix then has to pass through records that already exist.
What if the system on the other side does not accept an identifier? Doesn't that leave the bottleneck in place?
It depends on the system. When the destination does not recognize the identifier, the check can happen at the source: query whether the order already exists before sending again. It is slower and more fragile, but it is a barrier. Knowing the destination offers no such guarantee already changes the buying and integration decision.
The next step
If today nobody can say how many of your integrations resend on their own and what each one does with the repeat, the Operational Architecture Diagnostic is a 30-minute conversation to map that. Talk to an architect.
Read next
Related case studies

Did you recognize your operation in this article?
Book the Operational Architecture Diagnostic: 30 minutes to map where your operation's bottleneck is. No proposal in the first conversation.
Book a diagnostic