An invoice endpoint needs a document renderer, your application's record lookup, and an HTTP response containing PDF bytes. Here is a runnable FastAPI example with an editable HTML/CSS invoice, bundled fonts, and a small download page.
Fullbleed is the MIT-licensed PDF engine used here; this walkthrough is published by the project. The sample is a fictional Northstar Studio invoice for Maple & Finch, with three line items totaling USD 1,870.00.
Open the sample PDF
Download the starter and open its fullbleed-python-invoice directory. Use Python 3.10–3.14 and create a virtual environment:
python -m venv .venv
Enter fullscreen mode
Exit fullscreen mode
Activate it with source .venv/bin/activate on macOS/Linux, or .venv\Scripts\Activate.ps1 in Windows PowerShell.…