Why another invoicing tool?
Every freelancer and SaaS founder needs invoices. Yet most solutions are either bloated SaaS subscriptions or clunky Excel templates.
Invoice API is different – it's a lightweight, self-hosted REST API that generates professional PDF invoices in under 5 seconds. Built with FastAPI, WeasyPrint, and Stripe, it gives you full control without vendor lock-in.
What can it do?
- Create customers & invoices via a clean REST API
- Generate PDF invoices with a single GET request (WeasyPrint, ~30KB per PDF)
- Receive Stripe webhooks for real-time payment status updates
- Dashboard to see all invoices at a glance
-
Docker-Compose one-liner –
docker compose up -dand you're live
Tech stack
| Layer | Technology |
|---|---|
| API | FastAPI + Pydantic v2 |
| Database | PostgreSQL 16 |
| Cache | Redis 7 |
| PDF Engine | WeasyPrint 62 |
| Payments | Stripe API (webhook) |
| Container | Docker + Docker Compose |
| Auth | Bearer JWT tokens |
Quick start
# Clone & start
git clone https://github.com/UniTy/invoice-api.git
cd invoice-api
docker compose up -d
# Create a customer
curl -X POST http://localhost:8000/api/v1/customers \
-H "Content-Type: application/json" \
-d '{"name":"Acme Corp","email":"billing@acme.com"}'
# Create an invoice
curl -X POST http://localhost:8000/api/v1/invoices \
-H "Content-Type: application/json" \
-d '{"customer_id":1,"items":[{"desc":"Consulting","qty":10,"price":150}],"currency":"eur"}'
# Download PDF
curl http://localhost:8000/api/v1/invoices/1/pdf -o invoice-001.pdf
Why self-host?
- GDPR compliance – your data stays on your server
- No monthly fees – pay only for your VPS (as low as €5/month)
- Customizable – MIT license, fork it, brand it, extend it
- API-first – integrate with your existing workflow (n8n, Zapier, custom apps)
Roadmap
- [x] Core API (customers, invoices, PDF generation)
- [x] Stripe webhook integration
- [x] Docker deployment
- [x] OpenAPI auto-documentation
- [ ] Multi-currency support
- [ ] Email delivery (SendGrid/Mailgun)
- [ ] Recurring invoices
- [ ] React admin dashboard
Try it now
git clone https://github.com/UniTy/invoice-api.git
⭐ Star the repo if you find it useful! Feedback and PRs welcome. 🙏
#invoicing #api #fastapi #python #stripe #opensource #docker
Top comments (0)