Idempotency when you don't control the other end
Idempotency, a seemingly straightforward concept, can become complex when dealing with systems outside of one's control. In the case of maesn, a company building a unified API that connects with 30+ accounting and ERP systems, idempotency keys are often absent. This forces callers to resort to workarounds like looking up existing entries based on document numbers, account, amount, and date.
However, these methods have their own flaws. Invoice numbers can be reused by different suppliers, and entries with the same details might still represent different transactions. The real challenge lies in timing. If a retry occurs before the initial request has been fully processed, duplicate entries may go unnoticed, causing discrepancies in financial records.
Platforms that do offer idempotency keys are more forgiving, allowing callers to safely resend requests without fear of creating duplicates. Yet, even these systems display a notice at the end, which is easily overlooked, leaving callers unaware of the duplicate. Consequently, callers must rely on these imperfect methods, hoping to minimize the risk of double-booked entries in the financial books.
Rewritten by urgent.news; may contain errors — check the original.
Source: stackoverflow.blog