Invoice PDF API

Design the invoice once in HTML and CSS. Interpolate your data. Get a branded PDF back on every payment event.

HTML PDF PNG JPEG URL
No credit card required · 500 free renders/month

Why invoices are a good fit for HTML

An invoice is a table, a total, and a logo. That is exactly what HTML and CSS are good at, and it means your designers can iterate on the layout without a developer rebuilding a coordinate-based PDF template every time the branding changes.

  • Line items that reflow naturally across pages, with the header repeated on each
  • Tax and discount rows that appear only when they apply, using ordinary template conditionals
  • Locale-aware currency and date formatting handled in your app, not the PDF layer
  • Right-to-left layouts and non-Latin scripts via normal CSS and web fonts

Surviving end of month

Billing traffic is not smooth. It is flat for twenty-nine days and then everything happens at once. Requests are queued rather than dropped when volume spikes, transient failures are retried automatically, and workers scale with the queue depth — so the first invoice of the run and the ten-thousandth take the same time.

billing-worker.mjs
import fs from "node:fs";

const res = await fetch("https://api.filecook.com/render/pdf", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.FILECOOK_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    html: "<h1>Invoice #1042</h1>",
    options: { format: "A4", margin: "12mm" }
  })
});

if (!res.ok) throw new Error(`Render failed: ${res.status}`);
fs.writeFileSync("invoice.pdf", Buffer.from(await res.arrayBuffer()));

Attaching to the email that follows

The response is the raw PDF, so the common pattern is a single function: render, attach, send. There is no intermediate upload step and no signed URL to expire, which also means the invoice never sits at rest on someone else’s infrastructure.

Frequently asked questions

Can I generate hundreds of invoices in one run?
Yes. Fan out concurrent requests — the queue absorbs the burst and retries transient failures. Bulk workflows are the common case for this endpoint.
How do I keep invoice numbering consistent?
Numbering stays in your application, where your database can guarantee uniqueness. Filecook only renders the HTML you send.
Do you store the documents you render?
No. Rendering happens in an isolated memory enclave and the output is discarded as soon as it has been returned to your request. Nothing is written to disk and nothing is retained.
Am I charged for failed renders?
No. Only successful 200 OK responses count against your quota. Malformed HTML, timeouts, and upstream errors are not billed.
Is there a free tier?
Yes — 500 renders a month, free forever, with no credit card required. That covers the playground, the full API, and both PDF and image output.

Keep reading

Ready to start cooking?

500 renders a month, free forever. No credit card, no sales call.