← Blog/Stripe
Test Stripe webhooks locally
Point a Stripe webhook endpoint at a public URL, inspect the event payload, forward deliveries to your local app, and replay stored events from the console.
Stripe webhook development usually needs two phases: inspect what Stripe sends, then handle it in your local app. Mercur covers both — start with the online tester, then unlock Endpoints when you are ready to forward.
Stripe CLI vs a public URL
The Stripe CLI can forward events to localhost from your
machine. A public HTTPS URL is useful when:
- You want to configure a real endpoint in the Stripe Dashboard
- A teammate needs to hit the same receiver
- You are debugging signature headers and body encoding as Stripe delivered them
You can use either approach. This guide uses a public Mercur URL.
1. Open the webhook tester
Open the webhook tester
Copy the temporary public HTTPS URL. No account is required to inspect deliveries.
2. Add an endpoint in Stripe
In the Stripe Dashboard, open Developers → Webhooks → Add endpoint. Paste your Mercur URL
as the endpoint URL and select the events you care about (for example checkout.session.completed
or payment_intent.succeeded).
Save the endpoint. Stripe will often send a test event immediately.
3. Inspect the event in Mercur
Return to the webhook tester. Open request history and select the delivery:
- Confirm the path Stripe called
- Read JSON body fields such as
id,type, anddata.object - Note the
Stripe-Signatureheader for local verification later
Guest mode responds 204 No Content and does not run your application code — that is intentional
while you are only inspecting.
4. Forward to your local app
When your handler is ready:
- Create a free Mercur account
- Start a Endpoint aimed at your local port (for example
http://127.0.0.1:3000) - Update the Stripe endpoint URL to the new tunnel URL, or create a second endpoint for local work
- Use Record Session in the console when you want a live capture of tunnel traffic
- After you fix the handler, open request history and use Retry to replay a stored Stripe delivery through the Endpoint (proxy mode, agent connected)
Forwarding needs a connected agent — the macOS app or the npm package @mercur_dev/cli.
Signature verification still uses the endpoint’s signing secret from the Stripe Dashboard — keep that secret in your local env, not in Mercur.
Related
- How to test webhooks
- Receive a webhook
- CLI agent
- Test GitHub webhooks
- Create a Telegram bot with webhooks
- Pricing
Inspect a Stripe delivery now