[SOLVED] Applying a free trial to a Stripe plan

The issue:

Assume a user checks out on a monthly subscription plan on March 19, 2022 and is expecting 2 free trial days, then they should be shown a notice which says 'Your first billing date starts on April 21, 2022", ie. One month plus the 2 free days.

I have a test subscription plan with 2 free days but a user who checks out on March 19, 2022 sees 'Your first billing date starts on April 19, 2022" so the free trial days are not working.

To call the next billing date I am using Current subscription's Current period ending.

Solutions

Marty said in a related post that you can set the end of trial date as part of the subscribe a user to a plan.

be758a1b817cbbf076d42506de5d05a5a88feae4_2_690x127

I am not sure what information to put in this form field, I assumed something like Current subscription's Current period ending (days)+2 but this won’t work.

Stripes support contacted me and said that applying free trial through Dashboard works from their end, but when I look at a newly created user who has subscribed, the free trial is NOT added. The following user checked out on Feb 19, 2022 with with 2 free days and you can see that the next invoice is on March 19, 2022 (should be Feb 21, 2022),

next inv

according to the stripe docs, supplying the trial_end parameter, is enough to setup the free trial
https://stripe.com/docs/billing/subscriptions/trials
With bubble, and the stripe plugin, this appears to be exposed via the ‘End of the trial’ input box in popup for the action for Payment | Subscribe the user to a plan

in my case I just added “Current date/time + (months):1”
and this worked well. I tested other values in the past and they also were supported. Perhaps test with that?
I think that at the stage that your action is being triggered [ sent to stripe], the value for ‘Current subscription’s current period ending’ is not yet populated, as the bubble action happens before the stripe part of the workflow… that might be the problem.
when troubleshooting, I usually try and simplify and go from there.

Ah yes, thanks this info is very helpful. I think you may be correct that the issue could be that the value for ‘Current subscription’s current period ending’ is not yet populated. I will dig deeper …

Thanks for the insight mate.

I wanted to update this post with, what I believe, was the cause of the issue. Before I do, I have decided to offer my users a free trial without the need for checkout, this way I don’t need to use Stripe for a free trial and can simply ask the user to upgrade to a paid plan when trial expires.

One issue was when creating a product, I was trying to apply trial directly to that product. That is actually legacy setting. Setting a default trial period per price is no longer recommended in Stripe and is incompatible with Checkout. Instead you can set up trial per subscription
https://stripe.com/docs/billing/subscriptions/trials

Also, if you bill monthly you can’t have add a free trial for less than a month, so “Current date/time + (months):1” wouldn’t work. I may be wrong on this as I didn’t investigate much but for me it only worked when my trial length was one month, matching the billing cycle.

2 Likes

Here’s a solution, when a user signs up, schedule an API workflow;

Then set the state of the user to ‘trial_expired’ so you can simply hide any elements/pages when the user is expired.