Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Fireinthebellyy/ftb-web/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Coupon System allows admins to create discount codes that users can apply during toolkit checkout. Coupons provide fixed-amount discounts in Indian Rupees (INR) and support usage limits, expiration dates, and per-user restrictions.Accessing the Coupon Tab
Navigate to the Coupons tab in the admin panel at/admin?tab=coupons.
The Coupons tab displays all existing coupons with their details:
Coupon Details
- Coupon code (e.g., SAVE100)
- Discount amount in INR
- Usage statistics
Controls
- Active/Inactive status
- Expiration date
- Usage limits (total and per user)
Creating a New Coupon
Enter Coupon Code
Input a unique code (automatically converted to uppercase)
Example:
SAVE100, LAUNCH50, STUDENT25Set Discount Amount
Enter the discount amount in rupees (must be a positive integer)
Example: 100 for ₹100 off
Configure Usage Limits
Set max total uses (leave empty for unlimited)
Set max uses per user (default: 1)
Set Expiration (Optional)
Use the date-time picker to set an expiration date
Leave empty for no expiration
Coupon Code Requirements
- Must be unique across all coupons
- 1-50 characters long
- Automatically converted to uppercase
- Cannot contain spaces
If you try to create a coupon with a code that already exists, you’ll receive an error: “Coupon code already exists”
Coupon Configuration Options
Discount Amount
Coupons use fixed-amount discounts in INR.Max Total Uses
Control how many times a coupon can be used across all users.- Unlimited: Leave the field empty or set to
null - Limited: Set a positive integer (e.g., 100 for first 100 users)
Usage Tracking
The system tracks usage via thecurrentUses field:
Max Uses Per User
Restrict how many times a single user can use the coupon.- Default:
1(one-time use per user) - Can be increased for multi-purchase coupons
Per-user limits are enforced at checkout. The system checks
user_toolkits table to count previous uses of the coupon by the user.Expiration Date
Set a date and time when the coupon stops working.- No expiration: Leave empty for permanent coupons
- With expiration: Select a date-time using the picker
Active Status
Control whether the coupon can be used right now.- Active (green badge): Coupon can be applied at checkout
- Inactive (gray badge): Coupon exists but cannot be used
Editing an Existing Coupon
Editable Fields
- Discount amount
- Max total uses
- Max uses per user
- Expiration date
- Active status
The coupon code cannot be edited after creation. To change a code, delete the old coupon and create a new one.
Deleting a Coupon
How Users Apply Coupons
During toolkit checkout:- User enters coupon code in the checkout form
- System validates the coupon:
- Code must exist and be active
- Coupon must not be expired
- Total uses must be below
maxUses - User’s individual uses must be below
maxUsesPerUser
- If valid, discount is applied to the price
- After purchase,
currentUsesincrements by 1 - Purchase record stores
couponIdinuser_toolkitstable
Validation Errors
Users may see these errors:- “Invalid coupon code” - Code doesn’t exist
- “Coupon has expired” - Past expiration date
- “Coupon usage limit reached” - Max total uses exceeded
- “You’ve already used this coupon” - Per-user limit exceeded
- “Coupon is not active” - Admin disabled the coupon
Coupon Analytics
The Coupons table provides key metrics:Usage Statistics
View how many times each coupon has been used:Per-User Limit Tracking
ThemaxUsesPerUser column shows the restriction:
Status Badges
- Green (Active): Coupon is currently usable
- Gray (Inactive): Coupon is disabled
Database Schema
Coupons are stored in thecoupons table:
Coupon Usage Tracking
Purchases with coupons are recorded inuser_toolkits:
API Endpoints
Get All Coupons
Create a Coupon
Update a Coupon
Delete a Coupon
Validate a Coupon (User-facing)
Best Practices
Naming Conventions
Campaign-based
LAUNCH50, BLACKFRIDAY, SUMMER2026Audience-based
STUDENT25, FIRSTTIME, VIP100Value-based
SAVE100, OFF200, DISCOUNT50Time-based
EARLY50, WEEKEND, FLASH100Usage Limit Strategies
- Limited Launch Offer: Set low max uses (e.g., 50) to create urgency
- Unlimited Trial Period: No max uses, but set expiration date
- Per-User Loyalty: High
maxUsesPerUser(e.g., 5) for repeat customers - One-Time Campaign:
maxUsesPerUser: 1with expiration
Discount Amount Guidelines
- Small incentive: ₹50-₹100 (5-10% off)
- Standard discount: ₹100-₹250 (10-25% off)
- Major promotion: ₹250-₹500 (25-50% off)
- Free trials: Set discount equal to toolkit price
Troubleshooting
Coupon Not Working
- Check if coupon is Active (green badge)
- Verify expiration date hasn’t passed
- Check if max uses reached (
currentUses >= maxUses) - Confirm user hasn’t exceeded
maxUsesPerUser
Duplicate Coupon Code Error
Coupon codes must be unique. If you get this error:- Check if a coupon with that code already exists
- Choose a different code
- Or delete the existing coupon first
Coupon Not Appearing in Checkout
Coupons are entered manually by users during checkout. Ensure:- Coupon is marked as Active
- Expiration date is in the future
- Total uses haven’t been reached