#krhubert-sub-schedules
1 messages · Page 1 of 1 (latest)
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?
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.
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 ?
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?
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?
Yup! What I described earlier should do the trick
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 :/
Sorry, I didn't realize you needed more clarification
Here's a brief step by step of how you'd do this:
- Take your user through whatever checkout flow (checkout, elements, etc) you're using to pay for a $100/month subscription
- Once the subscription has been paid for, convert it to a subscription schedule (https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription)
- Update the created Schedule so that the first phase is for a full year, and then add an additional phase that uses the new price.
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?