#HugoRS

1 messages · Page 1 of 1 (latest)

rigid pebbleBOT
earnest quiver
#

Hi there

#

You basically let us do this for you.

#

Are you asking how to calculate ahead of time?

storm perch
#

Alright, thats a release

#

Yes. For our own checkout

#

I'm using the Retrieve the subscription api to get the users current plan

#

And then I'm using the Retrieve a price API for the new subscription

#

Is this the way

earnest quiver
storm perch
#

But can I use the upcoming invoice api before switching the subscription plan?

earnest quiver
#

Yep

#

Take a read through what it says there in the API Ref for how that endpoint works

storm perch
#

Thanks, I will have to send the new subscription id here, but the subscription is not yet created, right?

earnest quiver
#

Well if you are previewing an update then the Subscription has been created? Otherwise you can also preview the initial invoice for a new Subscription before creating it

storm perch
#

But right now i'm only using the update subscription API and this will change the users subscription directly (and also create a new subscription id, right?) I want to display the information before the switch.

earnest quiver
#

No updating a Subscription does not create a new Subscription ID

#

Once a Subscription is created then it will maintain the same Subscription ID throughout its lifecycle

storm perch
#

Alright cool, but how does the retrieve an upcoming invoice know what price the new subscription has?

earnest quiver
#

You use the subscription_items parameter to indicate what items you want to add or update.

storm perch
#

Now I understand, and where do I grab the subscription_item from?

earnest quiver
storm perch
#

Alright, thank you!