Skip to main content
Back to Dev generators

Dev

Mock Stripe Event Generator

Testing a Stripe webhook handler requires realistic event payloads, but spinning up a real Stripe test mode event for every unit test is slow and fragile. This tool generates a single fake Stripe-style webhook event as JSON, covering five event types: payment_intent.succeeded, charge.refunded, invoice.paid, customer.subscription.created, and checkout.session.completed. There are no inputs — click Generate and a new event appears each time. The output includes the standard Stripe envelope: an evt_ prefixed id, the object type, the event type, a created timestamp (livemode: false), and a nested data.object with an amount, currency, and status. The event id and the nested id are random 24-character alphanumeric strings. Copy the JSON directly into a test case to exercise your parsing and routing logic. For full integration testing — including real signature verification — use Stripe's test mode and Stripe CLI. These mock payloads are unsigned, so they will not pass constructEvent verification; they are for unit-testing the handler logic itself.

Read the complete guide — 4 min read

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Click Generate to produce a Stripe event.
  2. Copy the JSON into your test or endpoint.
  3. Use it to exercise your webhook handler.
  4. Use Stripe test mode for integration testing.

Use Cases

  • Testing a Stripe webhook handler
  • Building a mock payment flow
  • Learning Stripe event structure
  • Seeding sample event data
  • Demoing a payments integration

Tips

  • Use it to test parsing logic.
  • The events reference nothing real.
  • Test real flows with the Stripe CLI.
  • Verify webhook signatures in production.

FAQ

which stripe event types does this generate

It produces one of five types at random: payment_intent.succeeded, charge.refunded, invoice.paid, customer.subscription.created, and checkout.session.completed. Keep clicking Generate to cycle through different types for testing each handler branch.

will this payload pass stripe's signature verification

No. The event is randomly generated and unsigned, so it will fail stripe.webhooks.constructEvent. Use it to test your parsing and routing logic in unit tests. For the signature verification code path, use Stripe's CLI or test mode, which sends real signed events.

what fields does the generated event contain

The envelope has id (evt_ + 24 random chars), object (set to 'event'), type, created (a Unix timestamp), livemode (false), and a data.object block with an id, amount in cents, currency (usd), and status. It mirrors the top-level shape Stripe sends without covering every possible field.

can i control which event type is generated

No — the type is picked at random each time. There are no inputs on this generator. If you need a specific type, click Generate until that type appears, then copy the payload and replace the type field manually in your editor.

You might also like

Popular tools from other categories that share themes with this one.

Try these next

More free tools from other corners of the catalog, picked by shared themes.