#william_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222544001660485664
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share more context about what you were expecting to see and what are you at the moment?
Is there a guide you're following for this?
I don't think subscription_quantity is a valid API parameter here ๐ค
https://docs.stripe.com/api/invoices/upcoming
fwiw, we have a doc here that explains the upcoming invoice API a bit: https://docs.stripe.com/billing/subscriptions/prorations?lang=node#preview-proration
Yes, I don't understand the logic of retrieveUpcoming.
Let me explain:
I have a subscription and its price is 106.8 incl. French VAT.
The user can modify the quantity of the subscription, so if the quantity is 2, the result will be 213.6 (variable depending on the prorata), but retrieveUpcoming doesn't give me this total.
Yes, subscription quantity isn't in the doc, but it doesn't return any error and it does modify the retrieveUpcoming total.
Can you share a request ID for the example request you're making?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
What amount are you getting back in the invoice instead? What are you setting subscription_proration_date to?
Here is the request id:
req_jgzqaRNrHLwuel
Yes, I've tried setting subscription_proration_date as in the doc, but it doesn't change the result.
Can you share the response object you're seeing?
I do see information on the total and the tax involved in that response:
subtotal_excluding_tax: 44499,
tax: 8899,
test_clock: null,
total: 53398,```
Can you tell me more about what you are expecting to see? Is it that the tax seems to be calculated incorrectly, or is something missing?
Currently the quantity is 3, if the customer goes to 4 I'll have to charge him an additional subscription based on the prorata, so here since it's the same day it's a full price subscription, so 89 excluding tax, whereas here it's 444.99, so 5 subscriptions.
Can you try this again and print out the objects that are in the upcoming invoice's lines property? It looks like we just have [Object object] at the moment. The price doesn't seem to quite line up with a quantity of 5 either so I am not immediately sure what may be happening here
Thank you!
So the last proration item does show an amount of 35600 which is 4*8900. It looks like we got to a subtotal of 44499 because the proration related items had amounts of 35595 and 26696 . But I'm not immediately sure why there is the full amount of the 4 are there as well as the proration amounts. That may be showing what the next invoice would be if the proration items were on it.
object: 'line_item',
amount: 35600,```
Ah that is exactly it, we default to create_prorations with this endpoint. https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-subscription_proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you specify always_invoice that will show just the proration amounts.
Ah yes indeed with always invoice it returns coherent values to me!
Thanks to you !
Have a nice day!
Of course, thank you for your patience. I am glad we could figure that out