#krhubert-sub-schedules

1 messages · Page 1 of 1 (latest)

viscid moth
#

I believe that iterations has to be greater than 0... is your goal to just update the subscription once in the future and that's it? Do you need to keep the subscription schedule at all afterwards?

red bronze
#

Yep, once in the future, so the use case is this:

For the 1st year client pays flat price $100/month. After 1st year he pays $5/user/month.

#

What's the best way to apprach to this issue. The obvius one is to check subscpriont create date and if it's > 12mo, then update subscprion prcie, but I just wonder if I can do better (eg using subscpriont schedule or some other automiatic approch) where I can set it once and forget.

viscid moth
#

Yeah, subscription schedules would be great for this use case! Your subscrition schedule would have an initial phase with an iterations: 12 (for 12 months) at the $100/month price. Then, the next phase would have iterations: 1 with the $5/month price. As long as end_behavior of the schedule is release (see https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior) the subscription will automatically be released from the schedule and continue on as normal.

red bronze
#

Not sure if I understand correctly, let's say I have two prices:

  • price_a $100/mo
  • price_b metered billing $4/user/mo

Now what? I create a subscription with price_b, but also crate a schedule with interation set to 12, and then release it, so the price_b can containue forever, correct??

#

If that's the case how to show customer on the first checkout price_a ?

viscid moth
#

Sorry let me clarify - you'd create the subscription with Price A. You can then take that subscription and convert it to a subscription schedule. Now, working with the subscription schedule you can set a future update (so you can set it and forget it) so that it changes to Price B at the future date you want

#

Does that make sense?

red bronze
#

Yes, from the customer perspective I want him to see that he'll be paying $100/mo and his frist checkout will be $100, and then after 1yr $4/user/mo.

From the developer perspective I want to set the whole flow only once and forget about it

#

How dose it sound?

viscid moth
#

Yup! What I described earlier should do the trick

red bronze
#

So can you tell that in different words and once again explain it to me, maybe on an example, because as I said I didn't get that :/

viscid moth
#

Sorry, I didn't realize you needed more clarification

#

Here's a brief step by step of how you'd do this:

#

Learn how to use subscription schedules.

red bronze
#

Ok so in other words if I add a schedule to a subscpriont with interations set to 1 and end_bahaviour release, then the subscription will be changed forever , correct?