|
1
|
export const metadata = { |
|
2
|
title: `Tax Rates and Rules`, |
|
3
|
} |
|
4
|
|
|
5
|
# {metadata.title} |
|
6
|
|
|
7
|
In this guide, you’ll learn about tax rates and rules. |
|
8
|
|
|
9
|
<Note title="Looking for no-code docs?"> |
|
10
|
|
|
11
|
Refer to this [Medusa Admin User Guide](!user-guide!/settings/tax-regions#manage-tax-rate-overrides) to learn how to manage tax rates using the dashboard. |
|
12
|
|
|
13
|
</Note> |
|
14
|
|
|
15
|
## What are Tax Rates? |
|
16
|
|
|
17
|
A tax rate, represented by the [TaxRate data model](/references/tax/models/TaxRate), is a percentage amount used to calculate the tax amount for each taxable item’s price, such as line items or shipping methods, in a cart. The sum of all calculated tax amounts are then added to the cart’s total as a tax total. |
|
18
|
|
|
19
|
Each tax region has a default tax rate. This tax rate is applied to all taxable items of a cart in that region. |
|
20
|
|
|
21
|
The `TaxRate` data model has a `rate` property that represents the percentage amount. For example, a `rate` of `10` means a tax rate of 10%. |
|
22
|
|
|
23
|
### Combinable Tax Rates |
|
24
|
|
|
25
|
Tax regions can have parent tax regions. To inherit the tax rates of the parent tax region, set the `is_combinable` of the child’s tax rates to `true`. |
|
26
|
|
|
27
|
Then, when tax rates are retrieved for a taxable item in the child region, both the child and the parent tax regions’ applicable rates are returned. |
|
28
|
|
|
29
|
--- |
|
30
|
|
|
31
|
## Override Tax Rates with Rules |
|
32
|
|
|
33
|
You can create tax rates that override the default for specific conditions or rules. |
|
34
|
|
|
35
|
For example, you can have a default 10% tax rate, but for products of type “Shirt” it is 15%. |
|
36
|
|
|
37
|
A tax region can have multiple tax rates, and each tax rate can have multiple tax rules. The [TaxRateRule data model](/references/tax/models/TaxRateRule) represents a tax rate’s rule. |
|
38
|
|
|
39
|
 |
|
40
|
|
|
41
|
The following two properties of the data model identify the rule’s target: |
|
42
|
|
|
43
|
- `reference`: the name of the table in the database that this rule points to. For example, `product_type`. |
|
44
|
- `reference_id`: the ID of the data model’s record that this points to. For example, a product type’s ID. |
|
45
|
|
|
46
|
So, to override the default tax rate for product types “Shirt”, you create a tax rate and associate with it a tax rule whose `reference` is `product_type` and `reference_id` the ID of the “Shirt” product type. |