Doing taxes as a founder is a special kind of torture.
Every quarter, the same ritual unfolds: you log into seven different portals, download dozens of PDF invoices, hunt down obscure Stripe fee receipts, match them against three different bank accounts, and try to figure out whether a SaaS tool based in Utah qualifies for reverse-charge VAT or standard taxation.
I got sick of it. I wanted to do my taxes with one click.
Specifically, I wanted to handle my European VAT declarations (like the Elster system in Germany) without ever manually downloading a single invoice, dragging a PDF into a folder, or manually assigning tax categories.
So, I built an AI system to handle the entire pipeline end-to-end. Now, the system fetches every document, scans it, extracts the metadata, categorizes the tax class, reconciles it against my multi-bank cash flow, and spits out the exact numbers I need to plug into my VAT declaration.
Here is how I automated my tax preparation and VAT declarations with AI, and how the underlying architecture works.
The Nightmare: Why Traditional Tax Prep Breaks Down
If you run a digital business, your financial stack probably looks like mine:
- Multiple Banking Platforms: N26 for local operations, Wise for international transfers, Stripe for revenue.
- Scattered Invoices: Google Workspace receipts in your Gmail inbox, AWS invoices tucked behind a login wall, Vercel charges hit your credit card, Adobe sends a link to a portal.
- Cross-Border Tax Logic: European VAT is notorious. An invoice from a company in your own country has standard VAT (e.g., 19% in Germany). An invoice from an EU-based business requires EU Reverse Charge logic. An invoice from the US might be exempt, subject to import VAT, or treated as an offshore service purchase.
The traditional "solution" is to pay for software like Dext or Lexoffice, upload your PDFs manually, and spend hours fixing the auto-categorization errors. But that still leaves two major friction points: getting the invoices and determining the exact tax class.
I wanted to eliminate both.
+-----------------------------------------------------------------------+
| THE OLD WAY |
| Log into 7 portals -> Download PDFs -> Upload to accounting software |
| -> Manually fix tags -> Guess VAT rules -> Export CSV -> Type in Elster|
+-----------------------------------------------------------------------+
+-----------------------------------------------------------------------+
| THE AI WAY |
| Trigger Script -> Auto-Fetch -> Vision AI Extraction -> Tax Engine |
| -> Multi-Bank Reconciliation -> Final Elster/VAT Totals |
+-----------------------------------------------------------------------+
Step 1: Zero-Touch Invoice Retrieval (No Manual Downloads)
The first rule of my automated setup: I do not log into websites to download invoices.
If I have to open a browser, navigate to a dashboard, click "Billing," and select a month, the automation has failed.
I handle invoice collection through two automated pipelines:
1. Gmail API Ingestion
Most vendors send receipts via email or attach PDFs directly. I set up a script using the Gmail API that runs on a schedule. It searches for specific query patterns (has:attachment filename:pdf invoice, subject:"Your receipt from", etc.) for the target tax period.
The script automatically downloads the PDF attachments and saves them directly to an encrypted cloud storage bucket processed by the workflow.
2. Browser Automation for Portal Receipts
For platforms like Stripe, AWS, or Meta Ads that don't email full invoice PDFs, I use headless browser automation (Playwright/Puppeteer) tied to system API keys.
For Stripe specifically, I don't even use the browser—I hit the Stripe API directly to pull monthly fee summaries and balance statements as raw data.
Step 2: Intelligent Document Processing with Vision Models
Once the PDFs are sitting in the pipeline, the AI takes over.
Instead of relying on rigid OCR (Optical Character Recognition) templates that break whenever an invoice layout changes by two pixels, I feed the raw document pages into multimodal AI models.
What the AI Extracts
For every single invoice, the AI model parses the image and extracts structured JSON containing:
- Vendor Name: e.g., "OpenAI, LLC"
- Vendor Address & Country: e.g., "San Francisco, CA, USA"
- Vendor Tax ID / VAT Number: e.g., "EU372011234" or "US-EIN..."
- Invoice Date: Normalized to
YYYY-MM-DD - Invoice Amount & Currency: e.g.,
$20.00 USDor€119.00 EUR - Line Items: Brief description of services purchased.
Here is a simplified example of the structured JSON schema forced on the model output:
{
"vendor_name": "GitHub Inc.",
"vendor_country": "US",
"vat_id": "US990123456",
"invoice_date": "2024-03-01",
"total_amount": 21.00,
"currency": "USD",
"tax_amount_stated": 0.00,
"line_description": "Developer Cloud Services"
}
Because LLMs understand context, they aren't confused by weird layouts, multi-page PDFs, rotated scans, or foreign languages.
Step 3: Automated Tax Classification Engine
Extracting the data is only half the battle. The real headache is answering: Which tax class does this invoice belong to?
In European tax frameworks like Germany’s Elster, putting an invoice in the wrong category means your quarterly declaration is wrong, triggering audits or balance adjustments.
My system feeds the extracted JSON into a dedicated tax classification layer. The AI evaluates the vendor location, my business location, and the type of service against preset tax rules:
[ Extracted Invoice JSON ]
|
v
/---------------------------\
/ Is Vendor in Same Country? \
\-----------------------------/
/ \
YES NO
/ \
[ Standard Domestic VAT ] /--------------------\
(e.g., 19% Input Tax) / Is Vendor in EU? \
\--------------------/
/ \
YES NO
/ \
[ EU Reverse-Charge ] [ Non-EU Third Country ]
(Paragraph 13b UStG) (Offshore Service Import)
How the AI Handles Edge Cases
- Domestic Purchase (e.g., German vendor to German company): Categorized as standard deductible input tax (19% or 7% VAT). The system extracts the explicit VAT amount.
- EU Cross-Border Purchase (e.g., Irish vendor like Google Ireland to German company): Detected as B2B Reverse Charge. The tax code is set to EU Reverse-Charge, mapping directly to specific line items in the VAT declaration form (e.g., Kennziffer 46/67 in Elster).
- Third-Country Service (e.g., US SaaS vendor like Vercel to EU company): System flags this as a non-EU service import, applying reverse-charge rules for foreign services where applicable.
The AI explains its tax classification reasoning in a log, so I can review why a specific tag was assigned if anything looks unusual.
Step 4: Multi-Bank Reconciliation
An invoice is just a piece of paper until you prove you actually paid it. Tax authorities require reconciliation between your reported expenses and your bank statements.
This gets messy fast when you use multiple financial providers:
- N26: Primary operating account (EUR transfers)
- Wise: International multi-currency account (USD/GBP expenses)
- Stripe: Direct payouts, processing fees, and chargebacks
My script connects to these accounts via bank feeds and API integrations to pull raw transaction histories for the quarter.
Fuzzy Matching Logic
Invoices rarely match bank lines perfectly. An invoice from "Google Cloud" for $100.00 on March 1st might show up on a Wise statement on March 3rd as GOOGLE*CLOUD SERVICES SAN FRANCISCO CA for €92.45 after currency conversion.
The system runs a multi-factor matching algorithm:
- Amount & Currency Conversion: Converts transaction amounts based on historic exchange rates for the invoice date.
- Date Proximity: Looks for bank transactions within a 5-day window after the invoice date.
- Semantic String Matching: Uses embedding similarity to match the vendor name (
OpenAI LLC) with the bank text line (PAYMENT TO OPENAI TEMPE AZ).
If an invoice matches a bank transaction, it’s marked as Reconciled. If an invoice is missing a matching payment—or if a bank withdrawal has no corresponding invoice—the system flags it on a review dashboard.
Step 5: Generating the Elster Output
At the end of the pipeline, I don't want a massive folder of categorized files. I don't want a complex spreadsheet.
I want the exact numbers that need to be entered into the tax portal.
For my German VAT declaration (Umsatzsteuervoranmeldung), the system calculates and prints a clean summary like this:
=====================================================
QUARTERLY VAT DECLARATION SUMMARY (Q1)
=====================================================
[ Line 21 ] Taxable domestic sales (19%): € 14,250.00 -> Output VAT: € 2,707.50
[ Line 46 ] Other taxable services (EU): € 1,840.00 -> Reverse Charge
[ Line 66 ] Deductible input tax (19%): -> Input VAT: € 1,120.40
[ Line 67 ] Tax from EU reverse charge: -> Input VAT: € 349.60
***
FINAL PAYABLE / REFUND AMOUNT: € 1,237.50
=====================================================
Status: 100% Reconciled (42/42 transactions matched)
I open my browser, log into Elster, copy those four numbers into the corresponding fields, click submit, and close the tab.
The entire tax preparation process takes less than two minutes.
Key Takeaways for Building Your Own Pipeline
If you want to automate your own tax workflow using AI, keep these principles in mind:
- Don't use raw OCR; use Multimodal AI: Legacy OCR breaks on custom layouts. Vision-capable LLMs understand document context effortlessly.
- Enforce JSON Schemas: Force your AI models to output strict JSON using system parameters (like OpenAI's Structured Outputs or instructor libraries) so your code doesn't crash on invalid formatting.
- Audit Trails are Non-Negotiable: Always store the raw invoice PDF alongside the AI’s extracted metadata and bank transaction ID. If tax auditors ask questions three years from now, you need to show your work.
- Build a Flagging Mechanism: Design the system to fail safely. If the AI's confidence score on a tax classification is low, or if an invoice is off by more than a few cents during bank reconciliation, drop it into an "Attention Required" queue for manual review.
Want Access to This Tool?
I built this system to solve my own frustration with managing multi-currency accounts, SaaS subscriptions, and cross-border European VAT declarations. It has already saved me dozens of hours of manual work every quarter.
It worked so well for my own stack that I am currently refining the infrastructure to make it available to other founders, freelancers, and indie hackers who want to automate their tax prep.
If you are interested in getting early access or want to see how it works for your setup, reach out to me or drop your feedback below. I’d love to hear what your current tax workflow looks like and what pain points you'd like to automate.
