#trueinviso
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you share the API request ID? It helps ensure we are on the same page.
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_LLn4DtnVoUyHT1
Thanks!
So you want to replace the existing phase with the new one, correct?
yes at the end of the billing cycle
Have you tried only passing the new phase with the start date specified?
yes
You can not modify the start date of the current phase.
that's the error message
req_J9kelvjiDQaIzO
for that one
I'm testing on my end too
Okay I was finally able to get one to work.
Lots of issue with testing environments
I provided the start_date for the new phase as the same timestamp as the end_date for the previous phase
My steps were as follows:
- Retrieve a Subscription Schedule
- Get the Phases array from it
- Add a new phase object with the
start_datefor the new phase equal to theend_datefor the previous phase - Update the Subscription Schedule record with the new array of phases
What do you do with the phases array on the second step?
I finally got one to work by adding start_date and end date to the first phase, then adding start_date to the second phase that matches end date of the previous phase
Yep
but the first phase already had a start date cuz it's an existing subscription, it seems weird to redefine it
When updating a Sub Schedule you have to put in the current phase as phase 0
so I guess you just do that by pulling the data you need from the existing phase?
Yep
then adding an end_date
which in my case would be the end of the current billing cycle
Right
The other option is to use iterations
You shouldn't need to define an end_date if you have iterations set
I don't think I can use iterations if I'm trying to switch plans at the end of the current billing cycle? Or if I put iteration of 1 on the first phase it would know to end it automatically at end of the billing cycle?
Yep iterations 1 would mean just cycle that phase one time then move to the next phase at end of billing cycle
It should be easier than actually calculating or retrieving the end_date
but if the existing subscription is half done, and you schedule a switch, will it switch in 2 weeks at the end of the original billing cycle? Or will it create a phase with a billing cycle of 1 month == 1 iteration?
You are just trying to update what happens in the next phase, right?
Not the current one
I'm trying to schedule a downgrade on the subscription, and want the sub to downgrade when the high subscription they paid for ends
I was told the only way to do this was subscription schedules
well I"m adding one, but I guess I have to create one using from_subscription first then update it. Is there an easier way?
No that would be the correct way. When you retrieve it after creating it, what does the current phase look like?
here's an example
it creates a schedule with a phase matching the existing subscription
Okay yeah sorry I believe I was incorrect before. You would need to use end_date not iterations in this case
I'll test real quick because I don't remember
When I retrieve the schedule after making an update to the phase, I don't see the schedule attached to the subscription in the dashboard, is there a place to view it?
well I see this tag here
You can't see a schedule details in the Dashboard specifically. You would need to look at the API Request or Events
the tag is good enough to verify that it's scheduled, thanks
Okay sorry had to step away for a moment. Did you update by setting end_date?