Add PDF invoices to your app in 5 minutes
Most teams burn days wiring up headless Chrome, fighting CSS print quirks, and babysitting render servers — to produce a document whose layout never changes. An invoice API turns that into one HTTP call.
The anatomy of the call
Send your business, your customer, and the line items. Slipstack computes subtotals, discounts, and tax, lays everything out, and returns the finished PDF — synchronously.
// npm i — nothing. It's just fetch.
const res = await fetch("https://slipstack.dev/api/v1/pdf", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SLIPSTACK_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
template: "invoice",
data: {
from: { name: "Acme Inc", email: "billing@acme.com" },
to: { name: customer.name, email: customer.email },
number: `INV-${order.id}`,
dueDate: dueDate.toISOString().slice(0, 10),
items: order.lines.map(l => ({
description: l.name, quantity: l.qty, unitPrice: l.price,
})),
taxRate: 8.5,
},
}),
});
const pdfBuffer = Buffer.from(await res.arrayBuffer());
// email it, store it, or stream it to the browserPython
import os, requests
res = requests.post(
"https://slipstack.dev/api/v1/pdf",
headers={"Authorization": f"Bearer {os.environ['SLIPSTACK_KEY']}"},
json={
"template": "invoice",
"data": {
"from": {"name": "Acme Inc"},
"to": {"name": customer.name},
"number": f"INV-{order.id}",
"items": [
{"description": l.name, "quantity": l.qty, "unitPrice": l.price}
for l in order.lines
],
"taxRate": 8.5,
},
},
)
with open("invoice.pdf", "wb") as f:
f.write(res.content)Common patterns
- Email on payment: generate the PDF in your payment webhook and attach it to the receipt email.
- Customer portal: render on demand — no need to store PDFs; regenerate from order data anytime.
- Branding: pass
logoUrlandaccentColorper tenant for white-label invoices.
Try it free — 50 invoices a month
No card required. The curl example on the homepage works in 30 seconds.
Get an API key