#michael_subscription-add-trial-period

1 messages ยท Page 1 of 1 (latest)

quasi muralBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1445075315692015647

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

trim vector
storm talon
#

Yes, I do: sub_1SNI9KDo4Rz9tanhCtiNPxeO

#

Seems like every time i make this call there is invoice created for 0 usd which is okay but not sure what will happen after that period. If subscription will go from "trialing" back to "active" state without collecting money from the customer

trim vector
#

Ah gotcha, in that case we would create a full invoice for the cycle by default. To prevent charging the customer you would want to issue credit for the amount of the full cycle or apply a 100% off coupon.

#

Now that I think of it, the credit may be easier to work with because the next invoice would be for its full amount. So if you want to for example upgrade the subscription the prorations for that would be calculated properly.

storm talon
#

Okay. So when i have active subscription and wanna add those extra 30 days respecting remaining time what i should pass to stripe.Subscription.modify(...)?

trim vector
#

What you are currently passing is good. For the two options I laid out:

  • For a coupon, you would include the coupon's ID in the subscription's discounts array in your modify call
  • For a credit note, you would make a separate API call to create the credit note after your modify call has completed
storm talon
#

Modifying billing_cycle_anchor by 30 days woudnt be easier in this case?

#

It would be also more appropriate for the user to see still active instead of trialing in my case

trim vector
#

It isn't possible to modify the anchor directly unfortunately. Creating a trial moves the anchor to the end of the trial. Otherwise the only way you can modify the BCA is by specifying billing_cycle_anchor: 'now' when making your modify call and that resets the anchor to the same second that we receive your update call

storm talon
#

Setting "trial_end" seemed for me like a workaround for giving user "x free days"

trim vector
#

So the trial is the only way to modify the anchor to an arbitrary day while keeping the original subscription

#

Yep, this is definitely a workaround. Not quite sure why we don't offer a way to modify the anchor directly but we don't currently offer it unfortnately.

storm talon
#

Oh, okay. Thank you for your help!

#

I have one more question ๐Ÿ™‚ What about pause_collection for 30 days? Will it move billing_cycle_anchor forward?

trim vector
#

Unfortunately not, pausing collection means that the subscription continues as normal but the invoices that get created don't get finalized/charged. You could pause collection on an invoice and then schedule an update to reset the billing cycle anchor while unpausing in future, but that would add a decent amount of complexity to this flow for you.

#

Are you using our customer portal or are your users seeing their subscription statuses in your own UI? If it is your UI, a simpler solution may be to use the trial but then have your UI have some logic to still show the subscription as active if it is trialing for this reason

storm talon
#

Sadly client pushes me to make it like a 30 days extra, not giving out discount to next billing period. Even if its 12month trial it still need to be 30 days extra, once, sometimes more

#

I have my own custom UI, i set all via api calls

#

So its possible to map statuses in my database

trim vector
#

Gotcha, yeah that may be the most straightforward way to do this here. I am not immediately thinking of a solid alternative but am happy to help look further into any of the functionality around this.

storm talon
#

"most straightforward way to do this here" setting trials?

trim vector
#

Correct, I think the easiest way to handle this would be to set a trial and then show a non-trialing status in your UI if you can tell that the trial was set to move the BCA

storm talon
#

So back to "stripe.Subscription.modify(subscription.id, trial_end=new_trial_end, proration_behavior="none")"? Still will have problem where after that trial end it will create new full payment

#

In case where user had 6 months out of 12 months subscription

trim vector
#

Right, that is what I was speaking to with the credit note vs a 100% off coupon. Those can both make sure that the end customer doesn't have to pay for the new cycle when the trial ends

storm talon
#

But when i get 12 month cycle how i can give 100% coupon for 30 days?

#

That resetting billing_cycle_anchor is the main problem here :/

trim vector
#

Oh I'm sorry I missed the 12 month aspect. Can you tell me how you'd prefer for the charges to go here? Like if the full 12 month subscription cost $120 what would you want to be charged at the end of this trial?

storm talon
#

I have case where user subscribed for 12 month plan. After 6 months recommendation event occurred so i wanna add extra 30 days for free to current subscription

#

So there are 6 months -> free 30 days -> 6 months

#

Those 30 days can be added to the end of that 12month period, thing is it have to be 30 days, no credits

quasi muralBOT
gloomy sapphire
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague has to go

storm talon
#

It can be done by some workaround, like pausing subscription etc. Or maybe you have other ideas?

#

Hello!

gloomy sapphire
#

I'm looking at your last message and I'd just like to make sure I understand. Are you billing monthly or yearly?

storm talon
#

I have different plans: 1, 3, 6 and 12 months, same product

gloomy sapphire
#

And you are fine with the 12 month subscription actually going 13 months, when you add the free trial?

storm talon
#

Yes

gloomy sapphire
#

At what frequency do you bill the customer?

storm talon
#

As long as its scallable so i can do it more than once for customer

#

Frequency?

gloomy sapphire
#

For your twelve month plan, you charge your customers 1 time for the entire 12 months, correct?

storm talon
#

Yes

#

prod_TJQUzx6qD2dDx7

#

1 charge customers at start of billing period

gloomy sapphire
#

This allows you to schedule changes to your Subscription over time by using "phases". Each Phase represents a different configuration for the Subscription.

storm talon
#

Hm, thats something new

gloomy sapphire
#

How this would help your situation:

  • Customer subscribes for 12 months <- this is the first phase
  • Event occurs where you want to grant a free 30 day trial
  • You schedule a second phase that lasts 30 days and has trial: true
  • You schedule a third phase after the trial that goes back to the first phase.
#

Schedules do increase the complexity of a Subscription integration but they also provide more flexibility. For an integration like yours where some event can trigger the awarding of 30 free days, I think they help you manage those rewards by scheduling them in advance.

storm talon
#

Each schedule is tied to one subscription? One to one?

gloomy sapphire
#

Yes

storm talon
#

Tbh i do like that, thank you!

gloomy sapphire
#

Sure thing! As I said, these schedules add complexity so I HIGHLY recommend coding some simulations to make sure you get the exact behavior you are expecting. We have Test Clocks https://docs.stripe.com/billing/testing/test-clocks to help simulate time passing which is very useful for Susbcriptions.