API ReferenceIntegrationsKnowledge Base

Webhooks

Webhooks allow you to build or set up integrations that subscribe to certain events on Razorpay APIs. When one of those events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL.

You can set up webhooks from your Dashboard and configure separate URLs for live mode and test mode.

A test mode webhook will only receive events for your test transactions.

In URLs, only port numbers 80 and 443 are currently allowed.

When setting up the webhook, you will be asked to specify a secret. Using this secret, you can validate that the webhook is from Razorpay. Entering the secret is optional, but recommended. The secret should never be exposed publicly.

You can set up multiple URLs to receive webhook notifications.

To setup webhooks:

  1. Log into your Razorpay Dashboard and navigate to SettingsWebhooks.
  2. Click + Add New Webhook.
  3. In the Webhook Setup modal:
    1. Enter the URL where you want to receive the webhook payload when an event is triggered. We recommended using an HTTPS URL. Note:
      Webhooks can only be delivered to public URLs. If you attempt to save a localhost endpoint as part of a webhook set-up, you will notice an error. Please refer to the test webhooks section for alternatives to localhost.
    2. Enter a Secret for the webhook endpoint. The secret is used to validate that the webhook is from Razorpay. Do not expose the secret publicly. Learn more about Webhook Secret.
    3. In the Alert Email field, enter the email address to which notifications must be sent in case of webhook failure.
    4. Select the required events from the list of Active Events. Sample payloads for all events are available.
  4. Click Create Webhook.

Once created, it appears on the list of webhooks:

Watch the short animation below for more details.

Refer to the Webhook section for more information.

×