Guide · document automation

How to turn an existing invoice PDF into an API

The useful part of an invoice is not the PDF file. It is the stable layout behind it: the company details stay put while the customer, line items, dates, and totals change.

Separate the plate from the data

Keep the layout as one template and send the changing values as JSON. That avoids rebuilding HTML for every invoice and gives every customer the same visual result.

{
  "customer": { "name": "Northwind Studio" },
  "invoice_number": "INV-1042",
  "items": [{ "description": "Design services", "amount": 2160 }],
  "total": 2592
}

Start from the document people already trust

A blank editor is flexible, but it asks you to recreate decisions that have already been made: hierarchy, line-item layout, terms, and the tone of the document. An import should produce a draft, never an unreviewed live document.

Review before your application calls it

Render the generated template with fictional sample data. Check every field, correct anything that does not belong, then publish it. Once published, your application sends JSON to the same template on every invoice.

See the generate API reference →

Import a PDF free