Razorpay integration that matches payments to invoices
A Razorpay integration should record each payment once, against the right invoice.
Reviewed by: Rahul Jaiswar, founder
What Razorpay is
Razorpay is an Indian payment gateway for UPI, cards, net banking and wallets. Its APIs cover orders, payment links, subscriptions and refunds, and it reports payment results to your server by webhook.
How we use it
Microsive ATS uses Razorpay for payments, with GST invoices (Microsive ATS). We can also build e-commerce stores with Razorpay payments and order management (websites), and add payments to custom web apps (web apps).
When it fits
- Customers pay in rupees and expect UPI beside cards.
- Payments must match invoice numbers and GST details.
- You bill repeatedly through subscriptions or payment links.
When it doesn’t
- Most buyers are abroad. Check international card acceptance and settlement on your account, or pair Razorpay with a provider built for overseas payments.
- Money splits between sellers. Marketplace payouts need extra gateway products and account approval; plan them at the start.
- A handful of payments a month. Payment links sent by hand may do.
Five questions for your developer
- How does the server confirm a payment, instead of trusting the browser?
- What happens if the same webhook arrives twice?
- How do refunds and failed payments show in our records?
- How do payments match invoice numbers and GST details?
- How are test keys and live keys kept apart?
Webhooks and other pitfalls
- Verify the signature. A webhook is only a message claiming something happened. Check its signature with your secret before any record changes.
- Expect duplicates. Providers retry, so the same event can arrive twice. Handle it so a second copy changes nothing.
- Don’t trust the redirect. A browser landing on a “success” page proves nothing; mark an order paid only after the server confirms the payment with Razorpay.
- Authorised is not captured. Money held on a card differs from money collected, and order status should follow the real state.
- Activation takes time. Live payments need the Razorpay account activated after document checks, so start early and build on test keys meanwhile.
Refunds and reconciliation
Plan refunds as part of the build, not as a manual step for later. A refund should update the order and the invoice record, and a partial refund should show the amount that remains paid. Compare Razorpay’s settlement reports with your own records on a schedule, so a missed webhook shows up as a mismatch within days rather than at year end.
See also
Payments not matching your invoices?
Share where customers pay today and how your team reconciles it. Someone from our team replies within one business day.