#johnsummerlin_code
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/1344888254402396200
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
I think the situation could be different and Test / Live mode. Could you provide 2 request id (req_xxx), from each mode?
Normally you can't modify the startdate of a current phase in effect. If phase 0 is in effect, it can't change start_date to now for example
Whenever I try removing the start_date prop, it says that one of the phases doesn't have a start date and that it needs that to know what to anchor the billing period to
Even though the new phase being added has a start date
like what orakaro mentioned, can you share the example request ids? that'll allow us to be able to look into the specific reason why you're encountering the error
unfortunately, the sandbox one was using a test clock and I finished the simulation
here's the production one that didn't work - req_17yRqf3XkYquGT
I can recreate the test request again if needed
So like what the error message mentions, you can't update the start date of the current phase for an existing subscription schedule. If you want to update the billing cycle anchor for an existing subscription schedule, you should do something like the below instead
phases : [
{
items: [
{
price: schedule.phases[0].items[0].price,
quantity: schedule.phases[0].items[0].quantity
}
],
start_date: schedule.phases[0].start_date,
end_date: 1748736001, //Jun 01 2025 00:00:01
},
{
items: [
{
price: schedule.phases[0].items[0].price,
quantity: schedule.phases[0].items[0].quantity,
}
],
billing_cycle_anchor : "phase_start",
},
]
I tried setting the start date prop in the existing phase to it's current value, but it also stated that I can't modify the start date of the current phase. I am not sure what my post body would look like to not change the start date of the existing schedule phase.
for context, you input now into the start_date which you can see in https://dashboard.stripe.com/logs/req_17yRqf3XkYquGT
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you didn't set the same start date as what was already defined in the existing subscription schedule
that request yes, but in other requests I passed in the current value and it errored then as well
can you share the request id where you passed in the current value? I'll take a look
I can definitely try it again
I don't know if I'll be able to find that request again, but I can try on another subscription that I need update the billing cycle anchor for.
sure, that works
req_krgJ9gNKJh2G4T
You can not modify the start date of the current phase.
how I built my payload of phases
phase1 = {
"items": items,
"start_date": subscription.start_date,
"end_date": 1740805200
}
phase2 = {
"items": items,
"billing_cycle_anchor": "phase_start"
}
1740805200 = March 1 at 5a
"start_date": subscription.start_date, - this is wrong
what should it be then?
you should retrieve the start date from the newly created subscription schedule, https://dashboard.stripe.com/logs/req_dVybS68v8NmCqa
start_date: schedule.phases[0].start_date,
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
code to create schedule for existing subscription and set the new schedule
create the schedule
create_schedule_response = stripe.SubscriptionSchedule.create(
from_subscription=subscription_id
)
modify the schedule
modify_schedule_response = stripe.SubscriptionSchedule.modify(
create_schedule_response.id,
phases=phases
)
when I call stripe.SubscriptionSchedule.create() should it return the phases in the response
and then I could use start_date: schedule.phases[0].start_date
yes, it will, you can see it here https://dashboard.stripe.com/logs/req_dVybS68v8NmCqa
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.