Inkspan › Invoice PDF API
Generating invoices is the most common reason teams add a PDF API. Instead of maintaining a headless browser and an invoice template engine, you send your line-item data as JSON and get a branded PDF back.
import requests
r = requests.post('https://api.inkspan.dev/v1/generate/template',
headers={'X-API-Key': 'ink_live_...'},
json={"template":"<h1>Invoice {{number}}</h1>{% for i in items %}<p>{{i.desc}}: ${{i.amt}}</p>{% endfor %}<h3>Total: ${{total}}</h3>","data":{"number":"INV-1042","items":[{"desc":"Plan","amt":49}],"total":49}})
open('out.pdf','wb').write(r.content)