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
- 1Create a free HookSense endpoint at hooksense.com
- 2Copy your unique webhook URL
- 3In the Razorpay Dashboard → Settings → Webhooks → Add New Webhook
- 4Paste your HookSense URL and set a webhook secret
- 5Add the same secret to HookSense for automatic HMAC verification
- 6Select the events you want to receive and save
- 7Trigger a test event to see it land in HookSense
Common Razorpay Webhook Events
payment.authorizedpayment.capturedpayment.failedorder.paidsubscription.activatedsubscription.chargedrefund.createdpayment.dispute.createdForward to Localhost
Use HookSense CLI to forward Razorpay webhooks directly to your local development server:
npx hooksense listen -p 3000 --path /api/integrations/razorpayNo 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