@classytic/us-tax
v0.1.0
Published
United States tax pack for @classytic/tax-core — destination/origin-sourced sales & use tax with economic nexus (post-Wayfair), product taxability categories, per-state resolvers, a sales-tax return TaxEngine with ledger posting adapter, and effective-dat
Readme
@classytic/us-tax
United States tax pack for @classytic/tax-core — and the ecosystem's
contract-validation pack: US sales tax shares no mechanics with VAT
(geography sourcing, economic nexus, price cliffs, no input credit), so
every tax-core seam is stress-tested here. Verdict:
VALIDATION.md. Verified rules + provenance:
docs/research-2026-07.md.
What ships (0.1.0)
| Area | Coverage |
|---|---|
| State rates | All 50 + DC statutory rates, effective-dated — including already-enacted FUTURE law (SD 4.2→4.5 on 1 Jul 2027, LA 5.0→4.75 in 2030) |
| Sourcing | Origin/destination per state (CA modified-origin flagged); interstate always destination |
| Economic nexus | Post-Wayfair thresholds per state: $100k standard, CA/TX/NY $500k, NY/CT conjunctive, remaining count tests (KY's removal on 1 Aug 2026 pre-encoded) |
| Taxability | Grocery (8 taxing states, reduced rates), clothing (NY $110 cliff, MA/RI slice, PA/NJ/MN/VT exempt), SaaS (per-state incl. TX 80% base, CT 1% business, MD 3% B2B) |
| Line calc | calculateSalesTax — sourcing → nexus gate → taxability transforms → state + injected local layer, integer cents |
| Resolver | createUsTaxResolver({ state }) — tax-core TaxResolver per nexus state |
| Return engine | createSalesTaxReturnEngine(state) — the first real tax-core TaxEngine: validate → TaxObligation → salesTaxLedgerAdapter → wireTaxToLedger (balanced settlement entries, vendor discount) |
| Federal | TY2025/TY2026 brackets (IRS Rev. Proc.-verified, single + MFJ), standard deductions, 1099-NEC $600→$2,000 window, 1099-K restored 20k/200 |
| Hot-patch | extendUsTaxRules — dated boot-time overrides via tax-core registries |
The local-rate boundary (read this)
The ~13,000 local jurisdictions are a DATA SERVICE, not library data.
This pack owns the verifiable statutory layer; hosts inject the local
layer per transaction (localRate) from their provider (ZIP-level table,
Avalara/TaxJar, a state rate file). CA note: district taxes source to
destination even though CA is otherwise origin.
Quick start
import { calculateSalesTax, createUsTaxResolver } from '@classytic/us-tax';
// Line pricing — remote sale into Washington with nexus
const r = calculateSalesTax({
sellerState: 'FL', buyerState: 'WA', category: 'GENERAL',
amountMinor: 500_00, localRate: 3.1,
nexus: { salesMinor: 150_000_00 },
});
// r.taxMinor · r.useTaxOwedByBuyer · r.sourcing · r.nexusCheck
// Per-state resolvers keyed by your nexus footprint
const resolvers = new Map(
['CA', 'TX', 'NY'].map((s) => [s, createUsTaxResolver({ state: s })]),
);
// Period close — post the TX return through your ledger
import { wireTaxToLedger } from '@classytic/tax-core';
import { createSalesTaxReturnEngine, salesTaxLedgerAdapter } from '@classytic/us-tax';
const postReturn = wireTaxToLedger(
createSalesTaxReturnEngine('TX'),
salesTaxLedgerAdapter,
engine.repositories.journalEntries,
);Out of scope (deliberate)
Local-rate data · physical-presence nexus (host flag) · state income tax · payroll (FICA/FUTA) · HoH/MFS federal brackets (unverified — not interpolated) · state form renderers (layer over the return engine like Mushak formVersions).
ESM only · Node ≥ 20 · integer cents · effective-dated with provenance · MIT
