CyberFreezeDev Loading
  1. Home
  2. Integrations
  3. Razorpay

Razorpay payment webhooks wired into your CRM, books and WhatsApp

Razorpay payment events mark invoices paid, update the deal and thank the customer on WhatsApp.

3D render of matte white server racks with violet status lights under an overhead cable tray

At a glance

Razorpay integration
Payment events
payment.authorized, payment.captured, payment.failed, order.paid
Payment link events
payment_link.paid, partially_paid, expired, cancelled
Refund events
refund.created, refund.processed, refund.failed
Signature
X-Razorpay-Signature, HMAC SHA256 of the raw body with your webhook secret
Deduplication
x-razorpay-event-id, unique per event
Delivery rule
2XX within 5 seconds; retries for 24 hours, then the webhook is disabled

What Razorpay payment webhook automation does

The payment is already collected. The integration makes sure everything that should follow it actually happens.

Each payment event updates the right invoice, deal or order, matched by your own reference passed into Razorpay, not guessed by amount.

Read more about What Razorpay payment webhook automation does

Without an integration, someone checks the Razorpay Dashboard, finds a payment, works out which invoice or order it belongs to, marks it paid somewhere else and sends a thank you message by hand. Razorpay payment webhook automation does that the moment the event arrives. A captured payment closes the matching invoice and moves the deal in your CRM. A failed payment sends a retry link. A refund updates the order and tells support.

The trick is tying each payment to the right record. We pass your own reference (an invoice number, order id or lead id) into the Razorpay order or payment link notes or reference_id when it is created, so the webhook that comes back can be matched without guessing by amount.

Typical flows we build

Payment links sent on WhatsApp

Invoices create Payment Links sent on WhatsApp, with a receipt message once paid.

Read more about Payment links sent on WhatsApp

An invoice or quote creates a Payment Link through POST /v1/payment_links with your reference attached, and the link goes to the customer as a WhatsApp utility template through our WhatsApp integration. When payment_link.paid arrives, a receipt message follows. See the Payment Links API and payment link events.

Captured payment to CRM and books

A captured payment marks the invoice paid and moves the deal to won.

Read more about Captured payment to CRM and books

On payment.captured or order.paid we mark the invoice paid, move the opportunity to won in Desk or your CRM, and write the payment where your accountant will see it. order.paid carries both the order and payment entities, so it is often the simpler event to act on. See payment events.

Failed payment follow-up

The customer gets a fresh link and the account owner is told.

Read more about Failed payment follow-up

A payment.failed event sends the customer a fresh link and tells the account owner, instead of the failure sitting unseen in the Dashboard.

Refunds that close the loop

Refund events update the order and customer, and failed refunds become tasks.

Read more about Refunds that close the loop

refund.created and refund.processed update the order status and the customer record, and refund.failed raises a task for a person. See refund events.

Settlement reconciliation

Each settlement split into payments, refunds and fees, then matched to the bank credit.

Read more about Settlement reconciliation

Razorpay settles in batches net of its fees and GST on those fees. We break each settlement into the payments, refunds and fees inside it and match it to the bank credit, so the books agree. This is a common job for online stores.

How each webhook is handled

  1. 01 Keep the raw body

    The endpoint reads the raw body before parsing, because the signature covers it.

    Read more about Keep the raw body

    Razorpay's signature is computed over the raw request body, so the endpoint reads it before any JSON parsing. See validate and test webhooks.

  2. 02 Verify the signature

    An HMAC SHA256 check against your webhook secret; mismatches are rejected and logged.

    Read more about Verify the signature

    We compute HMAC SHA256 of the raw body with your webhook secret and compare it with X-Razorpay-Signature. A mismatch is rejected and logged.

  3. 03 Answer within 5 seconds

    Store the event and return 200 at once, or Razorpay retries and eventually disables it.

    Read more about Answer within 5 seconds

    The handler stores the event and returns 200 at once. Razorpay treats anything else, or a timeout, as a failure and retries with back off for 24 hours before disabling the webhook.

  4. 04 Process once, in any order

    Each event id runs once, and status is checked before any change.

    Read more about Process once, in any order

    Delivery is at least once and events can arrive out of order, so each x-razorpay-event-id is processed once, and state changes check the current status before applying.

Where it fits with our products and services

Paid invoices and won deals land in Desk or WhatsApp CRM, settlements are matched in Fint or Tally, and Shopify orders follow the same events.

Read more about Where it fits with our products and services

Paid invoices and won deals land in Desk. For WhatsApp sales teams, a payment can mark a lead won in WhatsApp CRM. If your books are in Fint, the settlement credit on your bank statement is matched to invoices there and a person confirms each match; if they are in Tally, see our Tally integration. For stores, the same events feed the order flow on Shopify. Most of these flows run on n8n on a server you control.

What we need from you, and the limits

A KYC-complete Razorpay account and API keys you generate. Secrets stay with you, and refunds and payouts stay with your team. We are not a Razorpay partner.

Read more about What we need from you, and the limits

A Razorpay account in your business name with KYC complete, API keys generated by you (test mode first, live mode at go live), and permission to add a webhook URL in the Dashboard. The webhook secret and API keys stay in your secrets store; we never ask for your Razorpay login password. Webhook URLs must be on port 80 or 443 with TLS 1.2 or later, and if your server has a firewall we allow Razorpay's published webhook IPs.

We are not a Razorpay partner, and we do not touch money: refunds and payouts are started by a person in your team unless you decide otherwise in writing. Razorpay's own fees and settlement timing are set by Razorpay under your agreement with them.

Questions

Should we act on payment.captured or order.paid?

If you create Razorpay orders, order.paid is usually simpler because it carries the order and the payment together. With payment links, payment_link.paid is the event to use. We pick one per flow and ignore the overlap.

Why not just use the redirect after checkout?

Razorpay says the checkout callback_url is for the customer's browser, not for tracking payment status on your server. A closed tab or lost connection means a missed update. Webhooks arrive regardless.

What happens if our server is down?

Razorpay retries for 24 hours. If failures continue, it disables the webhook and emails your alert address. Our monitoring tells you before that point, and a catch up job fetches any payments missed.

Can you reconcile Razorpay settlements with Tally?

Yes. Settlement lines are broken down and posted to TallyPrime as vouchers for your accountant to review. See GST and accounting automation.

Do you store card details?

No. Card and UPI details stay with Razorpay. Our integrations see payment ids, amounts, status and the references you passed in.

Last updated