4
3 Comments

Implementing coupon system for saas product

Hi everyone,
I am working on side project (SAAS) and want to implement following features:

  1. coupon/vouchers for users with some validity
  2. How to implement different plans like basic plan or free plan, PRO plan, Enterprise plan with each plan having its own pricing. (For payment integration I have explored Razorpay and Stripe) Also do I need to consider RBAC here?
    I wanted to know are there any libraries already available for such features or need to implement it from scratch? Any pointers would be very helpful.
    Thanks in Advance :)
posted to Icon for group Developers
Developers
on November 3, 2021
  1. 2

    This feels similar to my question

    I will also like to hear what solutions exist, but until then I can elaborate on my first attempt -
    After a very short hunt in Google I gave up and just implemented some no-sql DB doc structure to keep track per user:

    1. How many credits are available for the user
    2. What features are enabled
    3. What promo-codes (vouchers) were already used by the user

    It didn't take much to implement, however it does feel like a design burden - because now we probably want to expand the most basic solution and maybe change nCredits to a dictionary of different credits types. Also we probably want to keep track of the events of activation / purchase / expiration of vouchers and it can escalate quickly.

    My guess is that most products do implement this from scratch, and after an initial period with real users, it can be limited to a small enough scope and maintain a custom implementation that is tailored to the product.

  2. 1

    We use Stripe and their tools for coupons and per-customer credits. They have a pretty decent system that accommodates percentage and currency value coupons, with expiry dates and max number of uses too.

    1. 1

      I just checked it out looks good. Thanks a lot.

Trending on Indie Hackers
AI runs 70% of my distribution. The exact stack. User Avatar 187 comments I'm a solo founder. It took me 9 months and at least 3 stack rewrites to ship my SaaS. User Avatar 150 comments I used $30,983 of AI tokens last month in Claude code on $200/mo plan User Avatar 72 comments my reddit post got 600K+ views. here's exactly what i did User Avatar 40 comments I turned someone’s tweet into an app idea and it has made ~$3000 so far in 4 months. User Avatar 35 comments We could see our AI bill, but not explain it — so I built AiKey User Avatar 27 comments