JSON to PDF API

JSON to PDF API for structured data and reusable templates

Send JSON, choose a template, and let PDFox handle layout, tables, formatting, and delivery. No HTML string-building required.

Nested JSON payloadsHandlebars templatesSchema-aware fieldsAsync job API

Why this page exists

Most teams already have JSON. They do not want to generate HTML on the fly.

If your backend already produces structured JSON, a JSON to PDF API should let you keep that payload as the source of truth. You should not need to build HTML inside your application every time a document is requested.

PDFox turns structured JSON into PDFs through reusable templates. Arrays, nested objects, conditionals, totals, and formatted values are handled in the template layer so your application can stay focused on data, not document layout.

What PDFox gives you

What a JSON to PDF API should do well

The point is not only to accept JSON. It is to turn that JSON into repeatable, maintainable documents.

Nested objects and arrays

Render invoices, statements, letters, and reports from nested JSON structures with loops and conditional sections inside the template.

Template schema and sample JSON

Published templates expose schema and sample payloads so engineers know what fields to send before generation starts.

Layout stays outside app code

Move pagination, tables, headers, assets, and styling out of your business logic and into a template workflow the team can manage.

Delivery-ready job output

Queue the job, retrieve its status, and fetch a signed download URL when the rendered PDF is complete.

REST API example

curl -X POST https://api.pdf-fox.com/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "tpl_account_statement",
    "data": {
      "customer": {
        "name": "Northline Health",
        "account_id": "AC-4421"
      },
      "statement": {
        "period": "May 2026",
        "opening_balance": 1420.00,
        "closing_balance": 980.00
      },
      "entries": [
        { "date": "2026-05-01", "description": "Subscription", "amount": 320.00 },
        { "date": "2026-05-14", "description": "Credit note", "amount": -120.00 }
      ]
    }
  }'

The template handles loops, conditional sections, totals, and formatting helpers. Your application only sends structured JSON.

How teams use it

Choose PDFox when JSON is already the stable part of your system

PDFox is especially useful when the data model is reliable but the document layout changes often.

Your app already emits clean JSON

If the core payload already exists in your backend, PDFox lets you keep that payload and move rendering concerns into the template layer.

Different documents reuse the same data model

One customer payload can power invoices, statements, renewal letters, or confirmations through different templates.

You want less document code in the product

JSON to PDF works best when engineering wants to remove HTML builders, print styles, and fragile document assembly logic from the app codebase.

Frequently asked questions

Keep your data in JSON. Let PDFox handle the PDF.

If the payload is already structured, do not rebuild the document layer inside your application.