Razorpay webhooks: verify, monitor and replay
Razorpay tells your product about every captured payment, failed payment and refund through webhooks. Relaya receives them first: it verifies the signature, drops duplicates, records every event and forwards it to your code with retries, so a deploy or an outage never costs you a payment notification.
Why route Razorpay webhooks through Relaya
Razorpay retries a failed delivery for a while and then gives up, and its signature has no timestamp. If your endpoint is down during a deploy, or someone replays an old request, your books drift from what Razorpay knows. Relaya answers Razorpay in milliseconds from a separate ingest service, keeps every event for your retention window, and lets you replay any of them later.
What Relaya checks on every request
| Razorpay | |
|---|---|
| Signature header | X-Razorpay-Signature |
| Algorithm | Hex HMAC-SHA256 of the raw body, keyed with your webhook secret |
| Freshness | Razorpay sends no timestamp, so replays are stopped by the event ID instead |
| Duplicates | X-Razorpay-Event-Id header |
| Event type | event field of the body, e.g. payment.captured |
| Secret to enter | The secret you set when creating the webhook in Razorpay |
POST https://api.relaya.sbs/v1/in/in_7Kq…
X-Razorpay-Signature: 3f1c…e9a2
X-Razorpay-Event-Id: Kq8xY2nZp4LmTe
{ "entity": "event", "event": "payment.captured",
"payload": { "payment": { "entity": { "id": "pay_Kq8…", "amount": 49900, "currency": "INR", … } } } }Set up Razorpay webhooks in about 15 minutes
- 01In Relaya, create a webhook and pick Razorpay. Copy its URL.
- 02In the Razorpay Dashboard → Accounts & Settings → Webhooks → Add New Webhook, paste the URL as the Webhook URL.
- 03Set a secret there and enter the same secret in Relaya, so every request can be verified.
- 04Choose the events you need (for example
payment.captured,payment.failed,refund.processed) and save. - 05Add your own endpoint as a destination in Relaya. Events are forwarded there, signed by Relaya, with retries.
Then verify Relaya's signature in your endpoint and answer 2xx. The docs show how, with SDKs for Node, Python, PHP, Go and Java.
Razorpay events teams route through Relaya
| Event | What you usually do with it |
|---|---|
payment.captured | The money is yours: fulfil the order or activate the plan. |
payment.failed | Show the customer a retry option; useful for dunning. |
order.paid | An order is fully paid, even across several payment attempts. |
refund.processed | Update your ledger and tell the customer. |
subscription.charged | A recurring payment succeeded: extend access. |
Included for every Razorpay webhook
Verified on arrival
Every event on record
Forwarded with retries
Contract checks
Safe replay
Alerts
Razorpay webhooks: common questions
Which secret does Relaya need for Razorpay?
The webhook secret you type when you create the webhook in the Razorpay Dashboard. It is not your API key secret. Relaya encrypts it with a key unique to your organization.
Does Relaya stop duplicate Razorpay events?
Yes. Razorpay sends the same event ID on every retry (X-Razorpay-Event-Id). Relaya stores the first one and marks later copies as duplicates, so your endpoint handles each event once.
What if Razorpay changes a payload field?
Relaya learns the shape of each event type. If a field you marked critical goes missing or changes type (say amount arrives as a string), it opens an incident with every affected payment and alerts you.
Can I test without a real payment?
Yes. Every webhook in Relaya has a "Send a test event" button that sends a sample Razorpay event signed with your own secret, through the same checks as a real one.
Keep reading
Never miss a Razorpay event again.
Point your first webhook at Relaya today. Try the Team plan free for 7 days.