#smoke
1 messages · Page 1 of 1 (latest)
Hello there
You would typically retrieve this from the line items either from an invoice preview or post-payment. What integration are you using?
working with your api in Go
this is for subscriptions by the way, not sure if that matters
Gotcha, then yeah if you want to know ahead of time you can use our Upcoming Invoice endpoint: https://stripe.com/docs/api/invoices/upcoming
Otherwise, you look at the invoice's line item(s) and you can see info on the discount like discount_amounts: https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-discount_amounts
Hmm what would be the correct way to do this, assuming we aren’t looking at an invoice for any specific customer. We want to show the price to a customer including a discount but before creating a checkout session. We haven’t been managing invoices manually so in some cases these customers may not even have any previous or upcoming invoices
Yeah in that case you would want to preview a new Subscription with the Product/Price and the discount.
Specifically, we have existing members on our website referred from another promotion and want to show them the discounted price they would receive before they click anything or go to the stripe checkout page
We also will display the proper amount in the Checkout Session... but that is after the redirect (obviously)
Ok this sounds promising
Yep overall you want to use https://stripe.com/docs/api/invoices/upcoming
Ok yup see the preview stuff in there. Thank you!