#fedeb_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1348733646441287720
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
complete text:
I'm currently using Schedules API in python.
I grab a subscription, call create schedules, and then I retrive the phases that were automatically created based on the subscription.
Sometimes it has only one phase, sometimes more than one.
Since there are several possible scenarios (free trial days, coupon codes, custom fixes manually by support team, etc.)
What I do is go through all the phases and update OLD_PLAN_NAME to NEW PLAN_NAME depending on the case and call the modified schedule api, this causes the migration to occur immediately or in a future phase, depending on the particular case of each subscription, since everything is done automatically by stripe.
Now I want to do a phase to do the migration in the future instead of the immediate impact, since I have many subscriptions it takes several days to do the instant migration, so I want to execute it a month before even if it takes days, but saying the next month 30 apply this phase that changes the plans.
So how do I add a new phase to the phases I already have?
Im confuse what startdate/enddate should I add in the phases array.
I don't want to modify the billing date, only add a new plan that will start x day and replace the existing plan.
--
since phases does't have an id, or order is hard to track or know how to handle, or to add a new one, base on what info?
Hello
Thank you for providing details. We have docs on how you can add a new phase to an existing schedule - https://docs.stripe.com/billing/subscriptions/subscription-schedules?lang=node#updating
The phase 0 in the phases list/array is the current phase. In order to add a new/next phase, you can update the schedule by passing the existing/current phases and add the new phase object
The docs have examples on how you can do that
yes I read it, but is not clear.
you are saying that the array phases returned the first element is the curren phase?
because I coul'dt find that in the docs.
I will try using that and maybe get back with more questions.
Yup, when you create a schedule, the returned phase should be the first/current phase