#Wik-subscription-trials

1 messages ยท Page 1 of 1 (latest)

coral quarry
#

Hey there!

#

The default Stripe behaviour with trials would be to continue onto the regular billing cycle of the specified Price object unless canceled/removed from the subscription

#

What determines whether they stay on plan A or plan B?

wide marsh
#

Our product team wanted them to be able to go back to their previous plan (A) by default ( case 2) once their subscription ends. Is it possible?

#

The user might choose to stay on the trial, I know how to handle that, I'm only wondering about putting them back onto the previous plan.

coral quarry
#

The confusing part of your question is that both scenarios were 'by default' ๐Ÿ˜„

coral quarry
#

There's no automated flow for that

wide marsh
#

The confusing part of your question is that both scenarios were 'by default' ๐Ÿ˜„
Ah, yes, sorry. I meant it as two separate scenarios with different default behaviour ๐Ÿ™‚

coral quarry
#

Ok, got it. Does that help clarify what you need to do?

#

I imagine you'd listen to the customer.subscription.trial_will_end event and in your webhook handler make the necessary call to update the related subscription

wide marsh
#

You'd need to handle that yourself
Got it. Let's say that I upgraded the user's subscription to start the trial for them (plan A => plan B), when I want to downgrade them to the old plan, does Stripe keep any record of the previous plan? Or is it on me to record their previous plan id in my db?

coral quarry
#

What in this case is the 'plan'?

wide marsh
#

Product. Apologies plan is the term we use in our app.

coral quarry
#

What does that correlate to in Stripe? A Price object?

wide marsh
#

Not sure if I understand the question. In the dashboard, when I look at a subscription it has products and plan A is listed there.

coral quarry
#

Can you share a specific Subscription ID?

wide marsh
#

Can it be from a test mode?

coral quarry
#

Sure

wide marsh
#

Great. Can you give me a sec? I'll prepare it.

#

Subscription id: sub_1KLnSMJA8pMPzFjl5bMUBdZT

coral quarry
#

So when you come to downgrade them, you'd just use that price_xxx ID when making the update call to the existing subscription

wide marsh
#

Yes, is there any way I can get their previous price from Stripe or do I have to store it in my db? E.g. the subscription object in the db only has one price but two invoices and the first invoice mentions the original price.

coral quarry
#

There'd be no reference to the Price object so you'd need to persist that somewhere yes

wide marsh
#

Thank you for confirming (and working with me through this, it evolved into a long thread!).

#

Last question: for a trial subscription, if I set cancel_at_period_end, will it cancel the trial at its end or will it move trial to active and cancel at subscription end?

#

e.g. user started trial of a yearly plan on 1st June. Trial lasts 14 days. Setting cancel_at_period_end will cause the subscription to be cancelled on 15th June or 1st June next year?

coral quarry
#

Hmm, not sure. Let me test

#

Just created a new subscription with a monthly plan, with a 7 day trial. current_period_end is 1643717022 which is a week from now (Tue Feb 01 2022 12:03:42 GMT+0000)

#

So based on that I think it'll cancel at the end of the trial before the 1 year billing period starts

wide marsh
#

A thousand thank yous! Thank you for your time and help, have a lovely day.

coral quarry
#

Np!