Architecture Note · Finance & Legal
Global Sales Tax, VAT & GST Engine: Deterministic Place-of-Supply and Audit Evidence
Why probabilistic LLM tax lookups fail statutory audits—and how deterministic 46-jurisdiction rules, check-digit ID snapshots, and Tax Lead return gates keep indirect tax defensible.
The Operational Problem: Quiet Nexus Breaches and Unverified Zero-Rating
Cross-border SaaS and omnichannel finance teams hit indirect tax exposure long before hiring regional tax counsel. Rolling 12-month sales cross US state Wayfair thresholds or the EU €10,000 OSS threshold unnoticed, while billing pipelines treat SaaS identically in California (exempt when delivered electronically without tangible media), Texas (80% taxable data processing), New York (8.875% combined destination rate), and Washington (10.25% digital automated services). On cross-border B2B invoices, failing to verify a buyer’s German USt-IdNr. or UK VAT number—or letting a US resale certificate expire—turns zero-rated revenue into uncollected statutory liability during an audit.
Why Naive AI Tax Assistants Fail Compliance Scrutiny
Querying a foundation model for indirect tax rates or exemption eligibility fails production finance standards:
- Outdated or hallucinated taxability and legends: LLMs routinely confuse EU reverse-charge rules (Directive 2006/112/EC Art. 44 & Art. 196) with domestic B2C OSS rates, omit mandatory invoice reverse-charge legends, or miscompute Quebec’s
14.975%combined GST+QST. - No mathematical Tax ID check-digit verification: Prompting a model whether a customer registration string is valid misses deterministic checksum algorithms like Australian 11-digit ABN mod-89, UK VAT mod-97, Canadian Business Number Luhn checks, and Japanese T-number mod-9 validation.
- Missing cryptographic evidence and unapproved filings: Tax authorities require point-in-time proof of why an invoice was zero-rated, plus human Tax Lead sign-off before locking return figures—neither of which exists in a stateless chat response.
The Deterministic Architecture That Fixes It
The Global Sales Tax / VAT / GST Compliance Engine implements statutory tax determination, checksum verification, certificate tracking, and period sign-off as deterministic SQLite-backed services with zero external AI dependency required (AI_MODE=offline by default).
- 46-jurisdiction taxability and nexus rule engine:
POST /api/tax/calculateevaluates destination sourcing, B2B/B2C status, and product classification across 16 US states, 14 EU member states/OSS, the UK (GB), 9 Canadian federal/provincial regimes (including13%Ontario HST and14.975%Quebec GST+QST), and 6 APAC/non-EU markets (AU,SG,JP,CH,NO,NZ), applying 0-decimalJPYvs 2-decimal currency rounding, emitting mandatory statutory invoice legends, and flaggingApproaching (≥80%)orExceedednexus thresholds. - Check-digit Tax ID validation with SHA-256 evidence:
POST /api/tax/validate-idruns deterministic modulus/checksum validation across EU VAT, UK mod-97, AU 11-digit ABN mod-89, Canadian BN Luhn, Japanese T-number mod-9, Swiss UID mod-11, Norwegian MVA mod-11, New Zealand IRD mod-11, and Singapore UEN formats, persisting an immutable validation snapshot keyed by payload SHA-256 hash (GET /api/tax/evidence/{evidence_id}). - Exemption certificate vault with 1-hour PDF auto-wipe:
POST /api/certificates/uploadtracksexpired,expiring_soon(<30 days),audit_hold, andvalidresale and zero-rating certificates alongside live uncollected tax exposure, purging raw uploaded PDFs afterDOC_TTL_SECONDS=3600while preserving audit metadata. - Mandatory Human Tax-Lead return gate and scoped access: Access enforces SHA-256 hashed invite tokens with per-token sliding-window rate limits (
429) and scope isolation.POST /api/returns/approvelocks Output Tax, Input Tax Credits (ITC), and Net Remittance Due viaGET /api/returns/exportonly after explicit reviewer name, role, three pre-filing attestations, and rationale (minimum 10 characters), returning HTTP409on duplicate approvals unless explicitly amended—supporting internal tax review rather than replacing licensed CPA counsel.
Operational Takeaway
Indirect tax automation requires deterministic rule tables, mathematical ID checksums, and point-in-time audit snapshots. By keeping rate logic, nexus thresholds, certificate exposure, and return sign-offs auditable and gated behind Tax Lead approval, multi-entity finance teams eliminate silent exposure before filing deadlines arrive.