#Maranello-upcoming-invoice

1 messages · Page 1 of 1 (latest)

mystic oxideBOT
humble nova
#

Hi, are you able to reword the difference you're seeing between the Upcoming Invoice and the Subscription Update API?

mystic oxideBOT
glass tiger
#

For the Upcoming Invoice, I need to send the difference of quantity to add/remove, but for the Sub Update, I need to send the total quantity.

humble nova
#

Maranello-upcoming-invoice

#

They should not be different. Can you add way more details into what you're seeing? How you're making each of these updates with concrete examples?

glass tiger
#

If I have a subscription item that has 2 current units and want to add 1 more, I need to send the below the upcoming invoice:
{price=price, quantity=1, id=item_id}

For the sub modification, I need to send the below:
{id=sub_item_id, quantity=3}

Am I right?

humble nova
glass tiger
#

This is all I am looking at, that's why I am resorting to Discord.

humble nova
#

Are you able to try this on your end?

glass tiger
#

that's exactly what I am trying. For existing sub_items, I am passing their IDs. For new ones, I am not.

#

Also, if I pass in the "subscription_proration_date" to be now(), I am getting a huge amount, way beyond the price of the product I am trying to add.

mystic oxideBOT
humble nova
#

Ok, so what is broken? Can you be way more detailed here?

glass tiger
#

I asked you the same question in 3 different ways. I am not sure what else you want me to provide. I need to know what is the payload expected from me to quote a customer when they want to do a change on their subscription (whether increment/decrement an existing item, or add a new item). Is this clear enough?

half tartan
#

👋 hopping in here - give me a second to catch up

#

Can you clarify - are you having trouble getting the upcoming invoices API specifically when there is no Subscription that exists yet, or only when you already have a Subscription and you're trying to update/change the quantity

glass tiger
#

it's more the second scenario, when there is an existing subscription

#

if I have 2 units, and I send 1 unit to the upcoming invoice with proration_date=now(), I am getting a huge amount way beyond what the actual price is. This is becoming another problem I am facing. Originally, I wanted to understand what to send in terms of quantity: 1 or 3.

#

Here is the subscription ID in question: sub_1NDT6eBQSc48BDFb3evahBSu

half tartan
#

Can you share a request ID of an example retrieve upcoming invoices request that is resulting in the huge amount you're not expecting?

glass tiger
#

are you able to check the sub_id?

half tartan
#

You've got multiple of those requests, and not all of them are the same - I want to be sure we're looking at the same request when I explain what to do

glass tiger
#

Can we start by looking at the subscription so that my concerns are more concrete?

half tartan
#

I have that subscription open already - but your concerns were more with the upcoming invoices API, right?

glass tiger
#

correct. So if you look at the sub items, suppose I need to add 1 more unit of the product "Comparateur". Here is my payload:

#

Sorry I am not able to copy it, but I am referencing the correct sub_item_id. And the proration date is now(). The amount_due I get back from the upcoming invoice is 111758, although the price is $60

#

My aim is to be able to show the customer that their change would amount to about $60 if they do it now, not over $1,000.

half tartan
#

In addition, for the quantity you be setting 1 + whatever quantity the subscription has already

#

So if the subscriptino already has quantity 2, you should be passing ing quantity 3 when you're previewing the upcoming invoice to add an additional unit

glass tiger
#

alright, so the quantity I pass to the upcoming invoice is [existing + new] if I am adding to it, right?

half tartan
#

yup!

glass tiger
#

exactly how I treat the actual modification of quantities for the subscription, right?

half tartan
#

Correct!