Prompt
How do I support tax-inclusive and tax-exclusive pricing across different countries?
Latest observation
To support both tax-inclusive and tax-exclusive pricing across countries, design your pricing system so the stored base price is separate from tax presentation and calculation.
1) Store a canonical net price
Keep one authoritative price per item, usually:
- Net price = price before tax
- Tax is computed at checkout based on:
- buyer location
- product tax category
- applicable tax rules
This works well for tax-exclusive markets like the US, where prices are often shown before tax.
2) Support display mode by market
For each country or sales region, define whether prices should be shown as:
- Tax-exclusive display: show base price, add tax at checkout
- Tax-inclusive display: show final consumer price including tax
Examples:
- US: usually tax-exclusive
- UK/EU/AU/NZ/JP: often tax-inclusive for consumer-facing prices
3) Use reversible math
If you need to display a tax-inclusive price but store net price, calculate:
- Gross = Net × (1 + tax rate)
- Net = Gross ÷ (1 + tax rate)
Example:
- Net price = 100.00
- VAT = 20%
- Gross displayed = 120.00
If the stored price is gross and you need net for accounting:
- Net = 120.00 ÷ 1.2 = 100.00
4) Keep tax rounding rules explicit
Different countries round tax differently:
- per line item vs per invoice
- round tax before summing vs after summing
Define this per jurisdiction to avoid mismatches.
5) Separate:
- Price storage
- Tax computation
- Display formatting
- Invoice/accounting output
That lets you handle:
- B2C vs B2B
- different VAT/GST rates
- tax exemptions
- product-specific tax rules
6) Recommended data model
A practical setup:
base_price_netcurrencytax_categorymarket/countrydisplay_pricing_mode(inclusive/exclusive)tax_ratetax_amountgross_price
7) Checkout flow
At checkout:
- Determine customer country/tax status
- Load tax rules
- Calculate applicable tax
- Show price according to local convention
- Store both net and tax amounts on the order
8) Important edge cases
Handle:
- digital goods vs physical goods
- cross-border sales
- tax-exempt customers
- multi-currency pricing
- promotions/discounts applied before or after tax depending on local law
- “price includes tax” requirements in consumer advertising
9) Best practice
If you sell internationally, the safest model is:
- Store net prices
- Compute tax dynamically
- Display gross where required
- Persist both net and gross on the order
If you want, I can also give you:
- a database schema
- tax calculation formulas
- or an implementation example in code for a specific stack.