Skip to main content
Every invoice flexprice generates follows the same deterministic sequence. Getting this order right matters when you combine coupons at multiple levels, wallet credits, and tax rates.

The sequence

Worked example

Wallet credits reduce the amount owed but do not reduce the taxable base. Tax is calculated on subtotal - coupon_discounts, not on subtotal - coupon_discounts - wallet_credits.

Coupon chaining

Multiple subscription-level coupons apply sequentially. Each coupon sees the amount remaining after the previous one, not the original subtotal.
Two 10% coupons produce a 19% effective discount, not 20%.

Line-item vs subscription-level coupons

A subscription-level coupon sees a subtotal that has already been reduced by any line-item coupons.

Multiple tax rates

When multiple tax associations apply to the same invoice, each rate is applied to the same taxable amount independently. They do not compound.

Zero-floor rule

If coupons collectively exceed the subtotal, the taxable amount is clamped to zero. Excess discount is not carried forward to the next invoice period.

See also