Invoi
Local Docker stack for creating invoices and parsing incoming bills. FastAPI is the only writer; Postgres is the ledger, n8n just calls the API.
Overview
Invoi creates numbered invoices (INV-YYYY-####) with GST math and PDF
downloads, and parses uploaded bills into structured data with a confidence score.
Everything runs locally with Docker: API on :8000, n8n on
:5678.
Key features
- Numbered invoices
INV-YYYY-####sequencing with duplicate → 409 protection. - GST + PDFsTax math, totals and PDF downloads behind auth.
- Bill parsingMultipart upload returns vendor, id, amount and 0–1 confidence. Writes nothing.
- n8n workflowWebhook → Parse → Confidence ≥ 0.5 → Create → Receipt, else Needs review.
- Header authAll invoice routes need
X-API-Key; health stays open. - Runs locally
.envstays out of git;.env.exampleis the template.
API reference
| Action | Route |
|---|---|
| Health | GET /health (no key) |
| Create | POST /api/v1/invoices (vendor_name, amount, optional tax_rate) |
| Parse | POST /api/v1/invoices/parse (multipart field file) |
| Read | GET /api/v1/invoices/{invoice_no} |
GET /api/v1/invoices/{invoice_no}/pdf (header download) |
docker compose -f compose.yml up -d --build
# API docs: http://localhost:8000/docs
# n8n: http://localhost:5678
Stack
FastAPI
PostgreSQL
n8n
Docker
PDF