I’m using Stripe to manage payment at work.
I need to show my users a list of prices, but it’s not really the price before tax that I’m after. It’s the price after tax and using a coupon if any.
So this looks like the ideal use case for the get upcoming invoice endpoint.
Except that with the following conditions, it doesn’t work:
- Subscription is trialing
- The subscription is set to pay now (not the invoice option)
- The customer currently has no payment methods at all
In this case, I get an error saying
The subscription will pause at the end of the trial instead of generating an invoice because the customer has not provided a payment method and trial_settings[end_behavior][missing_payment_method] is set to `pause`.; code: invoice_upcoming_none;
No matter what state my user is in currently, I want to be able to show the price after tax, including the coupon if any.
I have been talking to someone of the Stripe team on Discord here and I have asked why it’s possible from the customer portal:
But not in my case and the answer is unfortunately that apparently it’s not part of their public API…
Am I really the first one to need this? As anyone found a workaround?
The only workaround that the person on Discord is offering is to modify the subscription and mark it to use and invoice, make the call to the upcoming invoice, then migrate back to not use an invoice by updating the subscription again.
This really feels like a terrible idea to update the subscription twice like this, especially for a readonly (GET) endpoint on my side…
I feel stuck and have no idea how to achieve what looks like a basic use case. Any help welcome!