#whiskey-Invoice
1 messages · Page 1 of 1 (latest)
Hi there, I believe you can find the answer in this doc https://stripe.com/docs/billing/taxes/tax-rates#discounts
Hi Jack, that is useful although it only shows per-item discounts. Is there documentation on how it works when a fixed dollar discount (like a coupon) is applied to a whole invoice?
The discount will be applied proportionally to all line_items in the invoice.
@lavish raven from a maths point of view I would make it even propportions.
Let's say you have 10$ and 5$ product.
10$ = 5$ x 2
If the fixed $ discount is 3$ you would get an ecuation like X + 2X = 3 (Equal proportions as for the prices because 10$ = 5$*2) so X = 3
I would apply a 2$ discount to the 10$ product and 1$ discount to the 5$ product
As Jack said, you have to compute what percent of the total each item represents
But Stripe does that for you
@hushed echo Thanks, thats helpful! I'll try it out and see if it matches up with Stripe's output.