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 a public HTTP or HTTPS URL when you are ready.
Using the Stripe CLI with MockFlow
The Stripe CLI can forward events to your MockFlow catcher URL. MockFlow stores each event so you can inspect it, then replay it to another public HTTP or HTTPS endpoint.
# 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 a Public Endpoint
Once MockFlow has captured the event, use the Replay button to forward the payload to a public HTTP or HTTPS URL. Private hosts, including localhost, are blocked because replay is sent from MockFlow's servers.
# MockFlow Replay → target URL: https://staging.example.com/webhooks/stripe
# MockFlow sends the captured request body and headers to that public URL.
# The staging handler receives:
POST /webhooks/stripe HTTP/1.1
Host: staging.example.com
Stripe-Signature: t=1234567890,v1=abc...
Content-Type: application/json
{
"id": "evt_abc123",
"type": "payment_intent.succeeded",
"data": { "object": { ... } }
}Stripe CLI vs a Public MockFlow URL
stripe listen is excellent on your laptop. A MockFlow catcher URL is better when Stripe, a teammate, or a staging app must reach a stable HTTPS endpoint.
| Need | Stripe CLI | MockFlow public URL |
|---|---|---|
| Local handler on your machine | Forwards events to a URL on your machine | Capture on a public URL; replay only to a public HTTP or HTTPS endpoint |
| Share an endpoint with a teammate | Each person runs their own CLI | One persistent HTTPS URL |
| Inspect Stripe-Signature and raw JSON | Logs in the terminal | Full inspector with replay history |
| No local process running | Events are missed | Catcher keeps receiving events |
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 capture Stripe webhooks without exposing my machine?
Yes, for the capture step. Point Stripe at your MockFlow catcher URL. When a Stripe event fires, MockFlow stores it. Replay then sends that request from MockFlow's servers to another public HTTP or HTTPS URL. A private localhost address is blocked, so a handler that is only on your laptop needs a public staging URL or a tunnel before replay can reach it.
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 a captured event from MockFlow to a public HTTP or HTTPS URL.
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.