๐Ÿงพ Use case

Automate PDF invoice
generation at scale

Stop exporting invoices manually. Use Renderly's API to generate PDF invoices from your HTML templates on demand โ€” triggered by your billing system, webhook, or user action.

How it works

Your billing system renders the invoice as HTML (using your existing template engine), then calls Renderly's API. You get a PDF back in under 200ms.

โšก

Under 200ms per render

Pre-warmed Chromium pool means no cold starts. Invoices are ready instantly.

๐ŸŽจ

Your HTML, your branding

Use any CSS โ€” custom fonts, logos, colors. The output matches your brand pixel-perfectly.

๐Ÿ“

A4, Letter, or custom size

Configure page format, margins, and orientation per request.

๐Ÿ”—

Any language or framework

Generate invoices from Node, Python, PHP, Ruby, Go โ€” any HTTP client works.

Code example

invoice.js
<span class="kw">async function</span> <span class="fn">generateInvoicePDF</span>(invoice) {
  <span class="kw">const</span> html = <span class="fn">renderInvoiceTemplate</span>(invoice);

  <span class="kw">const</span> res = <span class="kw">await</span> fetch(
    <span class="str">'https://api.renderlyapi.com/v1/pdf/from-html'</span>,
    {
      method: <span class="str">'POST'</span>,
      headers: {
        <span class="str">'Authorization'</span>: <span class="str">`Bearer ${process.env.RENDERLY_KEY}`</span>,
        <span class="str">'Content-Type'</span>: <span class="str">'application/json'</span>,
      },
      body: JSON.<span class="fn">stringify</span>({
        html,
        format: <span class="str">'A4'</span>,
        marginTop: <span class="str">'15mm'</span>,
        marginBottom: <span class="str">'15mm'</span>,
      }),
    }
  );

  <span class="kw">return</span> Buffer.<span class="fn">from</span>(<span class="kw">await</span> res.<span class="fn">arrayBuffer</span>());
}

Other use cases

Start generating invoices

Free tier โ€” 50 PDFs/month. No credit card required.

Get your free API key โ†’