Promo codes
Create and validate promo codes with benefits and redemptions.
Promo codes grant benefits (e.g. "pro" for 30 days, "trial" for 7 days). Codes can have validity windows, max redemptions, and are normalized (e.g. uppercase) for consistency. Redemptions are tracked per user and per code.
Data model
- promoCodes —
code(normalized),benefitType,benefitValue, optionalmaxRedemptions,timesRedeemed,validFrom,validUntil. - promoRedemptions —
promoCodeId,userId(if redeemed in Ezzy),externalId(if reported later),redeemedAt.
Convex API (convex/promoCodes.ts)
- listPromoCodes — All promo codes for the app (with active/expired state).
- createPromoCode — Create code with benefit type/value and optional validity and max redemptions.
- updatePromoCode, deletePromoCode — Update or remove.
- redeemPromoCode — Redeem by code string (validates dates and max redemptions, records redemption, returns benefit).
Public API
POST /api/v1/promo/validate — Validates a promo code and returns benefit info (or error). Used by client apps to check and apply codes before or during redemption.
App usage
Under Promo (project → Promo) you create and edit promo codes, set benefit type/value, validity, and max redemptions. Redemptions can happen in-app or be reported via API.