Receive real-time notifications when events occur in Dodo Payments. Automate workflows and keep your systems synchronized with instant event delivery.
Webhooks provide real-time notifications when specific events occur in your Dodo Payments account. Use webhooks to automate workflows, update your database, send notifications, and keep your systems synchronized.
Our webhook implementation follows the Standard Webhooks specification, ensuring compatibility with industry best practices and existing webhook libraries.
Navigate to the DodoPayments Dashboard and go to Settings > Webhooks.
2
Create Webhook Endpoint
Click on Add Webhook to create a new webhook endpoint.
3
Add Endpoint URL
Enter the URL where you want to receive webhook events.
4
Select Events to Receive
Choose the specific events your webhook endpoint should listen for by selecting them from the event list.
Only selected events will trigger webhooks to your endpoint, helping you avoid unnecessary traffic and processing.
5
Get Secret Key
Obtain your webhook Secret Key from the settings page. You’ll use this to verify the authenticity of received webhooks.
Keep your webhook secret key secure and never expose it in client-side code or public repositories.
6
Rotate Secret (Optional)
If needed, you can rotate your webhook secret for enhanced security. Click the Rotate Secret button in your webhook settings.
Rotating the secret will expire it and replace it with a new one. The old secret will only be valid for the next 24 hours. Afterward, trying to verify with the old secret will fail.
Use secret rotation periodically or immediately if you suspect your current secret has been compromised.
The interface displays all available webhook events organized in a hierarchical structure. Events are grouped by category (e.g., dispute, payment, subscription).
2
Search and Filter
Use the search bar to quickly find specific events by typing event names or keywords.
3
Select Events
Check the boxes next to the events you want to receive. You can:
Select parent events to receive all related sub-events
Mix and match specific events based on your needs
4
Review Event Details
Hover over the information icon (ⓘ) next to each event to see a description of when that event is triggered.
5
Save Configuration
Click Save to apply your changes, or Cancel to discard modifications.
If you deselect all events, your webhook endpoint will not receive any notifications. Make sure to select at least the events your application needs to function properly.
If a webhook delivery fails, Dodo Payments automatically retries with exponential backoff to prevent overwhelming your system.
Attempt
Delay
Description
1
Immediately
First retry happens right away
2
5 seconds
Second attempt after short delay
3
5 minutes
Third attempt with increased backoff
4
30 minutes
Fourth attempt continuing backoff
5
2 hours
Fifth attempt with extended delay
6
5 hours
Sixth attempt with longer delay
7
10 hours
Seventh attempt with maximum delay
8
10 hours
Final attempt - webhook marked as failed if unsuccessful
Maximum of 8 retry attempts per webhook event. For example, if a webhook fails three times before succeeding, the total delivery time is approximately 35 minutes and 5 seconds from the first attempt.
Use the Dodo Payments dashboard to manually retry individual messages or bulk recover all failed messages at any time.
Here’s a complete Express.js implementation showing webhook verification and handling:
Copy
import { Webhook } from "standardwebhooks";import express from "express";const app = express();app.use(express.json());const webhook = new Webhook(process.env.DODO_WEBHOOK_SECRET);app.post('/webhook/dodo-payments', async (req, res) => { try { // Extract webhook headers const webhookHeaders = { "webhook-id": req.headers["webhook-id"] as string, "webhook-signature": req.headers["webhook-signature"] as string, "webhook-timestamp": req.headers["webhook-timestamp"] as string, }; // Verify the webhook signature const payload = JSON.stringify(req.body); await webhook.verify(payload, webhookHeaders); // Acknowledge receipt immediately res.status(200).json({ received: true }); // Process webhook asynchronously processWebhookAsync(req.body).catch(console.error); } catch (error) { console.error('Webhook verification failed:', error); res.status(400).json({ error: 'Invalid signature' }); }});async function processWebhookAsync(data: any) { // Handle the webhook event based on type switch (data.type) { case 'payment.succeeded': await handlePaymentSucceeded(data); break; case 'subscription.created': await handleSubscriptionCreated(data); break; // Add more event handlers... }}
Test your webhook handler thoroughly using the dashboard testing interface before processing production events. This helps identify and fix issues early.
Add custom HTTP headers to all webhook requests sent to your endpoint. This is useful for authentication, routing, or adding metadata to your webhook requests.
1
Add Custom Header
In the “Custom Headers” section, enter a Key and Value for your custom header.
2
Add Multiple Headers
Click the + button to add additional custom headers as needed.
3
Save Configuration
Your custom headers will be included in all webhook requests to this endpoint.
The Logs tab provides comprehensive visibility into your webhook delivery status, allowing you to monitor, debug, and manage webhook events effectively.
Ready to deploy your webhook handler to production? We provide platform-specific guides to help you deploy webhooks to popular cloud providers with best practices for each platform.