Skip to content
Sonic AI

Stripe and Razorpay payment links on invoices

How Stripe and Razorpay payment links on invoices work: hosted checkout, the webhook that marks invoices paid, and why payouts still need bank matching.

Lokesh Mahala

Lokesh Mahala, CEO & Co-founder

· Updated · 3 min read

An invoice with a blue pay button linked to a checkout page holding a payment card.
On this page

A payment link on an invoice sends the customer to Stripe's or Razorpay's hosted checkout page. When the processor confirms the payment, it notifies Sonic through a webhook, the invoice is marked paid and its reminders stop. The links are optional: customers who pay by bank transfer are matched through bank reconciliation instead.

Card payments run through Stripe and Razorpay, so payment relationships stay where customers already have them while the accounts receivable loop closes inside contract-to-cash. For the wider picture, see connecting payments and the ledger.

CapabilityStripeRazorpay
Hosted payment pageYesYes (UPI, card, netbanking, wallet)
Invoice email linkYesYes
Auto mark paidVia webhookVia webhook
Customer id storedStripe customer on Sonic customerRazorpay linkage
Refunds from credit flowSupported pathSupported path

Default currency and enabled methods follow your processor account configuration. Customers see exactly the methods you turned on in Razorpay.

How to set up the webhook that marks invoices paid

Connecting a processor account and setting a default currency are the parts everyone remembers. The webhook endpoint registration in the processor's own dashboard is the part that gets skipped. Skipping it raises no error. Invoices simply stay open after the money has arrived, because Sonic never heard about the payment.

Run one full test end to end before you trust the integration with a real customer's invoice: draft an invoice, pay it with test keys, and confirm it flips to paid and collections stops chasing it. Live keys in a sandbox environment charge real cards, so keep test and production credentials in the environments they belong to.

From the customer's side this is simple: if the invoice has a pay-now link, they pay on the processor's hosted page and that's the last they think about it. What happens next is on Sonic's side. The processor notifies Sonic of the payment, the invoice flips to paid, and the dunning sequence for that invoice stops on its own.

The payout, the actual money landing in your bank account, happens later and separately. That's why bank reconciliation still matters even for card payments.

Customer-facing invoices show the public invoice number, never a raw internal id with a decorative prefix.

Why processor payouts don't match invoice totals

Processor settlements arrive:

  • Net of fees
  • Batched across many charges
  • Sometimes delayed vs charge date

Bank reconciliation matches payout lines to invoices and records the fee gap as variance. Don't expect a deposit to equal the invoice total. The bank reconciliation matching guide shows how payouts and split deposits are matched.

For Indian customers reclaiming input tax credit, the GST details on Sonic invoices and Razorpay receipts should agree. A mismatch blocks their input credit claim. This is general information. Confirm the GST treatment for your business with your tax adviser.

  • Store PAN/card data as a processor replacement
  • Dispute chargebacks inside Sonic as a full payments ops desk
  • Replace treasury cash forecasting on settlement timing

Watch out for: paid in the bank, open in Sonic

  • Webhook misconfiguration is the #1 "paid in bank, open in Sonic" bug.
  • Mark paid manually is still valid for wires. Links are not the only path.
  • Partial processor captures follow processor rules; AR may need partial match in bank rec.
  • Freight and subscription invoices both support links. The bill-to party is still the shipper or the customer, depending on the workspace.
  • Test in browser, not raw curl. Some processors' anti-bot checks block scripted posts.
Lokesh Mahala

Written by

Lokesh Mahala

CEO & Co-founder, Sonic AI · LinkedIn

Lokesh is the Cofounder & CEO of Sonic AI. Before starting Sonic, Lokesh was an engineer at Stripe for 4 years building Stripe's Revenue and Finance Automation suite. He was a founding engineer at Recko (acquired by Stripe in 2021) where he built reconciliation solutions for B2C companies. He completed his bachelors from IIT Roorkee.

FAQ

How do I add a payment link to an invoice?

Connect your Stripe or Razorpay account, set a default currency, and register the webhook endpoint in the processor's own dashboard. Invoices can then carry a pay-now link to the processor's hosted checkout page. The link is optional, so customers who prefer bank transfer can still pay that way and be matched through bank reconciliation.

Why is an invoice still open after the customer paid by card?

Almost always because the webhook isn't registered, or points at the wrong environment. The processor captured the payment but never told Sonic, so the invoice stays open and reminders keep going. Check the webhook endpoint in the processor's dashboard, then run a test payment with test keys and confirm the invoice flips to paid.

Why doesn't my Stripe or Razorpay payout match the invoice total?

Processor payouts arrive net of fees, batched across many charges, and sometimes days after the charge date. One deposit can settle dozens of invoices minus the processor's fee. Match the payout lines to the invoices and record the fee gap as variance, rather than treating it as a customer shortfall.

Can a Razorpay payment link accept UPI?

Yes. Razorpay's hosted payment page can offer UPI, cards, netbanking and wallets, depending on which methods are enabled on your Razorpay account. The methods a customer sees on the link are exactly the ones you turned on in Razorpay.

See Sonic run on one of your contracts.

A 30-minute call with the team, using your own contract.

Book a demo