Simulate webhooks
Use webhook simulator to send test webhooks for single events or predefined scenarios as part of testing and integration.
You can use webhooks to handle provisioning and fulfilment, and to keep your app in sync with Paddle. For example, you can create an account for a customer in your app when a subscription is created in Paddle and limit customer access to your app if they cancel.
Webhook simulator lets you send test webhooks for single events or scenarios, so you can more easily build and test workflows to keep your app in sync with Paddle.
How it works
You can use webhooks to keep your app in sync with Paddle. For example, you can subscribe to subscription.paused
to determine when a subscription pauses and take action in your app, like limiting customer access until resumed.
Key subscription lifecycle events typically involve multiple webhooks. For example, when a customer signs up using a checkout, Paddle creates and updates multiple entities throughout the process — a customer, address, and business to hold customer information; a transaction to collect for payment; and finally a subscription when checkout completes.
To make it easier to test and integrate, webhook simulator lets you send single events or predefined groups of events, called scenarios, without going through the steps to make them occur yourself.
Configurations
You're able to configure scenario simulations to more accurately test and optimize your webhook integrations.
When configuring, you can include:
Entities
Use entities to populate simulated webhook payloads with your real data. They map to your existing Paddle entities, like customers and subscriptions.
Options
Use options to determine what flow should occur in scenarios, including which webhooks are sent and the details they contain. They're related to user actions, or the fields on entities when the scenario takes place.
Providing entities only populates payloads with its data. For example, providing an existing customer ID won't send webhooks as if the subscription is for an existing customer. To change which webhooks are sent during a simulated flow, select or provide options.
Simulation lifecycle
Create a simulation
You can create a simulation to tell Paddle which event or predefined sequence of events that you want to simulate and where you want to send data to. Once created, you can run a simulation any time to send simulated data.
Configure a simulation — optional
Scenario simulations send a predefined sequence of events. You can optionally configure your simulations to more accurately simulate particular flows and populate the payloads of events with your own data.
Run your simulation
Once your simulation is created and configured, you can run it to send the event or events that are part of it. Paddle creates a simulation run entity for the run to hold information about the events simulated.
Work with simulated events
Paddle sends simulated webhooks for the event or events that are part of the simulation, creating a simulation run event entity for each event sent. You can list events for a simulation run to see which events were simulated and information about responses from the destination server.
Simulations are reusable configurations. Once you've created and configured a simulation, you can run it any time you like as part of your testing workflows.
Create a simulation
Go to Paddle > Developer tools > Simulations.
Click New simulation.
Choose where to send simulated events using the Destination dropdown box. You can create a new notification destination if you don't already have one.
Enter a descriptive name for your simulation. You can customize payloads to send specific data, so a descriptive name helps you to identify this simulation.
Click the Single event or Scenario tab, then choose the simulated data you want to receive.
Click Create when you're done.
Only destinations with the traffic source
simulation
orall
are shown in the list of destinations.platform
destinations can only receive traffic for real events to avoid sending simulated data to production endpoints.
Configure a simulation
Each scenario can be configured to populate simulated webhook payloads with real data and test a greater variety of common flows.
This only customizes scenario event simulations. For single event simulations, you can customize payloads after you've run a simulation.
Go to Paddle > Developer tools > Simulations.
Find your simulation in the list, then click the ... action menu and choose View. If you haven't already created a simulation, create one instead.
Click Configure simulation.
Select from Simulate as if options to simulate which events are sent as if that use-case happened.
Add Paddle IDs in Populate payloads with fields to populate sent event payloads with the details of those entities.
Click Done when you're done.
Run the simulation to send events.
The webhooks sent as part of a scenario depend on the options you provide.
Run a simulation
Go to Paddle > Developer tools > Simulations.
Find your simulation in the list, then click the ... action menu and choose View. If you haven't already created a simulation, create one instead.
Click Run simulation to run your simulation. If you've already run your simulation before, click Replay to run it again.
Use the Payload, Request, and Response tabs to work with simulated events.
You can verify signatures for your simulation to check that events are genuinely sent by Paddle. Click View more to reveal your webhook secret key.
Customize a simulation payload
You can customize the payload for a single event simulation to send specific data as part of your request. Paddle saves your simulated data, so you can use it in the future.
This only customizes payloads for single event simulations. For scenario simulations, you can populate payloads with existing Paddle entities by configuring those simulations.
Go to Paddle > Developer tools > Simulations.
Find your simulation in the list, then click the ... action menu and choose View. If you haven't already created a simulation, create one instead.
If you haven't run your simulation before, run it.
Click the Payload tab in the preview pane, then click the payload to start editing.
Click Replay to run your simulation with the customized payload.
Paddle checks the data you enter is valid JSON and that values for fields are the correct type. However, you may still enter incorrect data, like passing transaction totals that don't add up correctly.
Work with simulated events
Paddle creates a simulation run event for the event or events that are part of a simulation.
Go to Paddle > Developer tools > Simulations.
Find your simulation in the list, then click the ... action menu and choose View. If you haven't already created a simulation, create one instead.
If you haven't run your simulation before, run it.
Inspect the Payload, Request, and Response using the tabs in the preview pane. If you're working with a scenario, click the events on the left to see information about a single event sent as part of this scenario.
Payload | The simulated data sent by Paddle. Returned by the data object in simulated events. |
Request | The complete simulated event request sent by Paddle. Includes simulated fields for the event, like occurred_at and event_id . |
Response | The status code and body of the response received from the destination server. May be blank where a body isn't returned. |
Troubleshooting
If you provide an item or transaction with a trialing price, a subscription.trialing
webhook notification is sent in place of a subscription.activated
webhook notification.
Providing a customer doesn't mean any associated business or address is automatically added. You must add a business_id
or address_id
manually. These must be related to the given customer.
Discounts may have no effect on the cost of a transaction if the provided discount isn't valid against any of the items in the transaction. Check the discount to see its restrictions and compare to the items in the transaction.
Only one transaction.payment_failed
webhook notification is sent when you specify that the payment has failed (payment_outcome: failed
). In live implementations, you can receive a new notification for each subsequent payment retry that fails up until dunning is exhausted.
If you provide a subscription, the most recent transaction associated with that subscription is used.
When you provide a subscription, Paddle sets the subscription status to best match the scenario and its configuration. This means the status may be different to the status of the subscription provided.
For example, when simulating resuming a subscription, the subscription status is paused
initially to mirror behavior in live implementations.
Other data for the subscription, like the latest transaction, is used as normal.
We'd love to hear from you. Let us know which flows you want to simulate using the feedback button at the top-right.