Overview
A subscription plan is a recurring product owned by a tutor or institution. A student who subscribes gets unlimited enrolment access to that owner's batches for the duration of the subscription.
Billing runs through Razorpay Subscriptions. The actual recurring charge, retry logic, and dunning are handled by Razorpay; Tuition.in listens to webhook events to keep subscription status in sync.
Creating a plan
- Open Tutor dashboard → Subscriptions → New plan.
- Fill in
name(e.g. "All-Access Annual"),priceMonthlyInr, and optionallypriceAnnualInr. - Add a description and a feature list (string array).
- Save.
Monthly vs annual
priceMonthlyInr is required. priceAnnualInr is optional — if set, the student sees both options at checkout and picks one. Common pattern: annual = 10× monthly (2 months free).
On annual subscriptions, Razorpay charges once and renews yearly. Monthly auto-renews every month until cancelled.
Plan features
features is a string array shown as a bullet list on the plan page. Example:
features: [ "Unlimited access to all batches", "Live class replays", "Weekly DPP", "Mock test series included", "Direct WhatsApp support", ]
Use them to sell — keep them concrete and concise.
Razorpay subscription flow
- Student clicks Subscribe on a plan page.
- Tuition.in creates a Razorpay customer (if not exists) and a subscription against the plan.
- The student is redirected to Razorpay's checkout to authorise the mandate (eMandate / card).
- On successful authorisation, the first charge runs immediately.
- Razorpay POSTs a
subscription.activatedwebhook → Tuition.in marks the local subscriptionACTIVE.
Webhook events
Configure the Razorpay dashboard to POST to /api/webhooks/razorpay-subscription. Events handled:
subscription.activated— mark local sub ACTIVE, grant enrolment access.subscription.charged— record successful renewal, extend access until next cycle.subscription.cancelled— mark CANCELLED but keep access until paid-through date.subscription.completed— terminal state at end of paid period; revoke access.subscription.pending,subscription.halted— payment retry / failure states.
Webhook auth uses Razorpay's HMAC signature header; mismatched signatures are rejected with 401.
Managing subscribers
From Subscriptions → Subscribers:
- List all active and past subscribers with start date, current cycle, next charge date.
- See payment history per subscriber from the Razorpay subscription ID.
- Filter by status — ACTIVE, CANCELLED, HALTED, COMPLETED.
Cancellation & refunds
Students cancel from their own dashboard. Cancellation flows:
- Tuition.in calls Razorpay's cancel-subscription endpoint with
cancel_at_cycle_end: true. - Razorpay schedules cancellation at the end of the current billing cycle.
- The student keeps access through the paid-through date.
- The
subscription.completedwebhook fires at the end → access revoked.
Refunds during a cycle require manual action: refund through the Razorpay dashboard and then revoke access on Tuition.in if you want the cancellation to be immediate.