Document Generation API
Automate document generation from templates
A document generation API for SaaS products. Define a template once, then create dynamic PDF documents by sending JSON. Your application ships data, the API ships finished invoices, reports, contracts, and certificates.
Templates in, documents out
Store reusable HTML templates with placeholders, then generate a document by passing values. No string-building markup inside your app, no redeploys to change a layout.
// 1. Save a template once (HTML with {{placeholders}}).
// 2. Generate a document by sending data, not markup.
const res = await fetch("https://api.pdfpipe.xyz/v1/pdf", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PDFPIPE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
template_id: "tmpl_invoice",
data: { customer: "Acme Inc", total: "$420.00" },
}),
});Why teams automate documents this way
Dynamic, not static
Every document is generated from live data, so a thousand customers get a thousand correct documents.
Template based
Designers own the template, engineers own the data. Layout changes do not touch application code.
Scales with webhooks
Bulk-generate document sets and receive results asynchronously, so long runs never block a request.
Common document workflows
- Create documents from templates the moment an order or event fires.
- Automated invoice and receipt generation on payment webhooks.
- Scheduled report generation delivered to storage or email.
- Certificate generation issued on course or milestone completion.
Frequently asked
What is a document generation API?
It is an HTTP service that turns a template plus data into a finished document such as a PDF. You send JSON, it returns the rendered document, so document creation is automated end to end.
Can I do template based PDF generation?
Yes. Save an HTML template with placeholders, then generate a dynamic PDF by sending only the values. This is the standard create-documents-from-templates flow.
Is it good for SaaS document automation?
Yes. It is built for programmatic, per-customer generation: batch endpoints, webhooks, stored documents, and per-key templates make it a fit for automated document generation inside a product.
Which document types are supported?
Anything expressible in HTML and CSS: invoices, statements, reports, contracts, agreements, certificates, labels, and more.
Which PDF API do you need?
These pages cover related search intents. Pick the one that matches what you are building.
500 free documents a month, flat pricing after that, and a live playground you can try without signing up.