USE CASE · COMMERCE

Invoice PDF generator API

Turn your invoice template into a PDF the moment an order closes. Post the same HTML template every time, with the order’s line items merged in, and get back an archival-quality document stamped with your brand.

Why teams use it for invoices

An invoice is one document whether it’s a single line item or a multi-page statement: PDFRelay counts documents, not file size or page count, so a heavier invoice template doesn’t cost more. Rendering is real headless Chromium via Playwright, so the CSS in your existing invoice template, including page breaks between line items, comes out exactly as it would in a browser print preview.

POST /api/v1/pdf with your rendered invoice markup in the html field returns 200 with application/pdf bytes, ready to attach to a receipt email or store alongside the order record. Options like format and margin control paper size and layout for the printed copy.

Fits a checkout flow

NeedHow it’s handled
Generate on order completionSingle synchronous POST, no queue or webhook to manage.
Consistent brandingSame HTML template every time, merge fields filled server-side.
Cost predictabilityFlat per-document pricing across every plan, see pricing.
Duplicate re-sendsIdentical requests are served from a short-TTL cache at no extra quota cost.

TRY IT · FREE · NO SIGNUP

Render your invoice template now

Paste your invoice HTML into the free playground and see the exact PDF the API would return, no signup needed.

Open the playgroundRead the docs

Free tier: 150 invoices/month, no card. Common questions are in the FAQ, and if you’re weighing credit-based pricing elsewhere, see PDFRelay vs PDFShift. Back to the PDFRelay homepage.

Invoice PDF generator API · PDFRelay