How to Test Stripe Webhooks with MockFlow
Create a Catcher
Sign in to MockFlow and create a Request Catcher in your project. Copy the public URL.
Add to Stripe Dashboard
Go to Stripe Dashboard → Developers → Webhooks → Add endpoint. Paste your MockFlow URL. Choose which events to send.
Trigger a Stripe Event
Click Send test event in Stripe or make a test payment. Stripe fires the event to your MockFlow URL.
Inspect & Replay
MockFlow captures the full payload. Inspect headers, body, and the Stripe-Signature. Replay to localhost when you are ready.
Using the Stripe CLI with MockFlow
The Stripe CLI forwards events to any URL. Combine it with MockFlow to capture events for inspection, then replay them to your local server.
# Forward all Stripe events to your MockFlow catcher stripe listen --forward-to \ https://api.mockflow.io/my-project--abc123/catch/xyz # Stripe CLI output: # > Ready! Your webhook signing secret is whsec_... # > 2026-05-30 payment_intent.succeeded [evt_abc] # > 2026-05-30 invoice.payment_succeeded [evt_def] # MockFlow captures each event. # Open the MockFlow catcher inspector to see full payloads.
Replay a Stripe Event to Localhost
Once MockFlow has captured the event, use the Replay button to forward the exact payload to your local webhook handler.
# MockFlow Replay → target URL: http://localhost:3000/webhooks/stripe
# MockFlow sends the captured request body and headers to your local server.
# Your local handler receives:
POST /webhooks/stripe HTTP/1.1
Host: localhost:3000
Stripe-Signature: t=1234567890,v1=abc...
Content-Type: application/json
{
"id": "evt_abc123",
"type": "payment_intent.succeeded",
"data": { "object": { ... } }
}Common Stripe Events to Test
These are the events most applications need to handle correctly. Test each one before shipping.
| Event | When It Fires |
|---|---|
| payment_intent.succeeded | Fired when a payment is successfully captured. |
| payment_intent.payment_failed | Fired when a payment attempt fails. |
| customer.subscription.created | Fired when a new subscription is created. |
| customer.subscription.updated | Fired when a subscription is upgraded or downgraded. |
| customer.subscription.deleted | Fired when a subscription is cancelled. |
| invoice.payment_succeeded | Fired when an invoice is paid. |
| invoice.payment_failed | Fired when an invoice payment fails. |
| checkout.session.completed | Fired when a Stripe Checkout session completes. |
Verifying the Stripe Webhook Signature
MockFlow captures the raw Stripe-Signature header. Use it to verify your signature validation logic is correct.
// Node.js / Next.js webhook handler
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
export async function POST(req: Request) {
const body = await req.text();
const sig = req.headers.get("stripe-signature")!;
let event: Stripe.Event;
try {
event = stripe.webhooks.constructEvent(
body,
sig,
process.env.STRIPE_WEBHOOK_SECRET!
);
} catch (err) {
return Response.json({ error: "Signature verification failed" }, { status: 400 });
}
// Handle event types
switch (event.type) {
case "payment_intent.succeeded":
// fulfill order
break;
case "customer.subscription.deleted":
// downgrade account
break;
}
return Response.json({ received: true });
}Use MockFlow replay to send the captured Stripe event to your handler and confirm the verification passes before deploying.
Stripe Webhook Testing FAQ
How do I test Stripe webhooks with MockFlow?
Create a MockFlow Request Catcher to get a unique HTTPS URL. Add that URL as a webhook endpoint in the Stripe Dashboard under Developers → Webhooks → Add endpoint. Send a test event from Stripe. MockFlow captures it and shows you every header (including Stripe-Signature), the full event payload, and timestamps.
Can I test Stripe webhooks locally without exposing my machine?
Yes. Point Stripe at your MockFlow catcher URL. When a Stripe event fires, MockFlow captures it. Then use the MockFlow Replay feature to forward the request to http://localhost:3000/webhooks/stripe — your local server receives the exact payload Stripe sent, without needing ngrok or a public IP.
Does MockFlow capture the Stripe-Signature header?
Yes. MockFlow captures all headers including the Stripe-Signature header. This is the header you need for STRIPE_WEBHOOK_SECRET signature verification. Seeing it in MockFlow lets you confirm the header is present and inspect its format before implementing verification.
What Stripe events can I test with MockFlow?
Any Stripe event. Common ones include payment_intent.succeeded, payment_intent.payment_failed, customer.subscription.created/updated/deleted, invoice.payment_succeeded, invoice.payment_failed, and checkout.session.completed. Configure which events Stripe sends in the Stripe Dashboard webhook settings.
Can I use the Stripe CLI with MockFlow?
Yes. Run stripe listen --forward-to https://api.mockflow.io/your-project/catch/yourId. The Stripe CLI will forward all events to MockFlow, which captures and displays them. You can then replay any captured event from MockFlow to your real server.
Is a paid Stripe account required?
No. You can use a free Stripe test mode account to send test events. MockFlow works with any Stripe account in test mode and does not require any Stripe plan.