Register webhooks
Handling webhook events correctly and reliably is crucial in PSP integration. PayLab sends webhook events to your registered endpoints just like a real PSP, enabling you to test and simulate different event-handling scenarios.
In this guide, we’ll walk you through how to register webhook endpoints and receive events from the PayLab Mock Stripe API. We’ll use the same payment flow as in the Quick Start guide. The process is completely free and requires no signup!
Register a webhook endpoint
Create an event destination to receive events at an HTTPS webhook endpoint.
- Navigate to Mock PSP / Webhooks.
- Click
Add Webhook. In the dialog, selectstripe @ 2025-10-29-cloveras the PSP. - For demonstration purposes, use a
webhook.siteURL in theWebhook URLfield.
webhook.site is a handy third-party tool that allows you to receive and inspect webhook events. Follow the instructions on webhook.site to generate a unique URL.
-
In the
Event Typesfield, you’ll find a list of Stripe webhook events supported by PayLab. Select one or more events to subscribe to. For this guide, choose:charge.succeeded,charge.pending,payment_intent.created,payment_intent.processing,payment_intent.succeeded. -
The
Webhook Signing Secretis used to authenticate webhook events from Stripe. A signature header is constructed in the webhook request based on this secret. For this guide, simply use "secret" as the value.
Check out Stripe Documentation for a detailed explanation of event signatures.
Once fields are populated, click OK. Your webhook endpoint is now registered!
Step 1. Create a payment intent
Follow the same instructions in Quick Start guide to create a payment intent. This time, you should observe a payment_intent.created event being sent to your new webhook endpoint.
Go to webhook.site and inspect the event body:
{
"id": "55abb0e5-4cf5-4ebf-b234-07b32f3d9b0e",
"object": "event",
"api_version": "2025-10-29",
"created": 1763867590,
"type": "payment_intent.created",
...
"data": {
"object": {
"id": "074f84ad-97f1-4f6c-bf1a-b5ffe9145110",
"object": "payment_intent",
"amount": 5000,
"amount_capturable": 5000,
"status": "requires_payment_method",
...
}
}
}
Note that how the fields (id, object, type, amount, state, etc) are populated correctly, allowing you to track the payment status in real time.
Additionally, the stripe-signature header is included, allowing you to verify the authenticity of the event:
stripe-signature t=1763867591,v1=ebb147894148f24f71389f45b64d9d062d433b994a0d07
Step 2. Confirm the payment intent
Follow the same instructions in Quick Start guide to confirm the payment intent. This time, you should observe the following events being sent to your webhook endpoint:
payment_intent.processingcharge.pendingcharge.succeededpayment_intent.succeeded
These events correspond to the payment confirmation process and were subscribed to by your webhook endpoint. Go to webhook.site and inspect the event bodies to ensure everything looks correct.
Step 3. Check the event delivery history
In the Developer Console, navigate to Mock PSP / Webhooks. Find your new endpoint and click View Deliveries. This will take you to a page where you can inspect the event delivery history.
Now you know how to receive webhook events from our Mock Stripe API!
Key Highlights
- PayLab provides a unified interface for managing webhook endpoints across different PSPs. The interface dynamically adapts to the PSP you select, handling PSP-specific configurations such as event types and signing mechanisms.
- The event body is designed to closely mimic real Stripe events. If you notice any discrepancies, let us know!
- Experienced payment developers can control the order, delay, and duplication of events to test integration logic under different conditions. Check out the Control webhook behaviour guide to learn more.