Dev.to
7/19/2026

How to Test Razorpay Webhooks Locally
Short summary
This tutorial shows how to test Razorpay payment webhooks locally by building an Express.js server with HMAC-SHA256 signature verification and using a stable tunneling endpoint to receive events. It covers configuring the Razorpay dashboard, triggering test payments, and debugging common issues like signature mismatches and connection errors. The guide also demonstrates webhook replay for testing idempotency without re-triggering payments.
- •Build an Express.js webhook handler with raw-body capture for HMAC-SHA256 signature verification
- •Use a stable HTTPS tunnel (Anonymily CLI) to forward Razorpay webhook events to localhost
- •Debug common issues: signature mismatch from hashing parsed JSON instead of raw body, and ECONNREFUSED from handler not running
Generated with AI, which can make mistakes.
Is this a good recommendation for you?

