#Maranello-upcoming-invoice
1 messages · Page 1 of 1 (latest)
Hi, are you able to reword the difference you're seeing between the Upcoming Invoice and the Subscription Update API?
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.
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?
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?
You'd want to look at this reference: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_items-quantity. Let me test this on my end.
This is all I am looking at, that's why I am resorting to Discord.
I just tested this, and you'd want to pass in the subscription items id: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_items-id and your desired quantity update, https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_items-quantity to get what you're looking for.
Are you able to try this on your end?
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.
Ok, so what is broken? Can you be way more detailed here?
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?
👋 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
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
Can you share a request ID of an example retrieve upcoming invoices request that is resulting in the huge amount you're not expecting?
are you able to check the sub_id?
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
Can we start by looking at the subscription so that my concerns are more concrete?
I have that subscription open already - but your concerns were more with the upcoming invoices API, right?
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.
You're getting that high quantity because you're using the default proration behavior, which will create the prorations but not invoice them until the next natural invoice. If you want to preview how much they should be charged for immediately you have to pass in subscription_proration_behavior: always_invoice (https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_behavior)
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
alright, so the quantity I pass to the upcoming invoice is [existing + new] if I am adding to it, right?
yup!
exactly how I treat the actual modification of quantities for the subscription, right?
Correct!