Paddle Webhooks & Testing

Configure webhooks in Paddle to receive events and keep your local database in sync. This guide walks you through setting up webhooks in the Paddle sandbox and testing them locally.

1. Set Up Webhook in Paddle Sandbox

To configure webhooks in the Paddle sandbox dashboard:

  1. Navigate to Developer Tools > Notifications in your Paddle sandbox dashboard.
  2. Click New Destination to create a new webhook destination.
  3. Enter your webhook URL. For local testing, you'll use an ngrok URL (see step 3 below).
  4. Enable the following events:
    • All of the subscription events
    • price.created
    • price.updated
    • transaction.completed
    • transaction.updated
    • customer.updated
  5. Copy the Webhook Secret that Paddle generates. You'll need this for your .env file.

2. Add Webhook Secret to Environment

Add the webhook secret to your .env file:

PADDLE_WEBHOOK_SECRET=your_webhook_secret_from_paddle
PADDLE_SANDBOX=true # For sandbox make sure you have this in env

After adding the secret, clear and cache your configuration:

php artisan config:clear
php artisan config:cache

3. Test with ngrok (Requires Account)

Note: You need an ngrok account to use ngrok. Sign up for a free account at ngrok.com if you don't have one.

  1. Start your Laravel application locally:
    php artisan serve
  2. In a separate terminal, start ngrok to expose your local server (use the URL from the php artisan serve command):
    ngrok http http://127.0.0.1:8000
  3. Copy the HTTPS URL that ngrok provides (e.g., https://abc123.ngrok-free.app). and add /paddle/webhook to the end of the URL.
    https://your-ngrok-url.ngrok-free.app/paddle/webhook
    Add this URL to the Paddle Webhook destination in the Paddle dashboard.

4. Test with a Product

To verify webhooks are working:

  1. Create a test product in the Paddle sandbox dashboard.
  2. Add a price to the product. This will trigger a price.created webhook.
  3. Check your Laravel logs to see if the webhook was received, you can also check your database or products page to see if the product was created.
  4. Paddle also provides webhook logs to help you debug any issues.

If you see log entries like "New product created from Paddle webhook" in your Laravel logs, and the webhook shows as successful in the Paddle dashboard, your webhook setup is working correctly!