You can use Razorpay Webhooks to configure and receive notifications when a specific event occurs. When one of these events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL.
- You can set up Webhooks from your Razorpay Dashboard and configure separate URLs for Live mode and Test mode. Know more about setting up
- A Test mode webhook receives events for your test transactions. Know more about
- In webhook URLs, only port numbers 80 and 443 are currently allowed.
There can be multiple uses for webhook events. Two of these are listed below.
Capturing payments for which you did not receive a response on the client-side is perhaps the most important use case for the
Sometimes, the communication between the bank and Razorpay or between you and Razorpay may not occur. This could be because of a slow network connection or your customer closing the window while processing the payment. This could lead to a payment being marked as Failed on the Razorpay Dashboard but changed to Authorized at a later time. Know more about
You can use webhooks to get notified about payments that get authorised and analyse this data to decide whether or not to capture the payment.
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.