Idempotency when you don't control the other end
Idempotency means repeating an API request does not repeat its effect: the operation is treated as already done instead of being performed again. It matters because clients sometimes need to retry after a timeout, when they cannot tell whether the first attempt succeeded. A common approach is to accept an Idempotency-Key header and store the response alongside that key. If the same key returns, the API sends back the stored response rather than doing the work again. In the article, this would prevent a repeated journal-entry request from creating another posting. That protection works only when the system receiving the request supports it. The writer says maesn can use this approach on its own API, but many accounting and ERP systems it calls do not offer a key. Their callers may then have to guess whether retrying will duplicate an entry or holding back will leave one missing.
What does idempotency mean for an API request?
Idempotency means repeating an API request does not repeat its effect: the operation is treated as already done instead of being performed again. It matters because clients sometimes need to retry after a timeout, when they cannot tell whether the first attempt succeeded.
A common approach is to accept an Idempotency-Key header and store the response alongside that key. If the same key returns, the API sends back the stored response rather than doing the work again. In the article, this would prevent a repeated journal-entry request from creating another posting.
That protection works only when the system receiving the request supports it. The writer says maesn can use this approach on its own API, but many accounting and ERP systems it calls do not offer a key. Their callers may then have to guess whether retrying will duplicate an entry or holding back will leave one missing.
How many external accounting and ERP systems does the unified API pass data to?
The unified API passes customer data to more than 30 accounting and ERP systems built by other companies. That number matters because maesn is not only responsible for its own API: it also calls systems whose behavior and retry protections it cannot control.
For example, the writer describes sending journal entries to accounting platforms, sometimes one at a time and sometimes in whole batches. If a batch upload succeeds but its response is lost, sending the same file again can create a second batch. In one test, both identical uploads returned success, with no hint from the API that the second was a copy.
The article says many of these external systems do not provide idempotency keys. That leaves the unified API caller to decide whether to retry without knowing what happened. Each system can also behave differently: some entries face an import review, while others are booked as soon as they arrive.
Why can a caller not tell whether an accounting entry was created when a request times out?
A timeout does not tell the caller whether the accounting system created an entry. The request might never have arrived, or it might have arrived and been processed while the response was lost on its way back. From the caller’s view, those two cases look identical.
The article describes this problem with journal entries. If a connection drops or a client gives up too early, the response is gone. The caller cannot inspect the accounting system’s database to confirm what happened. Retrying may book the entry twice; not retrying may leave it missing.
An idempotency key can resolve this uncertainty when the receiving system supports one: the caller repeats the same key and gets the original response. But many systems the writer works with provide no such key. In those cases, the caller has to use less reliable workarounds, such as searching for an existing entry, or make a decision with incomplete information.
What can happen when a caller retries a request that the accounting system cannot recognize as a duplicate?
When an accounting system cannot recognize a repeated request, a retry may create another entry instead of returning the original result. That matters because journal entries can become locked, and correcting them may require a new correction entry and an explanation later.
The writer tested this with a small batch file. The first upload succeeded, then the exact same file was uploaded again, and that upload also succeeded. The platform later showed notices for postings with the same amount, document number, and date, but the tax advisor could accept the copy into the books as a second batch.
Some systems have an import review where duplicate notices may appear; others book entries immediately, with no review or notice. Without an idempotency key, the caller may not know whether a retry is safe. A duplicate can therefore become a real second posting, while choosing not to retry risks leaving the original entry absent.
Why might matching a document number, amount, and date still fail to identify the exact entry?
A document number, amount, and date can narrow a search without proving that a found row is the exact entry the caller sent. This matters because a lookup that mistakes an older or unrelated entry for the new one can cause the caller to skip a posting that is actually missing.
Document numbers may be unique only within one supplier’s invoices, and suppliers can reuse numbers or restart numbering each January. Adding account, amount, and date helps, but the writer found two postings on the same account for 4,616.50. They might have been a duplicate export, or two identical assets bought and booked on the same day.
The article says nothing in those rows identified which explanation was correct; only the trial balance could. A search can therefore raise a useful warning without reliably proving a duplicate. The platform in the writer’s test showed a notice instead of rejecting the entry, leaving the final decision to the tax advisor.
How can two retries create duplicate entries even when each checks for an existing entry first?
The article does not describe two simultaneous retries, but a well-known check-then-submit race can produce duplicates: each caller checks before either submission is visible, both see no entry, and both send the posting. Without an idempotency key or a system-side safeguard, those requests can create two entries.
The article’s concrete example is a different weakness in the same lookup workaround. A caller searches by document number, then sends the entry if no match appears. But document numbers can be reused across suppliers or years, and adding account, amount, and date still cannot always distinguish separate postings from duplicates.
So checking first is not a guarantee. The writer’s test showed that duplicate batch uploads could both succeed, while some platforms only flag possible matches during import. A reliable prevention method would need the receiving system to recognize repeated requests, such as by supporting an idempotency key; many systems described do not.
Why can a networked system struggle to guarantee that a request happens exactly once when a response is lost?
A networked system can process a request and then lose the response before it reaches the caller. The caller sees a timeout, but that does not reveal whether the request never arrived or whether the work completed. The article describes those two cases as looking identical from the outside.
That uncertainty makes an exactly-once outcome difficult to guarantee through retries alone. If the caller sends the request again, the system may perform the work twice; if the caller holds back, the work may never happen. Journal entries make the stakes clear because duplicates can enter the books, while missing entries can leave records incomplete.
The article’s safer pattern is for the receiving API to accept an idempotency key, save the response, and return it when the same key is sent again. But many systems maesn calls do not provide this option. Without such support, a caller cannot reliably resolve a lost response just by deciding to retry or not.
This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.
Read more in the JupiteX app
Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.
Or read more news on the web