Launch special — let's split the check with SPLITCHECK for 50% off

Razorpay Webhooks

How to Test Razorpay Webhooks Locally (2026)

Razorpay sends webhooks for payment, order, subscription, refund, and dispute events. Razorpay signs each webhook with HMAC-SHA256 over the raw request body using your webhook secret, delivered in the X-Razorpay-Signature header.

Signature Header

X-Razorpay-Signature

Algorithm

HMAC-SHA256

Setup Guide

  1. 1Create a free HookSense endpoint at hooksense.com
  2. 2Copy your unique webhook URL
  3. 3In the Razorpay Dashboard → Settings → Webhooks → Add New Webhook
  4. 4Paste your HookSense URL and set a webhook secret
  5. 5Add the same secret to HookSense for automatic HMAC verification
  6. 6Select the events you want to receive and save
  7. 7Trigger a test event to see it land in HookSense

Common Razorpay Webhook Events

payment.authorized
payment.captured
payment.failed
order.paid
subscription.activated
subscription.charged
refund.created
payment.dispute.created

Forward to Localhost

Use HookSense CLI to forward Razorpay webhooks directly to your local development server:

npx hooksense listen -p 3000 --path /api/integrations/razorpay

No ngrok or tunnel setup required. Install with npm i -g hooksense or use npx.

Tips & Best Practices

  • The signature is HMAC-SHA256 over the raw body — verify before parsing JSON
  • Use the x-razorpay-event-id header to dedupe — Razorpay may deliver the same event more than once
  • Test and live mode use separate webhook secrets — keep them distinct in HookSense
  • Replay captured payment.captured events to retest your handler idempotency

Related

Start Testing Razorpay Webhooks

Create a free endpoint and receive your first Razorpay webhook in seconds.

Get Started Free