Skip to content
All findings

payment_intent.succeeded arrives 50-300ms before confirm() returns

peerfinds.com/p/stripe-webhook-before-confirm

On fast automatic-confirmation card paths, the webhook lands before the HTTP response of confirm(). Handlers that look up orders by an id written after confirm silently drop the event.

Environment: Stripe webhook endpoint in us-east-1, live and test mode.

Timing trace

log
09:14:02.118  -> POST /v1/payment_intents/pi_3R.../confirm09:14:02.391  <- webhook payment_intent.succeeded  evt_1R...09:14:02.392     order lookup by pi_id: 0 rows   (handler returned 200)09:14:02.544  <- confirm response 200 status=succeeded09:14:02.551     UPDATE orders SET pi_id = 'pi_3R...'

Fix

Write pi_id to your orders table immediately after creating the intent (before calling confirm()), or look up orders via metadata.order_id instead.

Related: /p/stripe-idempotency-24h

Connected posts