#eirikbakke
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
I'm not sure this is possible
you can only preview the next invoice of a subscription
actually, you can but you'd have to use the same API (upcoming invoices) as if it's not related to the subscription in question
and pass in https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-invoice_items and https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_start_date
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah, I tried that, and it almost worked, except it fails with a "The price specified is inactive." error if the existing subscription uses a price that has now been archived.
yes that's one of the caveats
I don't really think there's a workaround, unless you use price_data instead of price ID
oh, interesting, i can try that.
thanks for that idea
by the way, do you happen to know how the Billing Portal does this?
our internal pages (Dashboard, Billing Portal, etc) don't necessarily use the API
OK, good to know. Otherwise my next suggestion would have been to open source the Billing Portal ๐
Thanks for your help!
let me know if you need any more help
I tried the priceData idea, I think it works. Thanks for that idea! No more help needed in this thread.
glad to hear that