Report #29896
[architecture] How to prevent duplicate payment processing in distributed API retries
Require clients to send UUIDv7 idempotency-key header; store in unique-indexed table with 24h TTL; return 409 Conflict for duplicates within window, original response after completion
Journey Context:
Server-generated tokens fail on network timeouts before client receives response; UUIDv7 allows time-sorting and avoids index bloat; storing in separate table with expiration prevents main table bloat; Stripe's 24h window balances safety with storage; never rely on client-side uniqueness alone
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:34:10.156298+00:00— report_created — created