Guides · Razorpay
Get a Mac notification for every Razorpay payment
Razorpay posts a webhook the moment a payment is captured or fails, an order is paid or a refund goes through. Point one at EventBar and each one pops up in your menu bar, with this week's count of captured payments a glance away, without keeping the Dashboard open.
Needs: the free EventBar app on your Mac, an EventBar account, and a Razorpay account with access to Accounts & Settings in the Dashboard. About five minutes. Razorpay preset, signature verified.
Steps
- Create the webhook URL. In the EventBar dashboard, open the Webhooks tab, pick the group this belongs to (one group per site or app is the usual shape), choose the provider Razorpay, name it, and press Create. Copy the URL; it stays visible and can be rotated any time.
- Paste it into Razorpay. In the Razorpay Dashboard, first pick Test mode or Live mode, since each has its own webhooks. Then Accounts & Settings, and under Website and app settings, Webhooks, then + Add New Webhook. Paste the URL, type a Secret of your own (Razorpay doesn't generate one, and it should not be your API key secret), add an Alert Email, tick the Active Events you want, such as
payment.captured,payment.failed,order.paidandrefund.processed, and press Create Webhook. Paste the same secret into the hook card in EventBar. - Trigger one. Most services offer a test delivery; otherwise do the real thing once. It shows up in the dashboard's Events tab within a second and in the menu bar, as an undefined type named after the event. That first one is your proof the wiring works.
- Make it read well. Press Define on the new type and give it a title and a body template. Fields come from the payload, nested ones with dots. The table below is a starting point.
This preset is on Plus and Pro. Free can do the same with a Generic JSON hook and a type field of event, without the signature check, but a retried delivery can count twice: Razorpay sends its event id only in a header, which a Generic JSON hook doesn't read.
What you'll see
| Type | Title | Body template |
|---|---|---|
payment.captured | Payment | {payload.payment.entity.amount} {payload.payment.entity.currency} · {payload.payment.entity.method} · {payload.payment.entity.email} |
payment.failed | Payment failed | {payload.payment.entity.amount} {payload.payment.entity.currency} · {payload.payment.entity.error_description} |
order.paid | Order paid | {payload.order.entity.amount_paid} {payload.order.entity.currency} · {payload.order.entity.receipt} |
refund.processed | Refund | {payload.refund.entity.amount} {payload.refund.entity.currency} · {payload.refund.entity.payment_id} |
Every type has its own switch in the menu bar, so a noisy one can be quiet on this Mac and still counted. Counts cover the last hour, 24 hours, 7 days, 30 days and all time.
Worth knowing
- The type is the event's
event, sopayment.capturedandpayment.failedeach get their own switch and count. A payment with an order fires bothpayment.capturedandorder.paid; tick one of them, or mute one from the menu bar, if you don't want to hear about each sale twice. - Amounts are in the currency's smallest unit (paise for INR, so
50000is 500.00 rupees), as Razorpay sends them; a template can't divide. - The signature is
X-Razorpay-Signature, a hex HMAC-SHA256 of the raw body keyed with the webhook's secret, the same check asverifyWebhookSignaturein Razorpay's SDKs. Razorpay signs no timestamp, so there is no clock window to worry about. If you change the secret in Razorpay, change it in EventBar too: retries of older events stay signed with the old one. - Duplicates are dropped by the
X-Razorpay-Event-Idheader, which Razorpay says is unique per event. Delivery is at least once: a failed delivery, or one not answered within five seconds, is retried with exponential backoff for 24 hours, so a retry never counts twice. A webhook that keeps failing for 24 hours is disabled until you turn it back on. - Razorpay doesn't promise order: a
payment.failedcan be followed by apayment.capturedfor the same payment when the customer retries, for example with UPI. Each still shows as it arrives. - Test mode and Live mode have separate webhooks, so make two hooks in two groups if you want both. The secret is optional in Razorpay, but without it EventBar can't tell a forged delivery from a real one.
The full contract, including how each preset reads a payload and what the answers mean, is in the API docs. Something about Razorpay's payload changed? Tell us and we'll fix the guide.