#mathiasm8

1 messages ยท Page 1 of 1 (latest)

civic bladeBOT
crystal schooner
#

Could you elaborate with some concrete example Ids?

wispy summit
#

Yes. Looking at this customer with this subscription: sub_1OLYSZHVEPNMaKoQ16S5p1De

#

I see some upcoming invoices

#

+10

#

But when I call the API to recieve the upcoming invoice for that user, I only get one item in the array. I would have expected the same list?

crystal schooner
#

Okie it has a bunch of prorations. What result do you get when calling Upcoming Invoice for the user?

wispy summit
#

I receive an upcoming invoice with one line in it:

crystal schooner
#

Is that lump sum of all those items? No, right?

wispy summit
#

If I somehow can share the entire json response privately I could do so?

#

This is the call I make:

#

const upcomingInvoice = await stripe.invoices.retrieveUpcoming({
customer: 'cus_Oy3PWMZxcX7xsT',
});

crystal schooner
#

This is Test mode right? Feel free to share the response in a file here

wispy summit
#

Yes this is test

crystal schooner
#

Btw

#

What do you get?

wispy summit
#

This is the intire json response I get when making the call above

#

entire*

#

Another way to solve this, could be to set the proration_behavior = always invoice, which I'm considering.

#

As it seems more simpler ๐Ÿ™‚

crystal schooner
#

That's the response from here

#

Which is for "WODHERO PREMIUM โ€ข WODHERO PREMIUM" on Dec 19

#

sub_1OLYSZHVEPNMaKoQ16S5p1De is on Jan 9, so the one on Dec 19 is more "near future", hence it's displayed for the whole customer instead

#

You can specify the Subscription Id on your Upcoming Invoice to get the exact Upcoming on the Subscription you want

wispy summit
#

So if I specify the subscription id on the upcoming invoice, I would then get the more detailed lines insted of the summarized invoice?

#

This call:

#

Also includes just includes "il_tmp_11ee22HVEPNMaKoQ3e082f25"

crystal schooner
#

You will get the correct Upcoming Invoice of that Subscription

#

without subscription it will take the nearest Subscription's Invoice, which could be a different Subscription

wispy summit
civic bladeBOT
crystal schooner
#

That page has a lot of different Subscriptions

#

Again you would want to limit down to one Subscription by passing the subscription parameter as mentioned above

wispy summit
#

Okay.

dark saffron
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

wispy summit
#

I think I understood enough of it to get me going. However I think it will be more simpler if I just use the proration behavior to always invoice. I can't see situations where this would not work or be a bad thing? It would be more simpler to implement and also help prevent fraudulent if not paying upcoming invoices?

dark saffron
#

always invoice might mean that your customer could pay for the same period twice

wispy summit
#

Good to know, I was not aware of that!

#

I think I'm good for know, thank you for the great support ๐Ÿ™‚

#

now*

dark saffron
#

let me know if you need any more help

wispy summit
#

Will do.