Available in🇮🇳 India🇸🇬 Singapore🇺🇸 United States
Webhooks (Web Callback, HTTP Push API or Reverse API) automatically notify your application when specific events occur. Instead of continuously polling APIs to check for updates, webhooks push notifications directly to your server when events happen.
Webhooks vs APIs
Here is how webhooks compare to traditional API polling:How Razorpay Webhooks Work
When you subscribe to webhook events, Razorpay sends an HTTP POST request with JSON payload to your configured endpoint URL whenever those events are triggered. Suppose you have subscribed to theorder.paid webhook event, you will receive a notification every time a user pays you for an order, in the configured endpoint URL.
Use Cases
There can be multiple uses for webhook events. Two of these are listed below.Notifications on Failed Payments
Notifications on Failed Payments
When a payment attempted by your customer fails, we receive the failed payment status from the bank. This payment gets recorded in our system as Failed.Suppose you have enabled the
payment.failed webhook, you will receive a notification from us about the failed payment. You can then further analyse this payment and notify your customer about the failure.Setup and Configuration
- You can set up webhooks from your Dashboard and configure separate URLs for Live mode and Test mode. Know more about setting up Payment webhooks and Payout webhooks.
- A Test mode webhook receives events for your test transactions. Know more about testing webhooks.
- Webhook URLs must use ports 80 or 443 only.
- Ensure Razorpay webhook IPs are whitelisted on your server. Even if your server accepts all incoming requests, webhooks may still be blocked by cloud security groups or network configurations. Refer to Razorpay IPs and Certificates for the complete list of webhook IP addresses.
Next Steps
- Set up Payment webhooks
- Set up Payout webhooks
- Review webhook best practices
- Validate and test webhooks