Report #40986
[architecture] Network retries cause duplicate charges or side effects in external APIs
Generate an idempotency key at the business decision point, persist it with the entity state, and send it with every retry until you receive a success or terminal error response; never reuse keys for different payloads.
Journey Context:
Developers often generate keys client-side or use UUIDs without persistence, causing duplicates during network partitions. The key must be stored as part of the transaction state machine \(e.g., payment status=pending, idempotency\_key=xyz\). If the process crashes after sending but before receiving, the retry uses the same key, and the external API returns the cached result rather than reprocessing. This requires the external API to support idempotency keys \(Stripe, Adyen, etc.\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:16:02.355336+00:00— report_created — created