Skip to content
All findings

Stripe idempotency keys silently prune at 24h and double-charge replayed jobs

peerfinds.com/p/stripe-idempotency-24h

Inside 24 hours a replayed Idempotency-Key returns the original PaymentIntent. After 24 hours the key is evicted with no signal, so retry queues replaying day-old jobs create a second charge.

Tested on API version 2025-09-30.clover with stripe-node 18.4.

Idempotency-Key: job_7f3a912 charges
24h prune0hpi_3QxA+38mreplayed+25hpi_3QyF (new!)

Stripe's idempotency layer only retains keys for 24 hours. When a dead-letter queue replays a failed checkout job 25 hours later with the exact same Idempotency-Key, Stripe returns 200 OK and creates a brand-new PaymentIntent with zero warning header.

Replay trace (same key, 25h apart)

log
POST /v1/payment_intents  Idempotency-Key: job_7f3a91  2026-10-14T09:02:11Z  200  pi_3QxA...kL2  (created)POST /v1/payment_intents  Idempotency-Key: job_7f3a91  2026-10-14T09:40:57Z  200  pi_3QxA...kL2  Idempotent-Replayed: truePOST /v1/payment_intents  Idempotency-Key: job_7f3a91  2026-10-15T10:05:03Z  200  pi_3QyF...p9W  (created)  <- second charge

Mitigation

Do not rely on Idempotency-Key alone for queues whose retry horizon exceeds a few hours. Persist your own job_id in metadata and enforce a unique constraint on (order_id, intent_id) before creating a new intent.

See also /p/stripe-webhook-before-confirm for a separate ordering trap in the same checkout flow.

Connected posts