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.
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.
Pre-warmed Chromium pool means no cold starts. Invoices are ready instantly.
Use any CSS โ custom fonts, logos, colors. The output matches your brand pixel-perfectly.
Configure page format, margins, and orientation per request.
Generate invoices from Node, Python, PHP, Ruby, Go โ any HTTP client works.
<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>());
}Free tier โ 50 PDFs/month. No credit card required.
Get your free API key โ