#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/1349019128882794646
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- fedeb_api, 17 hours ago, 9 messages
curl -X POST 'https://api.stripe.com/v1/subscription_schedules/xxxxxxxx'
--header 'Content-Type: application/x-www-form-urlencoded'
--data 'proration_behavior=none'
--data 'phases[0][automatic_tax][enabled]=false'
--data 'phases[0][currency]=usd'
--data 'phases[0][end_date]=1743098749'
--data 'phases[0][plans][0][plan]=x1'
--data 'phases[0][plans][0][price]=x1'
--data 'phases[0][plans][0][quantity]=1'
--data 'phases[0][prorate]=true'
--data 'phases[0][proration_behavior]=create_prorations'
--data 'phases[0][start_date]=1740679549'
--data 'phases[1][start_date]=1741786628'
--data 'phases[1][items][0][price]=x2'
--user 'xxxxxxxxxxx:'
Im adding a new phase that it will migrate to a new plan
--data 'phases[1][start_date]=1741786628' \ 12 March
--data 'phases[1][items][0][price]=x2' \
I want to migrate all users on 12 March to a new plan, I dont want to change any billing date of there current annual/monthly plan, I dont want to change the card billing date from the original that they subscribe.
[end_date]=1743098749 27 march its when a new invocie will be generated not sure.
"message": "There is a gap between phase 0 (1740679549, 1743098749) and phase 1 (1741786628, 1744465028).",
Hello, apologies for the delay. Looking in to this
Hello, if you remove the end_date from phase 1 I think this call should work. We will automatically set the end date to be just before the start date that you provide from phase 2
but it will will not change the billing cicvle of the invoice, or charge sooner than the original billing cycle?
It will, if you want to keep the original cycle, you can instead remove the start date from the second phase
Phases cannot exist at the same time, so the schedule needs the start dates and end dates to line up
Can you tell me more about what you want this schedule to do? Like give an example timeline of how you would like this subscription to work?
but if I remove the start date from second phase, the migration will be inmediatly applied?
I want to scheduled a migration, for example setup now that in two weeks migrate all users to a new plan.
because I have alot of users and takes hours/days to process.
I could run in the same day when I want to applied the migration, I already tested and it works, but since takes time, I want to try if possible to scheduled to specific date and run it before even if takes days to run.
then I can just wait for that date and autoamticall all users will migrated to the new plan.
We migrate either when the end date of the current phase is hit or the start date of the next phase. So you can define this either as the end date of the first phase or the start date of the second phase.
The issue now is that your phases conflict. The end of phase 1 is March 27 but the start date for phase 2 is March 12, so which phase would we be in on March 15th for example? To resolve this, we need to know whether to keep phase 1 all the way until the 27th or to change on the 12th
Oh I think I may understand some confusion here. Your subscription cycle will still stay the same if you indicate that the phases should change on the 12th. The subscription will continue to cycle on the 27th going forward, it will just change to using a different price on the 12th as long as the new price is also a monthly price
" Your subscription cycle will still stay the same if you indicate that the phases should change on the 12th."
that it what Im fear that messing with phases dates, will make changes on the subscription cycle that I dont want to.
There are two ways for the subscription cycle to be effected here:
- If you switch between prices with different cycle lengths (ex monthly -> yearly) we will reset the billing cycle anchor
- If you tell the schedule to reset the anchor between phases we will reset it
As long as neither of those apply, your cycle will stay the same
now I just tried this, editing the first phase end date to 12 march same as start of phase 2
phases[0][end_date] 1741786628
phases[0][start_date] 1740679549
phases[1][start_date] 1741786628
it kind it work, but it added "Unused time on sh_monthly_us_stripe after 12 Mar 2025" how to avoid that
Can you send me the ID of the schedule that you created?
sub_sched_1R1Sk3E8gsL5R1XujvQ7lhjY
Oh, you passed prorate: "true" and proration_behavior: "create_prorations", that is what is telling us to create these prorations
If you remove those lines the cycle will stay the same
My apologies, I forgot that that could also happen
but those I never send it. ?
I think that they where created automatically when I did : ?
curl -X POST 'https://api.stripe.com/v1/subscription_schedules'
--header 'Content-Type: application/x-www-form-urlencoded'
--data 'from_subscription=sub_1Que89E8gsL5R1XuKZUamBh5' \
It is in the update call that you make afterwards
https://dashboard.stripe.com/test/logs/req_gDXeL3nnG1gPYR
It is in the curl request that you send above
--data 'phases[0][proration_behavior]=create_prorations' \```
oh wait I did send him , but what I did was copyng the same phases when I did a GET.
since the update API call its like a merge.
I wanted to maintente the same structure and just editing the dates....
curl -X POST 'https://api.stripe.com/v1/subscription_schedules/sub_sched_1R1Sk3E8gsL5R1XujvQ7lhjY'
--header 'Content-Type: application/x-www-form-urlencoded'
--data 'proration_behavior=none'
--data 'phases[0][automatic_tax][enabled]=false'
--data 'phases[0][currency]=usd'
--data 'phases[0][end_date]=1741786628'
--data 'phases[0][plans][0][plan]=price_1NQvogE8gsL5R1XuBMzOMsdr'
--data 'phases[0][plans][0][price]=price_1NQvogE8gsL5R1XuBMzOMsdr'
--data 'phases[0][plans][0][quantity]=1'
--data 'phases[0][prorate]=true'
--data 'phases[0][proration_behavior]=create_prorations'
--data 'phases[0][start_date]=1740679549'
--data 'phases[1][start_date]=1741786628'
--data 'phases[1][items][0][price]=price_1Qw5vBE8gsL5R1XuK6DynKLQ'
--user 'sk_test_6lWJIiTsQpGHK16BYATtckkB:'
what is the tips to have in mind when editing phases to mainten the same data as now but chaning dates or adding phases.
because it can easly remove promo codes logic, and other stuff. wihout knowing.
Ah I see that we do return that as part of the phase. You can leave those fields out when making the update call and that should do the trick
https://dashboard.stripe.com/test/logs/req_eTd0cInthSc2gB
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
what is the tips to have in mind when editing phases to mainten the same data as now but chaning dates or adding phases.
because it can easly remove promo codes logic, and other stuff. wihout knowing.
Apologies for missing this question, that really depends on your situation. Each phase is considered separate and will remove any fields that aren't explicitly specified in them, so if you want the promo code to carry over you will want to put it in both phases, if not then leave it out of the other one.
Date changing depends on the context and what you want to happen at that date. If you can tell me more about what you are trying to do overall that can help. If you can give me an example of what you want one subscription to do here I can look into what we have around that
No that is okay.
Wanted to find a way to establish a generic way since migrating users , each one is different
I Hope one day Stripe can do endpoints for adding or updating apart from the current merge that can cause issuess
That is all for now.
Thanks for the help I can continue working with this new clarifications from what I want to do
Gotcha, happy I could get you some answers at least. Hopefully not many new surprises as you go forward here!