Skip to content

Generate beautiful, business-grade PDF invoices in seconds. Add your logo, customer info, line items, discounts, taxes, and more — all through a simple API.

Notifications You must be signed in to change notification settings

Talabov/Invoice-Generator-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

📄 Invoice Generator API


A production-ready, beautiful REST API for generating business-grade PDF invoices — with logo, seller & customer details, discounts, flexible currencies, and more.

Includes: Dockerfile, full project structure, HTML frontend, setup guides, and real Postman-ready endpoints.

👉 Buy it on Gumroad


A modern Flask REST API that turns your input into ready-to-send PDF invoices. Suitable for freelancers, startups, agencies, and internal tools.


✅ Key Features

  • 🖼 Supports logo (URL or local file)
  • 🏢 Seller/company & customer blocks (name, address, phone, email, bank info, INN, BIK, website)
  • 💸 Unlimited line items (products/services)
  • 🔢 Automatic invoice numbering (INV-00001...)
  • 🎨 Custom currency, notes, payment terms, due date
  • 📉 Discounts & tax calculation
  • 🌐 Unicode/UTF-8 support (cyrillic, euro, etc — via Arial.ttf)
  • 📄 Clean, minimal PDF layout
  • 🖥 Built-in HTML frontend (in /static) for non-coders
  • ⚡ Modular, Postman-tested API endpoints
  • 🐳 Docker-ready

🚀 Endpoints

Generate Invoice PDF

POST /generate-invoice

Request Example:

{
  "customer_name": "Ivan Ivanov",
  "email": "ivan@mail.com",
  "items": [
    {"name": "Logo Design", "quantity": 1, "price": 120.5},
    {"name": "Consulting", "quantity": 2, "price": 60}
  ],
  "currency": "USD",
  "notes": "Thank you for your business!",
  "logo_url": "logo.png",
  "seller_name": "Talabov Ltd.",
  "seller_address": "Moscow, Main St, 1",
  "seller_phone": "+7-999-123-45-67",
  "seller_email": "info@company.com",
  "seller_website": "company.com",
  "seller_inn": "1234567890",
  "seller_bank": "TalabovBank",
  "seller_bik": "044525225",
  "payment_terms": "Net 5 days",
  "due_date": "2025-06-05",
  "discount": 15.5
}

Response:

{
  "message": "Invoice generated",
  "download_link": "/invoices/<uuid>.pdf"
}

⛔ Error Handling

{"error": "customer_name and items are required"}
{"error": "Each item must contain name, quantity, and price"}

⚙️ Requirements

pip install -r requirements.txt
  • Flask
  • reportlab
  • requests
  • python-dotenv

🖥 How to Run

python app.py

Or use Docker:

docker build -t invoice-api .
docker run -p 5000:5000 invoice-api

🧑‍💻 Frontend Demo

Open http://localhost:5000/ for a ready-to-use web UI.

  • Add all details, upload logo or use URL, hit “Generate Invoice PDF”.
  • Works on desktop & mobile.

🧪 Example Screenshots

  • ✅ POST to /generate-invoice
  • ✅ Download PDF
  • ⚠️ Error messages
  • 🖥 HTML UI demo

See /screens/ for screenshots and PDF samples.


💼 Ready-to-Use Version

Get the ZIP with full project, Docker, frontend, and tech support:

👉 Buy it on Gumroad


📬 Contacts


Need this in another language/stack (Node.js, Go, etc)? Custom dev available — just reach out.

About

Generate beautiful, business-grade PDF invoices in seconds. Add your logo, customer info, line items, discounts, taxes, and more — all through a simple API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published