---
title: "Idempotency when you don't control the other end"
description: "When an accounting or ERP API offers no idempotency key, a timed-out write leaves the caller unable to tell whether entries were booked, and the usual workarounds each fail in practice."
url: "https://swe.quest/articles/idempotency-when-you-don-t-control-the-other-end-087a9556ed7e0055"
canonical: "https://stackoverflow.blog/2026/11/24/idempotency-when-you-don-t-control-the-other-end/"
source: "Stack Overflow Blog"
published: "2026-11-24"
difficulty: "medium"
kind: "Opinion"
reading_minutes: 10
tags: ["api-design","resilience","distributed-systems","payments"]
---

# Idempotency when you don't control the other end

A post on [Stack Overflow Blog](https://swe.quest/sources/stack-overflow.md), published 2026-11-24, 10 min read, Opinion. Original: [https://stackoverflow.blog/2026/11/24/idempotency-when-you-don-t-control-the-other-end/](https://stackoverflow.blog/2026/11/24/idempotency-when-you-don-t-control-the-other-end/)

## Summary

When an accounting or ERP API offers no idempotency key, a timed-out write leaves the caller unable to tell whether entries were booked, and the usual workarounds each fail in practice. Lookup by document number matches the wrong entry, because invoice numbers collide across suppliers and years. Check-before-write races against your own retries and against lagging search indexes, and it halves your rate-limit budget. After-the-fact cleanup means reversal entries that can themselves duplicate and that run into locked periods and filed VAT returns. The recommended fix sits with the provider: a proper idempotency key (409 for in-flight, 422 for a mismatched body, failed requests leave the key free) or at minimum a unique caller-reference field that returns 409 with the existing entry.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Payments & fintech](https://swe.quest/tags/payments.md) (Domains)

## Prerequisites

- HTTP status codes
- REST API retries and timeouts ([easy posts on API design](https://swe.quest/tags/api-design.md?difficulty=easy))

## Keywords

Idempotency-Key, Stripe, maesn

## Related posts

- [10 Tips for Building Resilient Payment Systems](https://swe.quest/articles/10-tips-for-building-resilient-payment-systems-94c9ade99576742c.md): Shopify Engineering · 2022-07-28 · Medium · 13 min read · Payments & fintech, Resilience, Observability, Incidents & postmortems, Ruby
  Ten lessons from Shopify's payment infrastructure for keeping payment systems reliable at scale.
- [Skipper, Airbnb’s embedded workflow engine, is now open source](https://swe.quest/articles/skipper-airbnb-s-embedded-workflow-engine-is-now-open-source-791f5d416d163001.md): Airbnb Engineering · 2026-11-10 · Medium · 6 min read · Scheduling, Distributed systems, Resilience, Java & JVM, Open source
  Airbnb has open-sourced Skipper under Apache 2.0, an embedded durable workflow engine for Java and Kotlin that runs inside a service and stores workflow state in the service's existing database, with no separate orchestration cluster.
- [Beyond rate limits: scaling access to Codex and Sora](https://swe.quest/articles/beyond-rate-limits-scaling-access-to-codex-and-sora-f19f4998580ba788.md): OpenAI · 2026-02-13 · Medium · 6 min read · Payments & fintech, System design, Consistency models, Event-driven architecture, Distributed systems
  OpenAI replaced hard rate-limit stops for Codex and Sora with a real-time access engine that treats rate limits, free tiers, credits, promotions and enterprise entitlements as layers in a single decision waterfall evaluated per request.
- [Build custom API integrations with incident.io](https://swe.quest/articles/build-custom-api-integrations-with-incident-io-ae5fbcbf065c8d25.md): incident.io · 2022-04-25 · Medium · 7 min read · API design, Incidents & postmortems
  incident.io launched a public API focused on three use cases: creating incidents automatically from other systems, exporting incidents and their actions and follow-ups to BI tools, and configuring roles, severities and custom fields from external sources such as Terraform.
- [How we scaled the GitHub API with a sharded, replicated rate limiter in Redis](https://swe.quest/articles/how-we-scaled-the-github-api-with-a-sharded-replicated-rate-limiter-in-redis-c2f9366d9d874889.md): GitHub Engineering · 2021-04-05 · Medium · 9 min read · Caching, Replication, API design, Scaling, Ruby
  GitHub replaced a Memcached-based API rate limiter, which suffered evictions and could not survive a move to per-datacenter caches, with application-sharded Redis clusters (one primary, several read replicas) and atomic Lua scripts, rolled out behind a feature flag.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
