5
6 Comments

How do you code trial account flows in your apps?

Hey everyone, I was hoping to get some feedback / ideas on how I would add trial functionality to user accounts. I don't currently require credit cards for the signup, so it wouldn't be as simple as creating a Stripe customer and handling the trial on that side I don't think.

One idea I was thinking of was to create a lambda function that would run every night and deactivate premium features from all accounts that have expiring trials, but I'm not sure that's the most effective way to handle trials since technically some people may not get the full 7 day trial depending on the time of day they signed up.

I would love ideas or feedback from anyone who has tackled something similar before!

posted to
Developers
on June 6, 2020
  1. 2

    With the stripe SDK you can create a "customer" and "subscription" with a trial period (say 7 days). You don't need card details for that step.

    I do something similar:

    • user signs up (personal accounts free on my platform)
    • user creates organisation (this triggers stripe customer and subscription creation with no card details)
    • organisation is now trialing
    • either they pay before 7 days is up, and their subscription changes to active
    • or they don't and their subscription status is unpaid (or read only)
    1. 1

      Ah awesome, that sounds like that approach would work well. I guess the only thing I could see is you may end up with a ton of Stripe customers who have never paid, do you do a manual cleanup of that every now and then?

      1. 1

        Depends on whether you think they'll ever come back to pay... Either way for me I treat no subscription the same as a trialing subscription. That way when you delete old customers in Stripe they'll just be reset to trialing

      2. 1

        This comment was deleted a year ago.

        1. 1

          Yeah this is correct. What I described above is the MVP of a stripe integration

  2. 1

    I have a subscription model and automatically create non-recurring free subscription on account activation 😁 so then users buy the real subscription or the free one just expires. Super easy to do with one table inheritance in Rails 👍🏻

  3. 1

    There's an article sitting in my drafts folder in which I describe this exact scenario with Stripe; few things to note;

    • Every sign up creates a customer with Stripe
    • Every customer immediately gets a subscription attached, for keeping track of the trial period
    • After the trial period is over, and I have no payment information with said customer, I cancel the paid subscription, and users get to continue use on the free plan (not tracked by Stripe)
    • If I have payment information, I'll finish the trial and keep them on the subscription
    • I get events from Stripe via webhooks, and mutate data in my system accordingly

    Some of the information I store upon signup is related to the end date of the trial, information retrieved from the API will always reflect this in the response.

    Let me know what topics you'd like more information about.

  4. 6

    This comment was deleted a year ago.

Trending on Indie Hackers
I've built a 2300$ a month SaaS out of a simple problem. 22 comments Where can I buy newsletter ad promos? 12 comments How would you monetize my project colorsandfonts? 8 comments How I built my SaaS in 2 weeks using NextJS and Supabase 6 comments Key takeaways growing MRR from $6.5k to $20k for my design studio 6 comments Tips on starting a startup 5 comments