#harry_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/1331952388021555230
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Hi
are you saying this Invoice arrived too early? https://dashboard.stripe.com/invoices/in_1Qk8SlDLYpftGlEYQ6SCB8XK
your API request to update the schedule has this: end_date: "1737569739", which is 2025-01-22. So on the 22 the phase ended, and the above invoice was created
What I am saying is according to this the plan should be changed on 3rd Feb, but according to event messages it got changed immediately
according to this the plan should be changed on 3rd Feb
no. your phase is ending on Jan 22, so a new invoice is created on Jan 22.
Ok understood, my bad the first phase should have been the current plan attached to the subscription
?
I'm not sure I understand your question. but if you want the Invoice to be created on Feb 3rd, then one of the phase needs to end on Feb 3rd.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
So basically if u check this https://dashboard.stripe.com/acct_1POhBMDLYpftGlEY/logs/req_0bTmpkdfQXc6yj the last phase is where the plan should change first two phases should have been of the plan that was associated to that subscription
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
but all of your phases have the same start and end time
am I missing something here?
I need to know what should I do If I am changing the plan from plan-a to plan-b for a particular subscription, and this change should happen at subscriptions next billing cycle, what should I sent?
{
"proration_behavior": "none",
"end_behavior": "release",
"phases": {
"0": {
"end_date": "1737569739",
"start_date": "1733143629",
"items": {
"0": {
"quantity": "1",
"price": "plan_RKbm8zuMp8c4xk"
}
},
"collection_method": "charge_automatically"
},
"1": {
"end_date": "1738558800",
"start_date": "1737569739",
"items": {
"0": {
"quantity": "1",
"price": "plan_RKbm8zuMp8c4xk"
}
},
"automatic_tax": {
"enabled": "false"
}
},
"2": {
"end_date": "1738558801",
"metadata": {
"unpaid_invoices": "0"
},
"automatic_tax": {
"enabled": "false"
},
"items": {
"0": {
"quantity": "1",
"price": "plan_RGB50OUDizU5FD"
}
},
"collection_method": "charge_automatically",
"proration_behavior": "none",
"start_date": "1738558800"
}
}
}
check last phase here
the start of each phase should be equal to the end of the previous phase
See I just created this schedule in test mode
req_uzt47Hwp8W60NZ but no invoice was created in this case
this is the schedule id sub_sched_1QkPCoJ7XeRxWFUI3Fcb5gT8
can you describe what are you trying to achieve please?
you have a current ongoing subscription, what do you want to happen to it?
I want to change the plan of that subscription, but the change should be such that the next invoice should be of the new plan. The change should happen at the current_period_end of subscription
so you only need 2 phases
and this doc shows you how to do it https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#changing-subscriptions
okay
{
end_behavior: 'release',
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: schedule.phases[0].end_date,
},
{
items: [
{
price: '{{new price}}',
quantity: 1,
},
],
iterations: 1,
},
],
}
okay will this schedule be released as soon as the plan gets upgraded?
after 1 iteration from the new plan
okay