Overview
Lunar provides manual tax rules to implement the correct sales tax for each order. For complex taxation scenarios (e.g. US states), integrating with a service such as TaxJar is recommended.Tax Classes
Tax Classes are assigned to products and allow classification into taxable groups that may have differing tax rates.| Field | Type | Description |
|---|---|---|
id | id | Primary key |
name | string | e.g. Clothing |
default | boolean | Whether this is the default tax class |
created_at | timestamp | |
updated_at | timestamp |
Tax Zones
Tax Zones specify a geographic zone for tax rates to be applied. They can be based on countries, states, or zip/postcodes.| Field | Type | Description |
|---|---|---|
id | id | Primary key |
name | string | e.g. UK |
zone_type | string | country, states, or postcodes |
price_display | string | tax_inclusive or tax_exclusive |
active | boolean | Whether the zone is active |
default | boolean | Whether the zone is the default |
created_at | timestamp | |
updated_at | timestamp |
Tax Zone Countries
| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_zone_id | foreignId nullable | |
country_id | foreignId nullable | |
created_at | timestamp | |
updated_at | timestamp |
Tax Zone States
| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_zone_id | foreignId nullable | |
state_id | foreignId nullable | |
created_at | timestamp | |
updated_at | timestamp |
Tax Zone Postcodes
| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_zone_id | foreignId nullable | |
country_id | foreignId nullable | |
postcode | string | Supports wildcards, e.g. 9021* |
created_at | timestamp | |
updated_at | timestamp |
Tax Zone Customer Groups
| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_zone_id | foreignId nullable | |
customer_group_id | foreignId nullable | |
created_at | timestamp | |
updated_at | timestamp |
Tax Rates
Tax Zones have one or many tax rates. For example, a zone might have a tax rate for the state and also the city, which collectively make up the total tax amount.| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_zone_id | foreignId nullable | |
priority | tinyInteger | The priority order for this rate (default 1) |
name | string | e.g. UK |
created_at | timestamp | |
updated_at | timestamp |
Tax Rate Amounts
| Field | Type | Description |
|---|---|---|
id | id | Primary key |
tax_class_id | foreignId nullable | |
tax_rate_id | foreignId nullable | |
percentage | decimal(7,3) | e.g. 6 for 6% |
created_at | timestamp | |
updated_at | timestamp |
Settings
- Shipping and other specific costs are assigned to tax classes in the settings.
- Tax calculation can be based on the shipping or billing address.
- A default Tax Zone can be configured.