SafeWebhook/ Razorpay
Launch Workbench
Payments Integration Guide

Test Razorpay Webhooks Online

Test Razorpay payment captured, refund processed, and subscription charged webhooks with signature verification.

Direct Answer / Quick Summary

To test Razorpay webhooks, navigate to Razorpay Dashboard > Settings > Webhooks, click Add New Webhook, enter your SafeWebhook URL, configure your secret, and trigger simulated payments in Test Mode.

Key Capabilities & Testing Highlights

  • Validate X-Razorpay-Signature HMAC-SHA256 with test webhook secrets.
  • Debug payment.captured, payment.failed, and refund.processed events.
  • Simulate 500 error codes to verify Razorpay retry mechanism (up to 24 hours).
  • Private local-only storage ensures customer UPI/card tokens stay safe.
Signature Header
X-Razorpay-Signature
Cryptographic Scheme
HMAC-SHA256
Payload Retention
100% Client-Side

Step-by-Step Razorpay Webhook Setup

Follow these 4 simple steps to capture real-time Razorpay events in your browser:

1
Log into Razorpay Dashboard in Test Mode > Settings > Webhooks.
2
Click "+ Add New Webhook" and enter your SafeWebhook URL.
3
Enter a Secret key and select events (e.g. payment.captured, payment.failed).
4
Create a dummy test order on your frontend to trigger live events.

Sample Razorpay Webhook Payload

application/json
{
  "entity": "event",
  "account_id": "acc_892182410",
  "event": "payment.captured",
  "contains": [
    "payment"
  ],
  "payload": {
    "payment": {
      "entity": {
        "id": "pay_H209384910",
        "amount": 50000,
        "currency": "INR",
        "status": "captured",
        "method": "upi"
      }
    }
  }
}

Razorpay Signature Verification Recipes

Copy-paste production-ready HMAC verification code for your backend:

Node.js / Express Recipecrypto.timingSafeEqual
const crypto = require('crypto');

function verifyRazorpaySignature(rawBody, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(rawBody)
    .digest('hex');
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expectedSignature));
}
Python / Flask / FastAPI Recipehmac.compare_digest
import hmac
import hashlib

def verify_razorpay_signature(raw_body, signature, secret):
    generated = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(generated, signature)

Frequently Asked Questions: Razorpay Webhooks

What is Razorpay webhook retry policy on failed HTTP status codes?

Razorpay retries failed webhooks (non-200 responses) periodically with exponential backoff over a 24-hour window.

Ready to test Razorpay webhooks in real-time?

Get your free, private edge endpoint instantly. Zero signup, zero credit card, 100% free forever.

Launch Webhook Workbench →

Related Payments Webhook Guides