I'm fetching my next upcoming invoice for a customer so that I can charge them immediately.
So I fetch the next/upcoming invoice object and I see the data being returned (see pic), but then in order to pay/charge the upcoming invoice I need to pass the invoice id on to the 'StripeInvoiceService' method 'Pay'. But there is no id for the upcoming invoice, the value is null! Am I misunderstanding something here? As far as I'm aware, when I create invoice items for a customer under a subscription an invoice is automatically generated for the next billing cycle containing all of the invoice items...
Here is my code to fetch the upcoming invoice and then pay it
// get upcoming invoice
StripeInvoice upcomingInvoice = new StripeInvoiceService().Upcoming(profile.StripeCustomerId);
// charge card
StripeInvoice invoice = new StripeInvoiceService().Pay(upcomingInvoice.Id);
Here is the data that is returned, it shows the invoice but no id.

This is expected behavior on Stripe's end. The Retrieve Upcoming Invoice API allows you to visualize what the next invoice for a customer's subscription will look like. You can use this API to tell your user how much they will pay next time or simulate an upgrade/downgrade of the subscription.
This invoice does not exist yet, it's just a preview of what will happen when your subscription renews. Since it does not exist, it does not have an id and can't be retrieved directly. You also can not pay this invoice in advance. It can only be paid on the day the subscription renews.