All documentation

Coupons & Discounts

Run promotions on any batch, course, or path. Real-time usage tracking and per-coupon analytics.

Tutors · Institutions6 min read
Who this is for
Tutors and institutions running flash sales, early-bird pricing, loyalty discounts, or batch-specific promos.

Overview

A coupon is a code your students enter at checkout to get a discount. Each coupon is owned by its creator (createdById) and visible only to that account's analytics — institutions and tutors can't see each other's coupons.

Creating a coupon

  1. Open Tutor dashboard → Coupons → New coupon.
  2. Enter a code — uppercased automatically on save. e.g. EARLY50.
  3. Pick a type and value (see below).
  4. Optionally restrict to a single batchId.
  5. Optionally set maxUses, validFrom, validUntil.
  6. Click Create.
Codes are global
Codes are unique across the whole platform. EARLY50 can only be used by one creator. A 409 response means someone already owns that code — pick another.

Coupon types

TypeValueMeaning
PERCENT1–100Discount = price × value / 100. Cannot exceed 100%.
FIXED_INRany positive integerDiscount = value rupees, capped at the item price (cannot make total negative).

Scoping to a batch

Leave batchId empty for a coupon that works on any of your batches. Set it to a specific batch to lock the coupon to that batch alone — useful for "Only for JEE Batch 2026" promotions.

Course-wide or path-wide scoping isn't supported yet; for now, scope per batch and create multiple coupons if you want the same code to apply across several batches.

Usage limits & validity

  • maxUses — null means unlimited. Otherwise the coupon stops validating once _count.usages >= maxUses.
  • validFrom — defaults to creation time. Set in the future for an embargoed launch.
  • validUntil — null means no expiry. Otherwise the coupon stops validating after this timestamp.

How a coupon is validated at checkout

When a student enters a coupon at checkout, the server calls POST /api/coupons/validate with the code and the target batch ID. The server checks:

  1. Code exists and is active.
  2. If batchId is set on the coupon, it matches the target.
  3. Current time is within validFromvalidUntil.
  4. maxUses isn't exhausted.
  5. The student hasn't already used this coupon (one use per student per coupon).

On success, the discount value is returned and applied to the order. On failure, a clear error is returned ("Coupon expired", "Coupon already used", etc.).

Tracking usage

Open any coupon to see:

  • Total uses so far (_count.usages).
  • List of usages — student name, batch, discount applied, timestamp.
  • Remaining uses if maxUses is set.

Coupons are immutable after creation: to change the value or validity, deactivate the existing one and create a new code.


Header Logo