#Alex from Fuxam
1 messages · Page 1 of 1 (latest)
I want the user to get a preview of the upcoming invoice that they will get if they choose to upgrade their plan. The price should only be switched at the current_period_end. As your colleague suggested, I will handle this part with subscription schedules. However, I still want to display what the upcoming invoice would look like, so my idea was to just set the subscription_proration_date in the retrieveUpcomingInvoice to the subscription.current_period_end.
Is there any issues you're running into?
Yes, this part. **However, even though my subscription.current_period_end is on the 08 Jun 2024, the upcomingInvoice.period_start is on 08 Jun 2023. **
The upcoming invoice's period start is on the wrong date
Could you please share a Subscription ID?
sub_1NGhx1EwHpTUe8W7qmy83E6h
Also, do you mind sharing the Request ID of the upcoming invoice call? req_xxx https://support.stripe.com/questions/finding-the-id-for-an-api-request
Yes here it is
req_QSHPJzbVk6MBKQ
Could you try setting the subscription_proration_date to current_period_end? Now it's: 08 Jun 2023
thats what I did here
and even though I had subscription.current_period_end on the 08 Jun 2024, the upcomingInvoice.period_start was on 08 Jun 2023.
I understand. So you want it to be 2023 or 2024?
2024, since that is when the subscription.current_period_end is
👋 stepping in here
Catching up give me a moment
Yeah so what you are trying to do isn't really possible since the Upcoming Invoice endpoint will always retreive the next Invoice if you use a specific Subscription.
There is no way to tell it to anticipate skipping a period
What you could try though is previewing a Subscription creation for that date in the future
What if I actually add the subscription schedule to the subscription? Will I then be able to preview an upcoming invoice?
No that's not how that upcoming Invoice endpoint works
It will only preview the next Invoice for a Subscription
Right, but since the subscription is scheduled to change, is there no way I can retrieve the upcoming invoice for that change?
No sorry
That's not how that endpont works
I can put in a feature request for that
But for now you would be best off using the endpoint as if you were creating a new Subscription for when that Sub Schedule update would occur.
And that will give you almost the exact same info.
Yes actually this feature would be great to have. I Can see on my dashboard that the subscription is actually scheduled to have an update on the right day with the right amount due, but I wish I could just get that "next invoice" that is the image I attached
Hmm wait wait
I thought you wanted to preview like future periods.
In this above example this is the next natural Invoice you are trying to preview, right?
In that case you should be able to just call the endpoint without passing any data the would force an update
And I believe it should take the schedule into account and work just fine