#Julio-preview-invoice-discount

1 messages · Page 1 of 1 (latest)

frigid zinc
#

Hi there 👋 did you apply a Coupon to that Customer?

sleek plank
#

ok i'll explain better

#

This customer has already a subscription in which he has used a Coupon.
id = cus_Mba5UgIzPyRvCS

But i only want to get the upcoming invoice of a oneshot invoice .
Meaning i have a price and a quantity and i want to check how much he will pay for this particular price and quantity.
But for this upcoming call, i don't want to get the upcoming invoice of the subscription

frigid zinc
#

The request to retrieve an upcoming invoice will include Subscription information, the exact behavior that the system uses is described here:
https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription

If you want to avoid including any existing details from a Customer when previewing an Invoice, then it is likely easiest to create a new Customer object that is purely used for previewing invoices (never has a Subscription created for it or Invoice Items left on it).

sleek plank
#

ohhh

#

i can't see the sentences you've copied in here on the doc

#

about the "new Customer"

frigid zinc
#

That's not in the documentation, it's my recommendation.

sleek plank
#

ok ok

#

then i'm obliged to create a new customer everytime ?

frigid zinc
#

No, I would avoid putting any Subscriptions or Invoice Items on that Customer, and repeatedly use it for previewing one-off Invoices.

sleek plank
#

ok a dummy customer just for these previews , got it

frigid zinc
#

Yup, exactly.