How to connect Razorpay to the WhatsApp Business API
Sending a Razorpay payment link over WhatsApp turns a chat into a checkout — the customer taps a button in the same thread where they asked about your product and pays without leaving the app. This guide walks through wiring Razorpay to the official WhatsApp Business API through InfiQ: generating links, delivering them inside an approved template, and catching the paid/failed webhook so you can auto-send a receipt. It assumes you already have an active WhatsApp Business API account and a live Razorpay account; everything else is covered below, including the mistakes that quietly break payment flows.
What you'll do
Generate a Razorpay Payment Link (via dashboard or API), drop the short URL into an approved WhatsApp utility template, send it through InfiQ, and listen for Razorpay's payment.captured webhook to fire an automatic confirmation message — all inside one WhatsApp thread.Step 1 — Get your Razorpay keys and confirm both accounts are live
Before any message goes out, make sure the two systems you're joining are ready. On the Razorpay side you need API credentials and a live account; on the InfiQ side you need a verified WhatsApp Business API number with a green quality rating. Grab these first so you're not switching tabs mid-setup.
- In the Razorpay Dashboard, go to Account & Settings > API Keys and generate a Key ID and Key Secret (use Live mode keys, not Test).
- Confirm your Razorpay account has completed KYC — payment links will not activate otherwise.
- In InfiQ, verify your WhatsApp Business API number is connected, verified, and showing a healthy quality rating.
- Decide who sends the link: the Razorpay dashboard (manual/no-code) or your backend via the Payment Links API (automated).
Step 2 — Create the Razorpay Payment Link
A Payment Link is a short, self-contained checkout URL Razorpay hosts for you — no gateway integration on your website required. You can create one by hand for a single invoice, or generate them programmatically so every order gets its own link. For WhatsApp, the key detail is that you want the short URL Razorpay returns, and you want to prefill the customer's phone and amount so the checkout feels finished, not generic.
- No-code: Dashboard > Payment Links > Create Payment Link, enter amount, description, and customer details, then copy the generated short_url.
- API: POST to /v1/payment_links with amount (in paise), currency INR, and a customer object — Razorpay returns a short_url in the response.
- Set reference_id to your own order or invoice number so you can reconcile the payment later.
- Enable 'Send notification' off if InfiQ is delivering the message — you don't want Razorpay double-sending an SMS.
Step 3 — Build and approve the WhatsApp template that carries the link
You cannot paste a raw payment link into WhatsApp business-initiated messaging without an approved template. The right choice here is a Utility template, because sending a payment request tied to a specific order is a transactional event, not promotion — and utility messages are cheaper to deliver than marketing ones. Put the Razorpay short URL in a variable and, ideally, in a URL button so the customer taps rather than copies. Keep the copy transactional; anything that reads like an upsell risks a Marketing reclassification or rejection.
- In InfiQ, create a template under the Utility category with variables for customer name, order number, and amount.
- Add a dynamic URL button and map its variable to the Razorpay short_url.
- Avoid promotional phrasing ('special offer', 'buy now') — describe the specific transaction instead.
- Submit for Meta approval; utility templates are usually reviewed quickly, but leave buffer before a launch.
Step 4 — Send the payment message through InfiQ
With the template approved, sending is a matter of passing the customer's number and the variable values — including the freshly generated Razorpay link — to the template. You can trigger this from InfiQ's dashboard for one-off sends, from a no-code flow when an order is created, or from the API for high volume. Remember the billing model: WhatsApp charges per delivered message by category, so each utility payment message is billed at the utility rate, shown in InfiQ as transparent ₹ pricing (ex-GST). There's no per-conversation bundle to reason about — it's per delivered message.
- Populate the template variables: {{1}} name, {{2}} order number, {{3}} amount, and the button URL with the short_url.
- For automation, call InfiQ's send API right after your order-created event so the link is fresh.
- Test to your own number first and tap the button to confirm it opens the correct Razorpay checkout.
Step 5 — Listen for payment status and auto-confirm
The flow feels complete to the customer only when they get a confirmation the moment they pay. Razorpay pushes webhooks for events like payment.captured (success) and payment.failed. Point that webhook at your backend (or an InfiQ automation), match the reference_id back to the order, and fire a second WhatsApp message — a receipt on success, or a gentle retry link on failure. This closes the loop entirely inside one thread.
- In Razorpay Dashboard > Settings > Webhooks, add your endpoint URL and subscribe to payment.captured and payment.failed.
- Verify the X-Razorpay-Signature header on every webhook so you only trust genuine events.
- On payment.captured, send a Utility confirmation template with the amount and reference_id.
- On payment.failed, optionally re-send the payment link so the customer can retry without leaving WhatsApp.
Tips and common mistakes to avoid
Most Razorpay-on-WhatsApp problems are not integration bugs — they're template and timing issues. The recurring failures are choosing the wrong template category (which raises cost or gets the template rejected), letting a payment link expire before the customer opens it, and skipping webhook signature verification. A little discipline up front keeps delivery rates high and reconciliation clean.
- Don't use a Marketing template for a payment request — Utility is correct and costs less per delivered message.
- Regenerate the link per order; never reuse one link for multiple customers or you can't reconcile payments.
- Always verify the webhook signature — an unverified endpoint can be spoofed into sending false 'paid' confirmations.
- Set a sensible link expiry and handle the expired state, so a customer who pays days later doesn't hit a dead page.
- Never send unsolicited payment links — the customer must have opted in and be expecting the transaction.
Frequently asked questions
Can I collect a Razorpay payment entirely inside WhatsApp?+
Which WhatsApp template category should a payment link use?+
How is this billed?+
Do I need a developer to set this up?+
How do I automatically send a receipt after payment?+
Why did my payment template get rejected?+
Can I reuse one payment link for several customers?+
How long does the whole setup take?+
Turn WhatsApp chats into paid orders
Talk to InfiQ's India-based team and get Razorpay payment links, approved templates, and auto-confirmations live on the official WhatsApp Business API — with transparent ₹ pricing and full BSUID ownership.