Invoice generator API: JSON in, PDF invoice out

Docmill is an invoice generator API for automations. One HTTP request turns your invoice data into a finished PDF — or an editable DOCX or XLSX — using the built-in starter:invoice template or one the AI drafts from a plain-language description. No template editor to learn, no credit math.

Free tier: 50 documents/month, no credit card. Self-serve signup, Stripe billing, cancel anytime.

Worked example

A complete invoice in one curl

This is the whole integration. starter:invoice ships with every account — line items, computed line totals, subtotal, tax, total due, and payment terms. Send your data, get back %PDF bytes.

# render a PDF invoice from JSON — sync, binary response
curl https://api.docmill.io/v1/documents \
  -H "Authorization: Bearer dk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "starter:invoice",
    "output": "pdf",
    "data": {
      "invoiceNumber": "INV-2026-0142",
      "issueDate": "2026-08-28",
      "dueDate":   "2026-09-27",
      "currency":  "USD",
      "company": { "name": "Acme Studio LLC",
                   "address": "100 Market St, Springfield",
                   "email": "billing@acme.studio" },
      "client":  { "name": "Northwind Traders",
                   "address": "1 Harbor Way, Portsmouth" },
      "items": [
        { "description": "Design sprint (2 weeks)", "quantity": 1,  "unitPrice": 4800 },
        { "description": "Implementation, hourly",  "quantity": 32, "unitPrice": 120  },
        { "description": "Hosting (annual)",        "quantity": 1,  "unitPrice": 360  }
      ],
      "subtotal": 9000,
      "taxRate":  8,
      "taxAmount": 720,
      "total":    9720,
      "notes": "Bank transfer to the account listed in the contract."
    }
  }' --output invoice.pdf
# → invoice.pdf, ready to email or attach

Need it editable?

Change "output": "pdf" to "docx" or "xlsx". Docmill renders real Office files from templates with {{markers}} — not a PDF pretending to be one.

Need base64 or bulk?

Get the file inline as base64 instead of binary, or add ?async=1 for a job API: it returns a job_id, you poll GET /v1/jobs/:id. Built for batch invoice runs.

Need your own layout?

Describe it: POST /v1/templates/generate with a prompt like “an invoice with EU VAT number and 30-day terms” returns a production template — or paste an old invoice and Docmill converts it.

No-code & agent paths

Generate invoices from n8n, Zapier, Make, or an AI agent

You don't have to write the curl yourself. The connectors are free on every plan — your plan meters documents, nothing else.

n8n — community node n8n-nodes-docmill Zapier — Generate Document action Make — app with binary file output MCP@docmill/mcp-server for Claude & AI agents REST — sync, base64, or async jobs

FAQ

Invoice generator API questions

Is there a free invoice generator API?

Yes. Docmill's Free plan is $0 and includes 50 documents per month with a small watermark — enough to wire up an automation and run it in production before paying anything. No credit card required to start.

Can I get DOCX instead of PDF?

Yes — set "output": "docx" (or "xlsx" for spreadsheets). Unlike PDF-only services, Docmill generates genuinely editable Office files from DOCX/XLSX templates with {{markers}}, so your client can open the invoice in Word and your accountant can open the ledger in Excel.

How do I generate invoices from n8n?

Install the community node n8n-nodes-docmill, add the Docmill node to your workflow, paste your API key, pick starter:invoice (or your own template), and map fields from previous nodes into the invoice data. The node outputs the file as binary data ready for an email or storage node.

How is Docmill priced?

Strictly per document: one generated file costs one document, whatever the format or page count within reason. No credit blocks, no per-feature multipliers. Free $0 (50 docs/mo), Starter $19/mo (1,000), Growth $49/mo (5,000), Scale $99/mo (15,000) — Stripe billing, cancel anytime from the customer portal.

Can the AI design my invoice template?

Yes. Describe the invoice in plain language and Docmill's AI generator returns a production template plus sample data showing exactly which fields to send. Every template is plain HTML/Handlebars underneath — inspect it, tweak it, own it.

Pricing

One document costs one document

Count your invoices, pick a tier. Full details on the pricing section of the homepage.

Free

$0/mo
  • 50 documents/month
  • All formats + starters
  • Small watermark
Get a key

Starter

$19/mo
  • 1,000 documents/month
  • No watermark
  • AI template generation
Choose Starter

Scale

$99/mo
  • 15,000 documents/month
  • Everything in Growth
  • Volume tiers above on request
Choose Scale

Comparing tools? See how Docmill stacks up against APITemplate.io, CraftMyPDF, and PDFMonkey.

Ship the invoice step today

Read the docs, grab a free key, and your automation is emailing PDF invoices before lunch.