Replay a failed Stripe webhook

Send a signed Stripe sample to a failing endpoint, read the failed attempts, fix the endpoint, then replay the stored event.

For people and agents

When your endpoint fails on a Stripe event, you want to see what arrived, fix the code, and run the same event again without making a new payment. This walk-through does that with a signed sample event from Echohoot. It is not a payment in your Stripe account; to use a real Stripe sandbox event, see Guided setup. Use a test receiver you control, with no side effects, and a disposable signing secret.

1. Connect a Stripe source

curl -X POST https://echohoot.com/sources/connect \
  -H 'Authorization: Bearer <api key>' \
  -H 'Content-Type: application/json' \
  -d '{"type": "stripe"}'
# 201 {"id": "src_...", "type": "stripe", "ingestUrl": "https://echohoot.com/in/...", "signingSecretSet": false, ...}

The source starts with the Logger as a destination. Give it a disposable secret (any whsec_ value works for the sample; a real endpoint uses the one Stripe shows you):

curl -X PUT https://echohoot.com/sources/<sourceId>/signing-secret \
  -H 'Authorization: Bearer <api key>' \
  -H 'Content-Type: application/json' \
  -d '{"signingSecret": "whsec_disposable_test_value"}'

2. Add the endpoint under test

Make the receiver answer HTTP 503 for now, then add it as a destination and connect it to the source:

curl -X POST https://echohoot.com/destinations \
  -H 'Authorization: Bearer <api key>' \
  -H 'Content-Type: application/json' \
  -d '{"type": "url", "url": "https://example.com/stripe-webhook"}'

curl -X POST https://echohoot.com/connections \
  -H 'Authorization: Bearer <api key>' \
  -H 'Content-Type: application/json' \
  -d '{"sourceId": "<sourceId>", "destinationId": "<destinationId>"}'

3. Send the signed sample

curl -X POST https://echohoot.com/sources/<sourceId>/send-test -H 'Authorization: Bearer <api key>'
# 200 {"requestId": "req_...", "verified": true, ...}

The sample is a payment_intent.succeeded event signed with your secret. It makes one event per connection: the Logger's is delivered, your endpoint's fails. The sample carries x-echohoot-test: send-test, so your receiver can tell it from a real Stripe call.

4. Read why it failed

curl 'https://echohoot.com/events?status=pending' -H 'Authorization: Bearer <api key>'
curl https://echohoot.com/events/<eventId> -H 'Authorization: Bearer <api key>'

The event lists each attempt with the status your endpoint returned and a snippet of its response. A failing event stays pending while automatic retries run for 3 days. The dashboard's Events page shows the same attempts.

5. Fix the endpoint, then replay

Deploy the fix, then replay the stored event:

curl -X POST https://echohoot.com/events/<eventId>/replay -H 'Authorization: Bearer <api key>'
# 202 {"id": "evt_...", "status": "pending", ...}

A replay delivers the same body, headers and event ID with a fresh signature. The earlier attempts stay in the history and the new one continues the numbering. Stripe is not asked again.

Replay many after an outage

If an outage failed many events, replay them in one call instead of one by one:

curl -X POST https://echohoot.com/events/replay \
  -H 'Authorization: Bearer <api key>' \
  -H 'Content-Type: application/json' \
  -d '{"destinationId": "<destinationId>", "status": "failed"}'

The filters, the per-call limit and more are in Replay.

Make the handler idempotent

A retry and a replay can both reach your handler, so dedupe on the Stripe event id and make a second delivery a no-op.

Limits to know

  • The sample proves the path from a signed request to your endpoint. It does not prove your Stripe account is configured: register your Echohoot ingest URL in Stripe to send real events.
  • Delete a test destination when you finish, so it stops retrying.

Ask your AI assistant to do it

Copy this into your assistant. It never needs your Stripe keys:

Read https://echohoot.com/docs/replay-stripe-webhook.md. Using my Echohoot API key from the environment, connect a Stripe
source, add my test endpoint as a destination, send the signed sample, tell me why the endpoint failed, and wait
for me to say the fix is deployed before replaying the event.