Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
••••••••
Sicherheitslücken (CVE)CVE-2025-65823 | Meatmeet App on Android hard-coded credentials(29.09.2026 um 03:42 Uhr)
••••••••••
Sicherheitslücken (CVE)CVE-2025-65823 | Meatmeet App on Android hard-coded credentials(29.09.2026 um 03:42 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

How to generate PDF invoices from JSON with a free API

Generating a clean, professional PDF invoice in code is one of those tasks that looks trivial until you start. You reach for a PDF library, then fight with layout, fonts, multi-currency formatting, VAT/tax math, and right-to-left…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Generating a clean, professional PDF invoice in code is one of those tasks that looks trivial until you start. You reach for a PDF library, then fight with layout, fonts, multi-currency formatting, VAT/tax math, and right-to-left languages. An hour later you have a brittle template and you still have to maintain it.



This post shows a shortcut: turn one JSON payload into a finished invoice — PDF, JSON totals, or UBL XML — with a single HTTP POST, using the free Invovate API. No PDF library, no template engine.






Try it with zero setup (no API key)



Anonymous calls can compute invoice totals — handy for validating tax/discount math before you render anything:




curl -X POST https://invovate.com/api/generate-invoice \
-H "Content-Type: application/json" \
-d '{
"output": "json",
"from": { "name": "Acme Inc" },
"to": { "name": "Globex LLC" },
"items": [
{ "description": "Consulting", "quantity": 10, "unit_price": 150, "tax_rate": 20 }
]
}'







You get back subtotal, total_tax, and grand_total as JSON. No account needed.





Rendering an actual PDF (or UBL, or a shareable hosted link) needs a free API key:




  1. Create a free account at invovate.com, verify your email.

  2. Copy your key from the dashboard — it starts with inv_.

  3. Pass it as a bearer token: Authorization: Bearer inv_yourkey.



The free tier is 40 requests/hour, 400/week — plenty to build and run low volume.






Render a PDF (cURL)






curl -X POST https://invovate.com/api/generate-invoice \
-H "Authorization: Bearer inv_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"output": "pdf",
"template": "navy",
"invoice": { "number": "INV-2026-001", "currency": "EUR", "language": "fr" },
"from": { "name": "Acme Inc" },
"to": { "name": "Globex LLC", "address": "1 Rue de Rivoli, Paris" },
"items": [
{ "description": "Consulting", "quantity": 10, "unit_price": 150, "tax_rate": 20 }
]
}'
--output invoice.pdf






That's a French-language, EUR, VAT-20% invoice on the navy template — written to invoice.pdf.






Node.js






import { writeFileSync } from "node:fs";

const res = await fetch("https://invovate.com/api/generate-invoice", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.INVOVATE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
output: "pdf",
invoice: { number: "INV-2026-001", currency: "USD", language: "en" },
from: { name: "Acme Inc" },
to: { name: "Globex LLC" },
items: [{ description: "Website design", quantity: 1, unit_price: 1500, tax_rate: 10 }],
}),
});

writeFileSync("invoice.pdf", Buffer.from(await res.arrayBuffer()));






Prefer a wrapper? There's an SDK: npm i invovate.






Python






import requests

resp = requests.post(
"https://invovate.com/api/generate-invoice",
headers={
"Authorization": f"Bearer {INVOVATE_API_KEY}",
# Set a User-Agent — the CDN in front of the API rejects the default
# python-urllib / bare client UA.
"User-Agent": "my-app/1.0",
},
json={
"output": "pdf",
"invoice": {"number": "INV-2026-001", "currency": "USD"},
"from": {"name": "Acme Inc"},
"to": {"name": "Globex LLC"},
"items": [{"description": "Website design", "quantity": 1, "unit_price": 1500, "tax_rate": 10}],
},
)
open("invoice.pdf", "wb").write(resp.content)






There's a Python SDK too: pip install invovate.






Languages, currencies, and tax



Set invoice.language (11 supported, including ar, ja, hi, ru with proper fonts and RTL) and invoice.currency (20+, with correct symbol/decimal handling). Per-line tax_rate and discount are supported, plus invoice-level global_tax, global_discount, and amount_paid for partial payments. The math comes back identical whether you request json or pdf.





Add features to get a hosted, shareable invoice URL (and optionally a scan-to-view QR):




{
"output": "json",
"features": { "hosted_link": true, "qr": true },
"invoice": { "currency": "USD" },
"from": { "name": "Acme Inc" },
"to": { "name": "Globex LLC" },
"items": [{ "description": "Retainer", "quantity": 1, "unit_price": 800 }]
}






The response includes a hosted_url you can email to a client — no login on their end.






UBL for e-invoicing



Need a machine-readable invoice? Request "output": "ubl" to get a UBL 2.1 XML document instead of a PDF — useful as a starting point for structured invoice exchange. (Note: Invovate produces the document; it does not submit to national e-invoicing networks.)






For AI agents



If you're building with LLMs, there's an MCP server (npx invovate-mcp) that exposes invoice generation as tools to Claude Desktop, Cursor, and Windsurf — so an assistant can create a real invoice from a natural-language request.






Wrap-up



One POST → a finished invoice. No PDF library to babysit, no template to maintain, and i18n + tax handled for you. The free tier (40 req/hr) is enough to ship a side project or a low-volume integration; paid plans start at $9/mo when you need more.





Disclosure: I work on Invovate. Feedback welcome — happy to answer API questions in the comments.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to generate PDF invoices from JSON with a free API

Thematisch verwandte Begriffe: generate, invoices, from, JSON · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102265 | PyJWT is a Python implementation of JSON Web Token standards. From 2.13…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag