Menu

1 / 2

Idempotency when you don't control the other end

#stackoverflow#entry#entries#request#back
Long article (2045 words) — no AI summary yet.
Reading 0:00
15s threshold

Idempotency looks like a solved problem. If you build the API, you accept an Idempotency-Key header, store it with the response, and when the same key comes back you return the stored response instead of doing the work again. Stripe explained this years ago, and most of us have copied it at some point.

The catch is that I sit on both sides. I work at maesn , where we build a unified API: our customers call us, and we pass their data on to 30+ accounting and ERP systems that other companies built. On our own API we can do what Stripe does. On the other side, we are the caller. When a request to one of those systems times out, I can't look into their database. I have to decide whether to send it again without knowing what happened, and many of those systems give me no key to make that safe.

Most of my work is bookkeeping: getting journal entries into accounting systems. Many of those APIs accept entries one at a time, and many also take whole batches.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.