Use case
Generate Invoice PDFs From JSON — No Templates, No Design Work
If you're building billing into a SaaS product, a marketplace, or an internal tool, you eventually hit the same wall: you need to turn structured invoice data into a PDF someone can download, email, or store — and every option in front of you is either a fragile HTML-to-PDF hack running in your own serverless function, or a bloated invoicing platform you don't actually want to integrate.
The PDF Generation API does one thing: you send it JSON, it sends back a print-ready PDF. No markup to write, no templates to host, no headless browser to babysit in production.
Example request
curl -X POST "https://pdfapi-nu.vercel.app/api/v1/generate" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "invoice",
"data": {
"companyName": "Acme Co.",
"fromAddress": "100 Market St",
"toAddress": "Jane Buyer",
"lineItems": [
{"description": "Services", "quantity": 1, "unitPrice": 500}
],
"taxRate": 0.08
}
}' \
-o invoice.pdfWhy teams use this instead of building it themselves
You already have the data
Your billing system, your database, your Stripe webhook — you have company names, line items, addresses, and totals sitting in JSON somewhere. This API takes that JSON directly. No mapping it into HTML first.
Typed schemas, validated once
The invoice template has a defined JSON schema — company name, from/to addresses, line items (description, quantity, unit price), and tax rate. Validate against it once in your code, and every generation call is predictable.
No headless browser to maintain
Running Puppeteer or a similar renderer yourself in a serverless environment means fighting cold starts, binary size limits, and Chromium version drift. That infrastructure problem is already solved here.
Built for automated and agentic workflows
The API ships with an OpenAPI specification, so it's discoverable by tools and AI agents — useful if part of your invoicing flow is triggered by an agent rather than a human clicking a button.
Typical integration points
- Stripe/billing webhook fires → build the JSON payload from the invoice object → call the API → attach the returned PDF to a confirmation email
- Admin dashboard "Download Invoice" button → server route calls the API → streams the PDF back to the browser
- Nightly batch job generates invoices for the billing period → stores PDFs in object storage
Pricing
Free tier: 200 calls/month, no credit card required — enough to fully build and test your integration. Paid tiers start at $29/month for production volume.
View pricingFrequently asked questions
Do I need to design an invoice template myself?
No — the invoice template is pre-built. You send your data against the documented schema and get a styled PDF back.
Can I use this in a serverless environment like Vercel or AWS Lambda?
Yes — that's exactly the environment it's built for. You're calling a REST API, so there's no browser binary or rendering dependency to bundle into your own function.
What data does the invoice template expect?
Company name, from/to addresses, line items (description, quantity, unit price), and a tax rate.
Is there a free way to test this before committing?
Yes, the free tier includes 200 API calls per month with no credit card required.