About this tool
A webhook is an HTTP request that a service sends to your URL when something happens: Razorpay when a payment is captured, Stripe when a subscription renews, GitHub when someone pushes code. While you build the receiving side, the hard question is what exactly will they send? This webhook tester gives you a public URL that captures every request so you can see the real method, headers, query string and body before you write a line of handler code.
How to test a webhook
- Click Create webhook URL above. You get a unique, temporary address.
- Paste it into your provider’s webhook settings (in test or sandbox mode), or send a request yourself with curl or the Send test button.
- Trigger an event. Each request appears here within a couple of seconds. Click it to see the payload, all headers and query parameters, then copy what you need.
Any method and any sub-path is accepted, so /hooks/your-id/orders/created works too. Every request gets a 200 OK, which tells the provider the delivery succeeded.
Test Razorpay webhooks
In the Razorpay Dashboard, switch to Test Mode, open Account & Settings → Webhooks → Add New Webhook, paste your URL, set a test secret and pick events such as payment.captured, payment.failed and order.paid. Then make a test payment, for example through a Payment Link using the test UPI ID success@razorpay. The event arrives with an X-Razorpay-Signature header you can use to check your verification code.
Test Stripe webhooks
In the Stripe Dashboard (test mode), add a webhook endpoint with your URL and choose the events you need, such as payment_intent.succeeded or checkout.session.completed. Trigger one with a test payment, or with stripe trigger payment_intent.succeeded from the Stripe CLI. Look for the Stripe-Signature header, which contains a timestamp (t=) and the signature (v1=).
Test GitHub webhooks
In your repository, go to Settings → Webhooks → Add webhook, paste the URL, set the content type to application/json and add a secret. GitHub sends a ping event straight away, so you’ll see a request here right after saving. The event name is in X-GitHub-Event, and the signature in X-Hub-Signature-256.
Webhook signature headers by provider
| Provider | Header | Algorithm | What is signed |
|---|---|---|---|
| Razorpay | X-Razorpay-Signature | HMAC-SHA256, hex | Raw request body |
| Stripe | Stripe-Signature | HMAC-SHA256, hex (v1=) | timestamp + "." + raw body |
| GitHub | X-Hub-Signature-256 | HMAC-SHA256, hex, prefixed sha256= | Raw request body |
| Shopify | X-Shopify-Hmac-Sha256 | HMAC-SHA256, Base64 | Raw request body |
To check a captured request by hand, copy its raw body into the HMAC generator with your webhook secret as the key and compare the result with the header. Need a strong secret to configure? Use the webhook secret generator.
Verify the signature in your code
Always verify before trusting a webhook: anyone who knows your endpoint can send it requests. Compute the HMAC over the raw bytes you received and compare in constant time.
const crypto = require('node:crypto');
const express = require('express');
const app = express();
// Verify against the RAW body. Parsed and re-serialised JSON won't match.
app.post('/webhooks/razorpay', express.raw({ type: 'application/json' }), (req, res) => {
const expected = crypto
.createHmac('sha256', process.env.RAZORPAY_WEBHOOK_SECRET)
.update(req.body)
.digest('hex');
const received = req.get('X-Razorpay-Signature') || '';
const valid =
received.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
if (!valid) return res.status(400).send('Invalid signature');
const event = JSON.parse(req.body);
if (event.event === 'payment.captured') {
const payment = event.payload.payment.entity; // id, amount (in paise), order_id...
}
res.sendStatus(200); // reply fast; do slow work in the background
});import hashlib, hmac, os
from flask import Flask, abort, request
app = Flask(__name__)
@app.post("/webhooks/razorpay")
def razorpay_webhook():
body = request.get_data() # raw bytes, before any JSON parsing
expected = hmac.new(
os.environ["RAZORPAY_WEBHOOK_SECRET"].encode(), body, hashlib.sha256
).hexdigest()
received = request.headers.get("X-Razorpay-Signature", "")
if not hmac.compare_digest(expected, received):
abort(400)
event = request.get_json()
if event["event"] == "payment.captured":
payment = event["payload"]["payment"]["entity"]
return "", 200const Stripe = require('stripe');
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
// Stripe signs "<timestamp>.<raw body>"; its library checks the signature
// and rejects old timestamps (replay protection).
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), (req, res) => {
let event;
try {
event = stripe.webhooks.constructEvent(
req.body,
req.get('Stripe-Signature'),
process.env.STRIPE_WEBHOOK_SECRET // whsec_...
);
} catch (err) {
return res.status(400).send('Invalid signature');
}
if (event.type === 'payment_intent.succeeded') {
const intent = event.data.object;
}
res.sendStatus(200);
});const crypto = require('node:crypto');
app.post('/webhooks/github', express.raw({ type: 'application/json' }), (req, res) => {
const expected =
'sha256=' +
crypto.createHmac('sha256', process.env.GITHUB_WEBHOOK_SECRET).update(req.body).digest('hex');
const received = req.get('X-Hub-Signature-256') || '';
const valid =
received.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
if (!valid) return res.status(401).send('Invalid signature');
const type = req.get('X-GitHub-Event'); // 'ping', 'push', 'pull_request'...
const event = JSON.parse(req.body);
res.sendStatus(204);
});Why webhooks fail: common problems
- Signature never matches. The body was parsed as JSON and re-serialised before hashing, so the bytes changed. Hash the raw body. Also check you’re using the test-mode secret with test-mode events.
- The provider can’t reach your URL.
localhostisn’t reachable from the internet. Use this tester to see the payload first, then deploy your handler or use a tunnel to run it locally. - Timeouts and retries. Providers wait only a few seconds for a
2xxreply and retry on failure. Respond immediately and do slow work in the background. - Duplicate events. Retries mean the same event can arrive twice. Store the event ID (for example the
X-Razorpay-Event-Idheader or Stripe’sevent.id) and skip ones you’ve already processed. - Nothing arrives at all. The event type isn’t selected in the provider’s settings, the webhook is disabled, or you’re triggering events in live mode while the endpoint is registered in test mode.
Privacy and limits
Only the browser tab that created a session can read its requests. The URL alone is not enough. Sessions expire after an hour of inactivity (24 hours at most), and captured data is kept in memory only, never written to disk. Bodies up to 64 KB are accepted, and the latest 50 requests are kept. Use test data only.
FAQ
How do I test a webhook online?
Create a temporary URL on this page, paste it into the service that sends webhooks (Razorpay, Stripe, GitHub, Shopify or your own app), trigger an event, and the full request appears here: method, headers, query parameters and body.
Can I use localhost as a webhook URL?
No. Providers send webhooks over the internet and cannot reach localhost on your computer. Use a public URL like the one this tester gives you to inspect payloads, and deploy your handler (or use a tunnelling tool) to run your own code.
Why does my webhook signature verification fail?
Most often the body was parsed and re-serialised before hashing, which changes the bytes. Compute the HMAC over the raw request body exactly as received, use the correct secret for test or live mode, and compare in constant time.
Which header contains the Razorpay webhook signature?
X-Razorpay-Signature. It is a hex HMAC-SHA256 of the raw request body, using the webhook secret you set in the Razorpay Dashboard as the key.
Can anyone else see my webhook requests?
No. Reading requests requires a secret token that only your browser tab holds. Someone who learns the receiving URL can send requests to it but cannot read them.
What does the webhook URL respond with?
Every captured request gets a 200 OK with a small JSON body, so providers mark the delivery as successful and don’t keep retrying.
How long are requests kept?
Sessions are temporary by design. They end when you click End, after an hour without activity, after 24 hours, or when the service restarts. Nothing is written to disk.
Is this like ngrok?
Not quite. ngrok forwards traffic to a program running on your computer. This tool captures and displays requests so you can see what a provider sends, with nothing to install. Many developers use a tester first to learn the payload, then run their real handler.
Do I need an account?
No. Open the page, create a URL and start testing. Nothing to sign up for.