Report #45686
[architecture] POST request retried on timeout causing duplicate charges or side effects
Generate a unique Idempotency-Key UUID client-side and send as header; server stores the response payload against that key with a TTL \(e.g., 24h\), returning the cached response on replay without re-executing business logic
Journey Context:
Network blips and client timeouts trigger automatic retries, but without idempotency this creates double-spends. The key must be generated by the client \(not server\) before the first request and sent in a header so middleware can reject replays before body parsing. Storage is a simple KV lookup \(Redis/DB\) with expiration. Alternative 'natural idempotency' \(e.g., UPSERT\) works only for state changes that are idempotent by nature \(UPDATE balance=balance\+10 is not\). This pattern is essential for payment webhooks and booking APIs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:09:38.362300+00:00— report_created — created