How to Test Stripe Webhooks
Use a temporary HookTray endpoint to inspect Stripe webhook requests in real time. No account is required, and request history stays in your browser.
What Stripe webhooks send
Stripe webhooks are HTTP requests that notify your application when an event occurs in Stripe. Events can include payment_intent.succeeded, invoice.paid, and customer.subscription.updated, among many others. The event types you need depend on your integration.
For the complete model and delivery behavior, read the Stripe webhook documentation.
Set up a test destination in Stripe Workbench
- Open the HookTray inspector and copy the generated hook URL shown in the inspector.
- Open Stripe Dashboard, switch to test mode, and go to Workbench.
- Open Webhooks, create a new event destination, and choose your Stripe account as the source.
- Select the event types your integration needs, then continue to the destination settings.
- Choose a webhook endpoint and paste your generated HookTray URL as the endpoint URL.
- Create the destination. Use Workbench to inspect its configuration and delivery attempts.
- Trigger a subscribed event by performing the corresponding test-mode action in Stripe Dashboard or with Stripe CLI, for example:
stripe trigger payment_intent.succeeded. - Return to HookTray and select the incoming request to inspect it.
Inspect the request
In HookTray, confirm that the Stripe-Signature header is present and inspect the Content-Type header. In the JSON request body, check the event type in type, the event ID in id, and the object under data.
HookTray displays the signature header but does not validate the signature. Verify signatures in your application using the endpoint secret and the unmodified raw request body. See the Stripe signature documentation for the official procedure.
Troubleshooting Stripe webhook tests
Wrong endpoint secret
Each webhook endpoint has its own signing secret. Use the secret for the exact destination and mode receiving the event.
Raw body mutation
Parsing, reformatting, or otherwise changing the body before verification can cause signature checks in your application to fail. Preserve the raw request bytes.
Test and live mode confusion
Test-mode and live-mode destinations, events, and secrets are separate. Confirm the Dashboard mode matches the integration you are debugging.
Non-2xx responses
Stripe treats a response outside the 2xx range as a failed delivery. Check the destination URL and your application response when moving from inspection to your own handler.
Retries and duplicate deliveries
Stripe can retry failed deliveries, so your application should handle the same event ID more than once without repeating side effects.
Unordered events
Events are not guaranteed to arrive in the order they were created. Build handlers that do not depend on delivery order.