#Alex from Fuxam

1 messages · Page 1 of 1 (latest)

lament gateBOT
devout urchin
#

Hi! Let me help you with this.

#

Do you want to upgrade the price immediately?

light mortar
#

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.

devout urchin
#

Is there any issues you're running into?

light mortar
#

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

devout urchin
#

Could you please share a Subscription ID?

light mortar
#

sub_1NGhx1EwHpTUe8W7qmy83E6h

devout urchin
light mortar
#

Yes here it is
req_QSHPJzbVk6MBKQ

lament gateBOT
devout urchin
#

Could you try setting the subscription_proration_date to current_period_end? Now it's: 08 Jun 2023

light mortar
#

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.

devout urchin
#

I understand. So you want it to be 2023 or 2024?

light mortar
#

2024, since that is when the subscription.current_period_end is

woeful skiff
#

👋 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

light mortar
#

What if I actually add the subscription schedule to the subscription? Will I then be able to preview an upcoming invoice?

woeful skiff
#

No that's not how that upcoming Invoice endpoint works

#

It will only preview the next Invoice for a Subscription

light mortar
#

Right, but since the subscription is scheduled to change, is there no way I can retrieve the upcoming invoice for that change?

woeful skiff
#

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.

light mortar
#

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

woeful skiff
#

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