#sajid_schedule-morequestions

1 messages ¡ Page 1 of 1 (latest)

empty pivotBOT
#

👋 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/1290428564121976833

📝 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.

lunar drift
#

can you please check why my schedule is not getting updated despite the result is 200 ok.

#

Here is the request id: req_UEulDxKPkXanBp

magic mist
#

@lunar drift I will first need you to explain all in one clear sentence what you are trying to do. You say something is "not updated" but it likely means you aren't updating/changing anything

#

sajid_schedule-morequestions

lunar drift
#

I am updating an schedule with new price. but is not getting update. whre I have inspected from backend it is sending items with updated prices.

magic mist
#

Okay, please take a couple steps back and then explain in one message what exactly you are seeing. What is your SubscriptionSchedule doing before the update, and what you see after.

lunar drift
#

Actually I have created a subscription schedule with mulitple iteratinos with some prices. after some time i want to update the schedule with updated prices. but when i update it. it is not reflected in stripe.

magic mist
#

I remember, I was with you in earlier threads. You have been asking for a lot of help with SubscriptionSchedules over the past week.
It's important for you to pause, take a few steps back and explain exactly what you are trying to do with the simplest example to reproduce the error.
Right now, you haven't really explained the issue and just say the same thing "it doesn't work" instead of clearly outlining exactly what you were doing with detailed steps.
It's really hard to help you and it can take hours of back and forth if you don't take the time to clearly explain your issue.

It should be as clear as saying
I have a schedule with a phase on price A and then another phase on Price B. Then I update it because I want the second phase to be on Price C instead. But after my request, it's still on Price A then B.
Or similar

lunar drift
#

ok let me try to describe more clear

#

I have created a subscription schedule with one phase using price 'A' for 12 iterations. After two iterations, I want to edit the upcoming invoice without affecting future ones. To do this, I add a new phase with one iteration, applying the updated price or data, and then another phase with the remaining iterations, which continue with the original price and details.

The goal is to modify only the next upcoming invoice, leaving the rest of the subscription unchanged.

Could you guide me on how to implement this correctly using the Stripe API?

#

I initially created a subscription schedule with 12 iterations using Price A.
After 2 iterations, I need to update the upcoming invoice with Price B but want to keep the remaining 9 iterations at Price A.
To achieve this:
I add a new phase with 1 iteration using Price B (this will affect only the next upcoming invoice).
After that, I create another phase with the remaining 9 iterations using the original Price A, continuing the previous setup.
In summary, I want the upcoming invoice (iteration 3) to have Price B, while iterations 4-12 should continue with Price A.

magic mist
#

We discussed this for multiple hours already days ago right?

#

You have one phase for Price A and 12 iterations
Then you update to have three phases

  • First phase: current month in progress for Price A
  • Second phase: one month on Price B
  • Third phase: 9 iterations on Price A
lunar drift
#

Yes.

#

We are been discussing it but still not able to do it properly some time it succeed and some time throw exceptions.

magic mist
#

so if you say yes why is your code only passing two phases instead of three

lunar drift
#

I am still stuck to calculate the dates manually. how can i calculate proeper time of next iteration. as I have to pass end_date for current phase. to start the second phase.

#

even one 1sec gap cause an error.

magic mist
#

You retrieve the SubscriptionSchedule. You look at current_phase which tells you the exact start and end date of the current phase. Nothing to calculate
Phase number 2 has iterations: 1 nothing to calculate
Phase number 3 has iterations: 9 nothing to calculate

lunar drift
#

and What abbout curretn phase as I have to give end date for current phase. right?

magic mist
#

I did just explain this in my first sentence above though

You look at current_phase which tells you the exact start and end date of the current phase. Nothing to calculate

lunar drift
#

it is end date with 12 iterations.

magic mist
#

gotcha, I see what you mean now but I still have to guess half of what you say.

It would have helped if you cleanly replied saying:
the first phase has 12 iterations, so the current_phase on the SubscriptionSchedule has the end_date 12 months later after the 12 iterations happen, not the current month as it is ongoing.

I know it's not easy to explain what you are trying to do but you have spent days on it and explaining clearly what is blocking you would be a lot more efficient for us both

#

So what you can do is look at the underlying's Subscription's current_period_end which would be the current month and seems to be what you want.

lunar drift
#

Yes exactly it is my questions. Thanks you explained cleary for me.

magic mist
#

Sure thing. I know it's tough and Schedules are confusing. But it's really hard to help if we barely understand the question. Sometimes, spending 10 minutes writing a clear script that reproduces the exact issue end to end and explaining your problem ends up being more efficient than a 1+ hour conversation

lunar drift
#

current_phase: { end_date: 1730411363, start_date: 1727732963 },

#

so this is of my interest right?

magic mist
#

Well that's on the SubscriptionSchedule right?
Like is this what you see now? Is this what your code is changing it to? Please I have asked you multiple times to take the time to explain your problem

lunar drift
#

Yes this is shwoing me exact date of next iteration. Now I can add this as end_date to current phase. and next both phases with iterations. I hope I will get it right now.

magic mist
#

sounds good

lunar drift
#

Does always first phase will be current phase in the phases list in schedule when i get in retreive schedule API?

magic mist
#

no, it's possible for older/past phases to be returned.

lunar drift
#

Okay sir. I got it.