Inspiration

Over 80 countries are rolling out mandatory e-invoicing—the EU's ViDA reform, Malaysia's MyInvois, Saudi Arabia's ZATCA Phase 2, Germany's 2027-2028 B2B mandate, and France's 2026-2027 rollout. Non-compliant invoices get rejected by government platforms, payments stall, and fines follow. Yet the teams issuing invoices live in Slack, while compliance knowledge lives in scattered PDFs, consultant emails, and government portals. We asked, "What if compliance checking happened right where work happens—in Slack, in seconds, before an invoice ever gets sent?"

What it does

e-Invoice Compliance Copilot is a Slack agent plus a web dashboard:

  • **Instant invoice validation in Slack—mention the bot with invoice text (or share an invoice file), and AI extracts the structured data. Then a deterministic rules engine checks it against the target country's e-invoicing requirements: mandatory fields, tax ID formats (VAT/TIN/GSTIN), VAT rate sanity, totals consistency, and required formats (XRechnung/ZUGFeRD, Factur-X, UBL/Peppol BIS, FatturaPA, and more). You get a compliance scorecard with severity-ranked issues and fix suggestions.
  • AI compliance Q&A — ask the bot things like "What does Germany require for B2B invoices in 2027?" or "When is Malaysia's MyInvois mandatory for SMEs?" and get grounded answers built on a curated country-mandate knowledge base.
  • Country mandate tracking — a watchlist of jurisdictions with mandate status (mandatory, phased rollout, upcoming) and deadline visibility.
  • Audit trail — every validation and Q&A interaction is logged to Postgres with who, what, when, and the full issue list, giving finance teams audit-ready evidence.
  • Web dashboard — validation history with expandable issue details, per-country compliance status, aggregate stats (pass rate, average score), an interactive validation playground, and the audit log. ## How we built it

Slack agent: Slack Events API with an HMAC signature-verified endpoint (Next.js route handler). The bot handles `app_mention mentions, DMs, and shared files and replies with rich Block Kit scorecards. AI layer: Vercel AI SDK via the Vercel AI Gateway—structured output extraction turns messy invoice text/PDFs into a typed invoice object; a second AI pass powers compliance Q&A grounded in our country's rules knowledge base. Validation engine: a deterministic TypeScript rules engine encoding requirements for Germany, France, Italy, Malaysia, Saudi Arabia, India, and more—field checks, regex tax-ID validation per country, VAT rate verification, and totals arithmetic. AI extracts; deterministic code judges. That separation keeps results explainable and auditable. Persistence: Neon serverless Postgres storing validations, audit events, Q&A interactions, and country watchlists. Dashboard: Next.js 16 + React, shadcn/ui, Tailwind CSS v4, dark enterprise theme, deployed on Vercel.

Challenges we ran into

Slack's 3-second event acknowledgment deadline vs. multi-second AI extraction—we acknowledge immediately and process asynchronously, posting results back via chat.postMessage " Making AI output trustworthy for a compliance use case—we constrained the AI to structured extraction only and moved all pass/fail judgments into deterministic, testable rules. Encoding genuinely different regimes (clearance models like Italy/Saudi vs. post-audit models, phased rollouts with thresholds) into one coherent rule schema.

Accomplishments that we're proud of

A complete round trip—paste an invoice in Slack, get a scored compliance report with actionable fixes in seconds—verified live end-to-end. An audit trail that would actually satisfy an auditor, not just a demo table. Nine-plus country rule sets with real mandate dates and format requirements.

What we learned

Slack is a genuinely great surface for compliance tooling: zero new UI to learn, and the audit trail builds itself from conversations. And hybrid AI architecture (AI for unstructured extraction, deterministic code for judgment) is the right pattern for regulated domains.

What's next for e-Invoice Compliance Copilot

Native XML validation (UBL, XRechnung, FatturaPA schema checks) Proactive deadline alerts pushed to Slack channels as mandates approach MCP connections to government platforms (MyInvois, ZATCA sandbox) for real clearance-status checks Slack Marketplace listing

Built With

  • drizzle
  • neon-postgres
  • next.js
  • shadcn/ui
  • slack-block-kit
  • slack-events-api
  • tailwindcss
  • typescript
  • vercel
  • vercel-ai-gateway
  • vercel-ai-sdk
Share this project:

Updates