TaxJar¶
TaxJar connects Vectis to TaxJar for real-time US sales tax at cart and checkout, period liability reports, and automatic syncing of placed orders into TaxJar's transaction ledger — the data TaxJar's AutoFile service and reporting rely on. Use it when you want jurisdiction-accurate sales tax computed by TaxJar instead of maintaining DB rate tables by hand.
At a glance
| Extension id | taxjar |
| Category | tax |
| Version | 0.1.0 |
| Provides | Tax calculation strategy (stage 100), tax filing strategy, order.placed sync handler, admin settings link |
| External account | TaxJar account with an API token |
What It Provides¶
- Sales tax calculation — a
TaxCalculationStrategyregistered under the nametaxjarat stage100in the stage-sorted tax engine. Each calculation calls TaxJar'sPOST /v2/taxesendpoint and emits per-line tax lines of typesaleswith the jurisdiction (city, county, state, country) TaxJar resolved. Excise strategies at stage200(see ExciseEngine) run after it and can read its rounded output viaTaxContext.prior_stage_tax_by_line. - Tax filing — a
TaxFilingStrategyregistered under the same name.generate_reportaggregates a period's liability from TaxJar's transaction ledger (GET /v2/transactions/ordersandGET /v2/transactions/refunds, then per-transaction detail fetches).submit_filingmarks the period as submitted locally only — TaxJar exposes no programmatic file-return endpoint; actual remittance is handled by TaxJar AutoFile out-of-band.list_filingsreturns an empty list; filing history is read from local records. - Order sync — subscribes to the
order.placedevent (priority 80). When Auto-sync Orders to TaxJar is on, each placed order is pushed toPOST /v2/transactions/orderswith per-line quantities, unit prices, and the sales-type tax amounts recorded on the order. - Admin settings link — the manifest contributes a Tax Filing settings page entry pointing at
/settings/tax-filing.
Setup¶
- Enable the extension for your channel under Settings > Extensions.
- In the extension's configuration, enter your TaxJar API Token and the required ship-from fields (Ship-from Country, Ship-from Postal Code; state/city/street are optional but improve sourcing accuracy — TaxJar uses the
from_*fields for nexus routing). - Toggle Use Sandbox Environment to point at
https://api.sandbox.taxjar.com/v2instead ofhttps://api.taxjar.com/v2. - Alternatively, credentials can come from environment variables — channel config is checked first, then
TAXJAR_API_KEY,TAXJAR_SANDBOX,TAXJAR_FROM_COUNTRY,TAXJAR_FROM_ZIP,TAXJAR_FROM_STATE,TAXJAR_FROM_CITY,TAXJAR_FROM_STREET, andTAXJAR_AUTO_SYNC.
Strategies register at activation
Strategy registration happens when the extension activates at boot. If no API key is resolvable at that point, the extension activates its manifest (so it appears in the admin) but registers no strategies — the log shows TaxJar extension activated without API key — strategies not registered and the core DB-rate tax strategies continue to run. Once registered, credentials are re-resolved on every call, so credential rotation takes effect immediately.
Configuration Reference¶
| Key | Type | Required | Secret | Description |
|---|---|---|---|---|
api_key |
password | Yes | Yes | API Token |
sandbox |
boolean | No | No | Use Sandbox Environment (default false) |
from_country |
string | Yes | No | Ship-from Country (default US) |
from_zip |
string | Yes | No | Ship-from Postal Code |
from_state |
string | No | No | Ship-from State |
from_city |
string | No | No | Ship-from City |
from_street |
string | No | No | Ship-from Street |
auto_sync_orders |
boolean | No | No | Auto-sync Orders to TaxJar (default true) |
Secret fields are stored Fernet-encrypted and masked in the admin.
Permissions¶
tax.manage
Permissions are upserted at boot from the manifest; assigning them to roles is manual.
Operational Notes¶
- Rate limiting — the API client retries up to 3 times on HTTP 429, honoring the
Retry-Afterheader (fallback backoff 2 s x attempt number). If retries are exhausted, the calculation logs a warning and returns no tax lines. - Fail-open calculation — TaxJar API errors during checkout are logged and produce zero TaxJar tax lines; checkout is not blocked. Calculation is also skipped when the destination address has neither a postal code nor a state, and for tax-exempt contexts (respecting per-strategy exemptions).
- Order sync is best-effort — a failed
POST /v2/transactions/orderspush is logged as a warning and does not affect order placement. - Filing is report-plus-local-record — see the Tax usage guide for the filing workflow; the extension never remits money.
- Every API call uses a 15 s timeout.
For the extension developer view, see Building Extensions.