Quickstart

Generate your first PDF in under five minutes.

1. Create a template

In the dashboard, create a template from a starter (Invoice or Receipt) or describe one with AI. Open it and copy its template id from the URL.

2. Create an API key

Go to API Keysand create a key. Copy it immediately — it's shown only once and looks like pf_live_….

3. Generate a PDF

Send your data to the generate endpoint:

curl -X POST https://paperfox.dev/v1/generate \
  -H "Authorization: Bearer pf_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "YOUR_TEMPLATE_ID",
    "data": {
      "invoice_number": "INV-1042",
      "currency": "USD",
      "customer": { "name": "Acme Corp", "email": "ap@acme.com" },
      "items": [
        { "description": "Design retainer", "quantity": 1, "unit_price": 2400, "amount": 2400 }
      ],
      "subtotal": 2400, "tax_rate": 8, "tax": 192, "total": 2592
    }
  }' \
  --output invoice.pdf

Node.js

const res = await fetch("https://paperfox.dev/v1/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PAPERFOX_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ template_id: "YOUR_TEMPLATE_ID", data }),
});
const pdf = Buffer.from(await res.arrayBuffer());
// → write to disk, email it, or stream to your user

That's it. See Generate a PDF for all options and Template syntax for placeholders and helpers.