Idempotency Keys: Designing APIs That Survive Retries

How to design idempotent API endpoints with idempotency keys: atomic key claims in PostgreSQL, request hashing, replay semantics, Stripe's 24-hour model, and client rules.