docs/developer/core-concepts/taxes.mdx
Spree uses Tax Categories and Tax Rates to calculate taxes for orders. Products are assigned to tax categories, and tax rates define the percentage charged within specific geographic Zones.
erDiagram
TaxCategory ||--o{ TaxRate : "has many"
TaxCategory ||--o{ Product : "has many"
TaxRate }o--|| Zone : "applies in"
TaxRate ||--o{ Adjustment : "creates"
Zone ||--o{ ZoneMember : "has many"
TaxCategory {
string name
boolean is_default
string tax_code
}
TaxRate {
string name
decimal amount
boolean included_in_price
}
Zone {
string name
string kind
}
Key relationships:
Tax categories group products by how they're taxed. Common examples:
Each product is assigned a tax category. One category can be set as the default for products that don't have an explicit assignment.
| Attribute | Description | Example |
|---|---|---|
name | Category name | Clothing |
is_default | Whether this is the default category | true |
tax_code | Code from your tax provider (e.g., Stripe, Avalara) | 1257L |
Tax rates define the percentage charged for a specific tax category within a geographic zone.
| Attribute | Description | Example |
|---|---|---|
name | Rate name | California Sales Tax |
amount | Tax percentage as a decimal | 0.08 (8%) |
included_in_price | Whether tax is included in the displayed price | false |
zone | Geographic region where this rate applies | US |
tax_category | Products this rate applies to | Clothing |
Common in the United States. The displayed price does not include tax — tax is added at checkout based on the shipping address.
Example: A $17.99 item with 5% sales tax:
Common in Europe and many other countries. The displayed price already includes tax. When shipping outside the tax zone, the tax is removed from the price.
Example: A £17.99 item with 5% VAT included:
Spree uses a default tax zone to estimate taxes before the customer enters a shipping address. This is important for stores with tax-inclusive pricing (VAT) — it determines which tax rate is assumed in the displayed price.
If the customer's shipping address is outside the default tax zone, the assumed tax is removed and the correct rate for their zone is applied.
During checkout, taxes are calculated based on the shipping address:
Tax categories and rates are managed in the Admin Panel under Settings → Taxes, or via the Admin API.
US store with state-level sales tax:
included_in_price: falseEU store with VAT:
included_in_price: trueDigital products in the EU: