How we turned messy SMB invoices into audited GST ledgers — and survived a shared payments account
A GST invoicing and accounting product for Indian SMBs that converts noisy bills into clean, GSTR-1-ready ledgers, with UPI collection on invoices and a multi-tenant payments architecture hardened against cross-brand webhook bleed.
Visit the live productThe problem
Indian SMBs live in a swamp of inconsistent invoices and bills — different formats, missing fields, ad-hoc line items — and yet they are accountable for clean, filing-ready GST records. The accounting they actually need is the boring, audited kind, but the input they have is messy and human.
They also need to get paid. An invoice that the customer can pay over UPI in one tap collects faster than a PDF emailed into a void, so payment collection had to be a first-class feature of the invoice itself, not a separate step.
And because this product is one of several GrahAI properties, it inherited a non-obvious infrastructure constraint: all of them share a single Razorpay merchant account, which turns naive webhook handling into a correctness and privacy hazard.
The architecture
- Next.js + Firebase for the app, auth and data, with a multi-business model so one operator can run several legal entities under one login.
- AI-assisted line items turn messy bill text into structured invoice lines, feeding a ledger that exports cleanly to GSTR-1.
- UPI pay-collection is attached to invoices so the customer settles directly from the invoice, plus recurring invoices for repeat billing.
- Razorpay handles both one-time orders and recurring subscriptions; a trial → premium conversion engine (plan logic, plan banners, in-app upgrade, invoice paywall) drives monetization.
- Webhooks are brand-guarded on Razorpay notes so events for one product are ignored by the others that share the same account.
The AI stack
Engineering challenges
One Razorpay account, many products — webhook bleed
Because all GrahAI products share a single Razorpay merchant account, every payment event is delivered to every product’s webhook URL. Without a guard, AasanKhata would react to — and email — a buyer who actually purchased a sibling product, a real privacy and correctness failure. We fixed it by brand-guarding each webhook on notes.product_brand so a handler only acts on its own product’s events.
Messy input, audited output
GST records have to be precise, but the source documents are not. We use AI to structure line items from noisy bills, then run that structured data into a ledger designed around GSTR-1 export so the output is filing-shaped rather than a freeform note. The AI handles the fuzzy parsing; the ledger enforces the rigor.
Collecting payment without leaving the invoice
Adding UPI collection onto the invoice itself, alongside recurring invoices, removes the friction step where SMB receivables usually stall — the customer pays from the same artifact they received, instead of being routed to a separate checkout.
Converting trials without nagging
A trial → premium engine with plan-aware banners, an in-app upgrade path and an invoice paywall nudges conversion at the moment of value (when the user actually needs the gated export or limit), rather than via blunt time-based prompts.
The result
- Noisy invoices become clean, GSTR-1-ready ledgers fit for filing.
- On-invoice UPI collection shortens the receivable cycle for SMB operators.
- Multi-business support lets one operator run several entities under one login.
- Shared-account webhooks are isolated per brand, eliminating cross-product mis-emails.
Lessons we'd bring to your build
- When document AI feeds compliance, split responsibilities cleanly: let the model do fuzzy parsing, let a strict schema/ledger enforce correctness.
- Shared payment infrastructure is a multi-tenant problem — every webhook must positively identify its own events or it will act on a sibling’s.
- Put payment where the value is (on the invoice), not in a separate flow, to cut the friction that stalls collections.
- Time conversion prompts to the moment of need (paywall at the gated action), not to a calendar.
Planning something like this?
We bring the same production discipline to client builds. Tell us the problem you're solving and we'll map an approach.
Book a discovery call