#theruv-subscription-preview

1 messages · Page 1 of 1 (latest)

vocal sirenBOT
tidal minnow
#

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

bronze hazel
#

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

tidal minnow
#

That API works fine without it, try it

bronze hazel
#

What would i enter here for customer?

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

tidal minnow
bronze hazel
#

I wouldn't have a customer at this point though right

tidal minnow
#

what have you tried exactly though?

#

Like if you pass customer_details such as just a country or something it works fine

bronze hazel
#

Oh interesting, so I can just pass country and expect it to work

tidal minnow
#

yeah I flagged a feature request to make customer fully optional now

bronze hazel
#

Thank you. Docs says this is required though - is this outdated. Just want to confirm before flagging to the team

tidal minnow
#

Yeah I flagged already, we'll hopefully fix it in the future