Invoices, Upgrades, Addons and Coupons in Subscription Billing
The problem
A customer pays ₹499 on the 1st. On the 16th they decide they want the bigger plan at ₹999. What do you charge them today?
Charging the full ₹999 feels greedy, since they already paid for half a month. Charging nothing until next month feels like giving the upgrade away. Charging ₹500, the difference, ignores that half the month is gone. The fair answer needs arithmetic, and the arithmetic needs rules everyone agrees on.
This part is about everything that changes the money on a subscription after it starts: the invoice behind each charge, plan changes with proration, add-ons, offers and coupons, one-off charges with payment links, refunds, and what actually reaches your bank after fees. It sticks to Razorpay's own docs and pricing pages, linked under Sources, and points out the places where those pages disagree with each other.
The ₹999 plan in this post is made up for the example. Two scripts in it were actually run on this VM, and their output is pasted as it came out.
Every charge has an invoice
Razorpay creates an invoice automatically for every charge on a subscription, including the authorisation transaction. Its "How Subscriptions Work" page describes each cycle like this:
- An invoice is generated at the start of the billing cycle for the plan and amount.
- A charge is attempted. The invoice sits in the
issuedstate. - If the charge works, the customer gets an email, the invoice moves to
paid, and theinvoice.paidwebhook fires.
There is one exception on the same page. A subscription with a future start date and no upfront amount, which is how a free trial works, sends no invoice for the authorisation step. That step is only the ₹5 token charge that gets refunded.
The invoice entity has more states than a subscription invoice usually touches. Razorpay's Invoices entity lists draft, issued, partially_paid, paid, cancelled, expired and deleted. For subscriptions the two you will see all the time are issued (waiting for money) and paid.
You can pull every invoice for one subscription with the "Fetch All Invoices for a Subscription" API, which takes a subscription_id. Each invoice has line_items, and each line item has a type of either plan or addon. Razorpay's own example: a subscription that starts now with an upfront fee has two line items, one for the plan and one for the fee.
A note on GST invoices
The invoice entity carries tax fields: the customer's gstin, and per line item hsn_code, sac_code, tax_rate and tax_amount. But Razorpay's Invoices API page has a handy tip that matters if you sell in India: "You can only create non-GST Invoices via APIs."
What a valid GST invoice must contain is a question for the tax rules, not for a payment gateway. We did not find a primary GST source we could cite within this series, so this post does not tell you what your invoice needs. Ask your accountant.
Changing the plan in the middle of a cycle
Razorpay lets you update a subscription that is active. Its Update page lists what you can change:
- the plan
- the quantity (for example, number of seats)
- the start date for the updated details
- the total count (how many cycles it runs)
- the offer linked to it
In the API, the update call takes plan_id, offer_id, quantity, remaining_count, start_at, schedule_change_at and customer_notify. There are also API calls to fetch the details of a pending update and to cancel one.
Two limits before you plan an upgrade flow:
- UPI subscriptions cannot be updated. Razorpay's FAQ says it directly: "you cannot update a Subscription authorised via UPI". It also says you cannot create an additional charge on one. Everything in this section applies to card subscriptions. For a UPI customer, a plan change means a new subscription.
- Only
activesubscriptions. A trial user sitting inauthenticatedis notactiveyet.
now or cycle_end
The schedule_change_at field takes one of two values:
| Value | What happens | Money adjustment |
|---|---|---|
now (default) | The change applies immediately | Prorated: a charge or a refund for the rest of the cycle |
cycle_end | The change waits until the current cycle ends | None. Razorpay says there is no need for any amount adjustment |
cycle_end is the calm option. The customer keeps what they paid for, and the new price starts on the next invoice. Downgrades usually want this. Upgrades usually want now, because the customer wants the bigger plan today.
When an immediate change costs more, Razorpay creates an invoice for the difference and charges it. If that charge fails, the subscription is not updated. Either way you hear about it through the subscription.updated webhook.
When an immediate change costs less, Razorpay refunds the difference using a credit note. A few details from the Update page:
- Credit notes are created against the total value of payments the customer made, not against one invoice. So there is only one credit note even if the refund spans several invoices.
- Credit notes are refunded automatically.
- A credit note is
createduntil the full refund is made, thenrefunded.
The proration rule, and Razorpay's own example
Razorpay's Update page gives the formula in a table. In plain words:
- Per day amount = (plan amount × quantity) ÷ days in the cycle
- Days charged = change day minus 1, "since customers are charged at the end of the day"
- Remaining days = days in the cycle minus days charged
- Remaining amount = old per day amount × remaining days. This is the credit for the unused part.
- If the billing frequency stays the same, the new charge is the new per day amount × remaining days.
- If the frequency changes, the new charge is the full new plan amount × quantity, since a new cycle starts.
- Difference = new charge minus remaining amount. Positive means charge, negative means refund.
Razorpay walks through a change from a yearly plan to a monthly one. The yearly plan is ₹10,950 for 365 days, so ₹30 a day. The customer switches on day 245 to a ₹21,900 monthly plan:
| Step | Value |
|---|---|
| Days charged | 245 minus 1 = 244 days |
| Remaining days | 365 minus 244 = 121 days |
| Remaining amount | ₹30 × 121 = ₹3,630 |
| New charge (frequency changed, so the full plan) | ₹21,900 |
| Difference | ₹21,900 minus ₹3,630 = ₹18,270, charged |
So the customer pays ₹18,270 today, and that is the number on Razorpay's page.
Running the numbers ourselves
To check we read the rule correctly, we wrote it as a small Python function, fed it five of Razorpay's published examples, and then our ₹499 to ₹999 case. It uses exact fractions so no rupee is lost to floating point. Razorpay does not say how it rounds paise, so the printout rounds the final figures to 2 decimals. That is our choice, not Razorpay's.
python"""Razorpay's documented proration rule for an immediate subscription update. From razorpay.com/docs/payments/subscriptions/update (Updated 2026-10-08): per-day amount = (plan amount x quantity) / days in the cycle days charged = change day - 1 (customers are charged at end of day) remaining days = days in cycle - days charged remaining amount = old per-day amount x remaining days Same billing frequency: new charge = new per-day amount x remaining days Different frequency: new charge = new plan amount x new quantity Difference = new charge - remaining amount (positive: charge, negative: refund) Razorpay does not document how it rounds paise. This script rounds the final difference to 2 decimals, which is our choice. """ from fractions import Fraction as F def prorate(old_amt, old_qty, cycle_days, change_day, new_amt, new_qty, same_freq=True): per_day_old = F(old_amt * old_qty, cycle_days) days_charged = change_day - 1 remaining_days = cycle_days - days_charged remaining_amt = per_day_old * remaining_days if same_freq: new_charge = F(new_amt * new_qty, cycle_days) * remaining_days else: new_charge = F(new_amt * new_qty) return days_charged, remaining_days, remaining_amt, new_charge, new_charge - remaining_amt def show(label, *args, **kw): dc, rd, ra, nc, diff = prorate(*args, **kw) kind = "charge" if diff > 0 else ("refund" if diff < 0 else "nothing") print(f"{label}") print(f" days used {dc}, days left {rd}, credit for unused old plan Rs {float(ra):,.2f}") print(f" new plan for the rest Rs {float(nc):,.2f} -> {kind} Rs {abs(float(diff)):,.2f}") if __name__ == "__main__": print("Razorpay's own examples, recomputed") show("Same frequency, ex 1: Rs 300 x1 -> Rs 150 x2, monthly (30 days), day 1", 300, 1, 30, 1, 150, 2) show("Same frequency, ex 2: Rs 300 x1 -> Rs 150 x2, monthly (30 days), day 15", 300, 1, 30, 15, 150, 2) show("Same frequency, ex 3: Rs 1000 x2 -> Rs 400 x1, 8-day cycle, day 6", 1000, 2, 8, 6, 400, 1) show("Different frequency, ex 2: Rs 10,950 yearly (365 days) -> Rs 21,900 monthly, day 245", 10950, 1, 365, 245, 21900, 1, same_freq=False) show("Different frequency, ex 3: Rs 300 monthly (30 days) -> Rs 900 x2 quarterly, day 27", 300, 1, 30, 27, 900, 2, same_freq=False) print() print("Our example: Rs 499/month -> Rs 999/month, 30-day cycle") for day in (2, 16, 30): show(f" change on day {day}", 499, 1, 30, day, 999, 1)
Output:
textRazorpay's own examples, recomputed Same frequency, ex 1: Rs 300 x1 -> Rs 150 x2, monthly (30 days), day 1 days used 0, days left 30, credit for unused old plan Rs 300.00 new plan for the rest Rs 300.00 -> nothing Rs 0.00 Same frequency, ex 2: Rs 300 x1 -> Rs 150 x2, monthly (30 days), day 15 days used 14, days left 16, credit for unused old plan Rs 160.00 new plan for the rest Rs 160.00 -> nothing Rs 0.00 Same frequency, ex 3: Rs 1000 x2 -> Rs 400 x1, 8-day cycle, day 6 days used 5, days left 3, credit for unused old plan Rs 750.00 new plan for the rest Rs 150.00 -> refund Rs 600.00 Different frequency, ex 2: Rs 10,950 yearly (365 days) -> Rs 21,900 monthly, day 245 days used 244, days left 121, credit for unused old plan Rs 3,630.00 new plan for the rest Rs 21,900.00 -> charge Rs 18,270.00 Different frequency, ex 3: Rs 300 monthly (30 days) -> Rs 900 x2 quarterly, day 27 days used 26, days left 4, credit for unused old plan Rs 40.00 new plan for the rest Rs 1,800.00 -> charge Rs 1,760.00 Our example: Rs 499/month -> Rs 999/month, 30-day cycle change on day 2 days used 1, days left 29, credit for unused old plan Rs 482.37 new plan for the rest Rs 965.70 -> charge Rs 483.33 change on day 16 days used 15, days left 15, credit for unused old plan Rs 249.50 new plan for the rest Rs 499.50 -> charge Rs 250.00 change on day 30 days used 29, days left 1, credit for unused old plan Rs 16.63 new plan for the rest Rs 33.30 -> charge Rs 16.67
All five of Razorpay's examples come out to the numbers on its page: ₹0, ₹0, a ₹600 refund, an ₹18,270 charge and a ₹1,760 charge. (We left out one example from the page, a daily to weekly switch, because its table gives the weekly plan a cycle of "1" day, which looks like a typo, and we did not want to guess what it meant.)
For our case, an upgrade on day 16 costs ₹250.00 today. The customer has used 15 days of the ₹499 plan, worth ₹249.50, so they get ₹249.50 of credit for the other 15. Fifteen days of the ₹999 plan cost ₹499.50. The gap is ₹250. Notice it is not ₹500, the naive "difference between plans", because half the month is gone.
Note the 30-day cycle. Razorpay's monthly examples use 30 days. Real months have 28 to 31, and the docs do not say which length Razorpay uses for a given month. Treat these as the formula applied to a 30-day month.

Add-ons: deprecated, and also documented
Here is a contradiction worth knowing before you build on it.
Razorpay's Subscriptions FAQ has a one line answer: "Why am I unable to use Add-ons? You are unable to use the Add-Ons feature since it is deprecated."
Meanwhile, Razorpay's Subscriptions API reference (updated 2026-12-04, the day before this post was researched) still documents a full add-on API: create an add-on on a subscription, fetch all add-ons, fetch one by ID, and delete one. Per that page, an add-on charges the customer an extra amount for one billing cycle. It is added to the next invoice generated, its invoice_id stays null until then, and once it is linked to an invoice it cannot be deleted. The amount is amount × quantity.
There is also an addons field on Create Subscription, but that one means something else: an upfront amount collected with the authorisation transaction, like a delivery or setup fee.
So which is it? Our reading: if the API works on your account, Razorpay's own FAQ says it is on its way out, so do not build a product around it without asking Razorpay support first. If you need a one-off extra charge, the payment links below are the documented path that is not marked deprecated.
Offers and coupons
Razorpay calls subscription discounts Offers. Per its About Offers page (India only):
- Offers are created from the Dashboard, then linked to a subscription with an
offer_id. - Discounts are either flat or percentage.
- They can apply to cards, UPI or both. For cards you can narrow by credit or debit, issuing bank, network or card IINs.
- There are three types: single use (one time), limited number of cycles (Razorpay's example is the first 3 cycles of a 12-month subscription) and forever.
- You can set start and end dates, a max usage count (for example the first 100 customers) and what happens if validation fails: let the customer pay without the offer, or block the payment.
Coupon codes sit on top of offers. Razorpay's coupon page describes two kinds:
| Coupon type | How it works | Who creates it |
|---|---|---|
| Generic | One public code like SAVE10 that any customer can use. Listed on checkout. | You, from the Dashboard |
| Personalised | A set of unique private codes, each usable once. Not listed on checkout. | Razorpay, when you ask support |
Generic codes must be 4 to 20 characters of letters, numbers and underscores, unique across your active offers, and are not case sensitive. On checkout the customer sees the amount charged now and the amount charged in each later cycle.
One error to expect: "Offer not applicable for this Subscription" means the plan amount is below the minimum set for the offer.
Payment links for one-time charges
Sometimes you just need to collect money once: a setup fee after the fact, a past due invoice on a UPI subscription you cannot charge manually, or a one-off extra. Razorpay Payment Links handle that without a website. Per the About Payment Links page:
- You create a link from the Dashboard or the API and share it by email, SMS or social media.
- You can set an expiry date, allow partial payments, and send automated SMS reminders.
- Customers can pay by card, UPI, netbanking, wallet, EMI, Pay Later or bank transfer.
A payment link is not a mandate. It is a single payment the customer approves by hand. That makes it a good escape hatch and a bad renewal engine.
Refunds
Two refund speeds exist on Razorpay, per its Set Refund Speed page (India):
- Normal: the
speedattribute isnormal, and customers get the refund within 5 to 7 business days. - Instant: the
speedisoptimum. Razorpay tries to send the money using IMPS, NEFT or UPI, and if that does not work it falls back to normal speed.
You set a default speed in the Dashboard and can override it per refund. Remember from earlier that refunds created by a downgrade go out through a credit note, automatically.
What reaches your bank
Once a renewal succeeds, the money still has to travel to you. That last hop is settlement, and Razorpay's own pricing page tells two stories about how long it takes:
- The settlement section says standard settlement is T+2 working days, not on bank holidays, with same day and instant settlement as other options.
- The FAQ further down the same page says the remaining amount is settled "according to your settlement cycle (typically T+1 or Instant)".
Razorpay's pricing blog sides with the first: domestic payments "typically, T+2 business days". Our advice: the cycle that counts is the one shown on your own account, which is also what the pricing blog tells merchants to use.
Fees come out before settlement. The pricing page says the transaction fee and GST are deducted from the payment at source. Here are the published standard numbers:
- Platform fee: 2% + GST per successful domestic transaction (pricing page).
- Subscription fee: Razorpay's pricing blog says Subscriptions add a "0.99% (approx. 1%) subscription fee per transaction", on top of the payment method fee.
- GST: 18%, on the fee only, not on the transaction value (pricing blog).
You will see "0.9% + platform fee" quoted on other sites. We did not find 0.9% on any razorpay.com page we opened, so we use the 0.99% from Razorpay's own blog. And note the blog's offer for new merchants activated on or after 1 July 2026: 0% platform fee on domestic payments for up to 90 days or ₹5 lakh, whichever comes first, with GST still applying and a ₹199 KYC fee.
Here is one ₹499 renewal at those standard rates:
python"""What lands in the bank from one Rs 499 renewal, using Razorpay's own published rates. Sources (fetched 2026-12-05): - razorpay.com/pricing: standard platform fee 2% + GST per successful domestic transaction. - razorpay.com/blog/razorpay-payment-gateway-pricing-explained: Subscriptions add a 0.99% subscription fee per transaction on top of the payment method fee; 18% GST applies to the fee, not to the transaction amount. Your real rate depends on your account, agreement and any offer (for example the 0% platform fee offer for new merchants), so treat this as a worked example. """ from decimal import Decimal as D, ROUND_HALF_UP def r(x): return x.quantize(D("0.01"), rounding=ROUND_HALF_UP) amount = D("499") platform = amount * D("0.02") subs_fee = amount * D("0.0099") gst = (platform + subs_fee) * D("0.18") net = amount - platform - subs_fee - gst print(f"Customer pays Rs {r(amount):>7}") print(f"Platform fee 2% Rs {r(platform):>7}") print(f"Subscription fee 0.99% Rs {r(subs_fee):>7}") print(f"GST 18% on the fees Rs {r(gst):>7}") print(f"Settled to merchant Rs {r(net):>7}") print(f"Total cost {r((amount - net) / amount * 100)}% of the charge")
textCustomer pays Rs 499.00 Platform fee 2% Rs 9.98 Subscription fee 0.99% Rs 4.94 GST 18% on the fees Rs 2.69 Settled to merchant Rs 481.39 Total cost 3.53% of the charge
So about ₹17.61 of every ₹499 renewal goes to fees and GST at the published standard rates, and ₹481.39 is what the settlement should carry. Your contract may differ, so check it against a real settlement report before you put this in a spreadsheet.

Putting the whole money path in one picture:
flowchart LR I[Invoice issued for the cycle] ==> C{Charge} C ==>|success| P[Invoice paid, invoice.paid webhook] C ==>|fails| R[Retries, see Part 5] U[Immediate upgrade] ==> X[Extra invoice for prorated difference] X ==> C D[Immediate downgrade] ==> N[Credit note, refunded automatically] P ==> F[Fees and GST deducted at source] F ==> S[Settlement to merchant bank, T+2 standard per pricing page] O[Offer or coupon] -.->|lowers amount| I L[Payment link] ==>|one-off, customer approves| F
What's next
You now know what Razorpay does with money: retries, invoices, prorations, credit notes and settlements. Next, we look inside an open source billing engine to see how it implements the same ideas in real code, with file paths you can open yourself: how an open source billing engine works inside.
Sources
- Update a Subscription, Razorpay Docs (updated 2026-10-08)
- Subscriptions API (plans, update, invoices, add-ons), Razorpay Docs (updated 2026-12-04)
- Create a Subscription API, Razorpay Docs (updated 2026-10-08)
- How Subscriptions Work, Razorpay Docs (last modified October 8, 2026)
- Subscriptions FAQs, Razorpay Docs (updated 2026-12-04)
- Invoices Entity, Razorpay Docs (last modified November 27, 2026)
- Invoices API, Razorpay Docs (updated 2026-10-14)
- About Offers, Razorpay Docs (last modified November 25, 2026)
- Coupon Codes on Subscription Offers, Razorpay Docs (last modified November 25, 2026)
- About Payment Links, Razorpay Docs (last modified October 8, 2026)
- Set Refund Speed, Razorpay Docs (last modified October 8, 2026)
- Payment Gateway Charges, Razorpay pricing page
- Razorpay Payment Gateway Pricing and Fees Explained, Razorpay blog
