#theruv-subscription-preview
1 messages · Page 1 of 1 (latest)
theruv-subscription-preview
@bronze hazel you can use https://stripe.com/docs/api/invoices/upcoming to preview the first Invoice of a Subscription before creating it. The main downside is that it doesn't support PromotionCode just yet so you'll have to pass the Coupon id instead
Thank you - I won't have a Stripe customer at the time I'm looking to display the final price
The use case is that the user passes a promo code, and I want to display the final price before they enter their details
That API works fine without it, try it
What would i enter here for customer?
const invoice = await stripe.invoices.retrieveUpcoming({
customer: 'cus_NCAnSnHLlyRwP2',
});
you would pass https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-customer_details instead I think
I wouldn't have a customer at this point though right
what have you tried exactly though?
Like if you pass customer_details such as just a country or something it works fine
Oh interesting, so I can just pass country and expect it to work
yeah I flagged a feature request to make customer fully optional now
Thank you. Docs says this is required though - is this outdated. Just want to confirm before flagging to the team
Yeah I flagged already, we'll hopefully fix it in the future