#Eranga-subscription

1 messages ยท Page 1 of 1 (latest)

ornate lagoon
#

Hi there, I was wondering if you have a request id I could look into please?

stoic latch
#

Sure, I'll send it

#

Give me a sec, I'll send a new request and send the request ID

#

I'm using NodeJS SDK and the call is done like this
const upcomingInvoice = await this.stripe.invoices.retrieveUpcoming(stripeInvoiceParams);

#

I couldn't find a request ID from this response

ornate lagoon
#

Would you be able to provide the response please (omitting the information not required)?

stoic latch
#

You mean the line items?

ornate lagoon
#

the response from the code you ran above ๐Ÿ™‚

stoic latch
ornate lagoon
#

The reason why you are observing multiple line items within the subscription is because you are providing the subscription_items , if this is provided you will update the subscription with these items, therefore adding the additional invoice line items.

You can get the upcoming invoice directly with the customer and subscription via the API https://stripe.com/docs/api/invoices/upcoming

stoic latch
#

Yeah, I am trying to use this to get the proration as well

#

Assume the customer wants to update quantity

#

My goal is to use the same logic and get the prorated invoice, as well as the upcoming invoice without proration

#

How can we do this?

#

In subscription_items I haven't changed anything in this scenario. That is why I expected that nothing would change.

ornate lagoon
#

This is not possible to update the quantity with this same logic and get both the prorated invoice and the upcoming invoice without proration

stoic latch
#

Oh, okay. Thank you

#

I have another question

#

Assume I have only one product in the subscription

#

And there is a coupon applied to the subscription

#

In my upcoming invoice request, I am going to remove this coupon by passing an empty string `` in discounts

#

I change nothing else in upcoming invoice parameters (the one I sent earlier)

#

Now in my upcoming invoice, will there be any discount_amounts ?

#

Okay, disregard my last question. I tested it