Overview
The exclude jurisdiction logic allows you to configure tax rates that selectively exclude certain jurisdiction types from tax calculations. This is useful for scenarios where specific jurisdiction types should not be taxed based on the tax rate configuration.How it works
When a tax rate is configured with excluded jurisdiction types, the calculation engine filters out those jurisdiction types before applying the tax rate. This ensures that tax is only calculated for the appropriate jurisdictions.Database schema
Thejurisdiction_rates table includes an exclude_jurisdiction_types column:
Jurisdiction types
The following jurisdiction types can be excluded:STATE_OR_PROVINCE- State or province level jurisdictionsCOUNTY- County level jurisdictionsCITY- City level jurisdictionsDISTRICT- Special district jurisdictionsLOCAL- Local jurisdictions
Configuration
Setting excluded jurisdictions
When ingesting tax rates via CSV, you can specify excluded jurisdiction types in theexclude jurisdictions column:
- Split the comma-separated values
- Trim whitespace from each type
- Sort them lexicographically
- Validate each type against the allowed jurisdiction types
- Store them in the database
Validation
The system validates that all excluded jurisdiction types are valid. If an invalid type is provided, the ingestion will fail with an error:Calculation behavior
During tax calculation, the exclude jurisdiction logic works as follows:- Jurisdiction resolution: The system resolves all applicable jurisdictions for the transaction address
- Rate retrieval: Tax rates are fetched for the resolved jurisdictions
- Filtering: For each rate with
exclude_jurisdiction_typesconfigured, the system filters out jurisdictions matching those types - Tax calculation: Tax is calculated only on the remaining (non-excluded) jurisdictions
Example scenario
Consider a transaction in California with the following resolved jurisdictions:STATE_CA_1001(State)CO_CEN_06_037(County - Los Angeles)CI_CEN_06_037_44000(City - Los Angeles)
commenda_jurisdiction_id:STATE_CA_1001rate: 7.25%exclude_jurisdiction_types:["CITY", "DISTRICT"]
- Apply the 7.25% rate to state and county jurisdictions
- Exclude city and district jurisdictions from this rate
- Allow other rates (if configured) to apply to the excluded jurisdiction types
Use cases
State-level exemptions
Exclude local jurisdictions when applying state-level tax rates:County-level restrictions
Exclude city jurisdictions when applying county rates:Special district handling
Exclude specific jurisdiction types for special tax districts:API integration
The exclude jurisdiction logic is automatically applied during tax calculations through the calculation endpoint. No additional API parameters are required - the logic is driven entirely by the tax rate configuration in the database.Calculation endpoint
When you call the calculation endpoint:- Resolves jurisdictions for the provided address
- Retrieves applicable tax rates
- Applies exclude jurisdiction filtering
- Returns the calculated tax amounts
Best practices
- Be specific: Only exclude jurisdiction types that should genuinely not be taxed by this rate
- Avoid conflicts: Ensure excluded jurisdictions have alternative rates configured if they should be taxed
- Test thoroughly: Verify calculations with various address combinations to ensure correct behavior
- Document exceptions: Keep records of why specific jurisdiction types are excluded for audit purposes