EN
Sign up

Home › Solutions › Invoice PDFs from JSON

Solution

Generate invoice PDFs from JSON

POST your invoice data as JSON and get back a finished PDF on your own template. No HTML to wrangle and no headless browser to run — just a REST API call.

# 1. Request the invoice — POST your data as JSON
curl -X POST https://app.shippdf.com/api/v1/documents \
  -H "Authorization: Bearer $SHIPPDF_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "tpl_8f...",
    "data": {
      "number": "INV-1042",
      "customer": "Acme Co.",
      "items": [
        { "desc": "Design work", "qty": 12, "rate": 90 },
        { "desc": "Hosting",     "qty": 1,  "rate": 40 }
      ]
    }
  }'
# → 202 { "id": "doc_a3...", "status": "queued" }

# 2. Fetch the finished PDF once it is ready
curl https://app.shippdf.com/api/v1/documents/doc_a3... \
  -H "Authorization: Bearer $SHIPPDF_TOKEN"
# → { "status": "completed", "pdf_url": "…/inv-1042.pdf" }

Why generate invoices this way

No code? No problem

Prefer not to touch the API? Add a render step in Zapier, Make, n8n, Airtable or Google Sheets and map your fields to the invoice template. Every route reaches the same templates.

Questions

How do I generate an invoice PDF from JSON?

Send your invoice data as JSON to ShipPDF, naming the invoice template you designed. You get back a finished PDF — as a hosted link, an emailed attachment, or written straight back to a record. Line-item tables handle their own page breaks and running totals.

Can I generate invoices without writing code?

Yes. Add a ShipPDF render step in Zapier, Make, n8n, Airtable or Google Sheets and map your fields to the template. Developers can call the REST API directly instead.

Sign up
← Back to home