Skip to content
PPDFInvoiceAPI

Generate order confirmations from HTML, in one API call

order confirmation PDF API

When an order is placed, a confirmation PDF makes the purchase feel real and gives the customer something to file. Render an itemised, branded confirmation from your order data in one call and attach it to the confirmation email.

No credit card · 25 free credits to start

OVERVIEW

What is the order confirmation PDF API?

The order confirmation PDF API is an HTTP endpoint that turns a placed order into a branded, itemised PDF in one request. You POST the order data as JSON to /v1/render — order number, items, quantities, shipping and total — and get print-ready PDF bytes back in about 400ms, ready to attach to the order-placed email.

An order confirmation is the document that makes a purchase feel real. It goes out the instant the order is placed — straight after checkout, alongside the “thanks for your order” email — and it gives the customer one tidy summary to file: what they bought, how many, what it cost, and where it is going. It is not a tax document like the invoice; it is the reassuring snapshot the customer keeps while they wait for the box.

Generating confirmations from HTML keeps that snapshot on-brand and itemised without a second design system. You build the confirmation once as HTML and CSS — your storefront look, your logo, your colours — and let the order data fill it in. The item list is the only repeating part: because the merge engine is loop-free, you render the rows to HTML yourself (name, quantity, line total) and drop them in through one raw {{{ itemsHtml }}} placeholder, then add a shipping line and total below.

The right place to call /v1/render is the same flow that records the order, immediately post-checkout. You already hold the line items and totals, so you POST them and the confirmation PDF comes back in roughly 400 milliseconds — fast enough to attach to the order-placed email in the same request, with no queue or callback. Drive it from the same data shape as your other order documents so the confirmation, the invoice and the delivery note for one order all line up. Nothing is stored on our side; the bytes are streamed back and discarded.

THE PROBLEM

Generating order confirmations in-house is a two-week project you'll maintain forever

Turning HTML into a clean PDF yourself means running headless Chrome and everything around it. Here's the work you skip.

  • Recreating your order summary in a PDF library that does not match the email or storefront.
  • Laying out a long item list with quantities, prices and a shipping block by hand.
  • Running and scaling a browser farm for what is really one templated document.
  • Keeping the confirmation in sync with the invoice and receipt for the same order.

THE SOLUTION

From your data to a finished order confirmation, in one request

Store your order confirmations layout once, then POST the values to /v1/render and get print-ready application/pdfbytes back in roughly 400ms. Merge is plain{{ }} /{{{ }}} and dotted keys — no template loops to learn, so repeating rows are rendered to HTML and dropped in through one raw placeholder.

  • Itemised and branded. Quantities, line totals and a shipping block in your own layout, with your logo and colours.
  • One call per order. No queue or callback — generate the confirmation in the same flow that places the order and attach it to the email.
  • Consistent with invoices. Drive confirmations, invoices and receipts from the same data shape so every document for an order matches.

Full /v1/render reference →

curl https://api.pdfinvoiceapi.com/v1/render \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "tpl_order_confirmation",
    "data": {
      "orderNo": "ORD-58210",
      "placed": "2026-06-24",
      "customer": { "name": "Priya Raman" },
      "itemsHtml": "<tr><td>Mechanical keyboard ×1</td><td>€129.00</td></tr><tr><td>Wrist rest ×1</td><td>€24.00</td></tr>",
      "shipping": "€6.00",
      "total": "€159.00"
    },
    "pdf": { "format": "A4", "margin": "16mm", "printBackground": true }
  }' \
  -o order-confirmation.pdf

HOW TO

How to generate order confirmations from HTML

  1. 01

    Design the confirmation in HTML

    Build the order summary as plain HTML and CSS — order number, date, customer block, an items table, a shipping line and the total. Mark the dynamic values with {{ placeholders }} and your logo and colours so it matches the storefront.

  2. 02

    Store it once as a template

    Save the layout in the dashboard for a tpl_ id. Every confirmation is then just order data, so the look never drifts and your requests stay small.

  3. 03

    POST the order data to /v1/render

    Right after checkout, send the template id and a JSON data object with your API key. Render the ordered items to HTML rows and pass them through one raw {{{ itemsHtml }}} placeholder — the merge engine has no loops.

  4. 04

    Stream the PDF back

    The response body is the confirmation PDF. Attach it to the order-placed email or return it from your endpoint as application/pdf — all in the request that recorded the order.

WHAT YOU GET

The features that matter for order confirmations

Itemised and branded

Quantities, line totals and a shipping block in your own layout, with your logo and colours.

One call per order

No queue or callback — generate the confirmation in the same flow that places the order and attach it to the email.

Consistent with invoices

Drive confirmations, invoices and receipts from the same data shape so every document for an order matches.

FAQ

Order confirmations on PDFInvoiceAPI — common questions

How do I generate an order confirmation PDF from HTML?
Design the confirmation as HTML/CSS with {{ placeholders }}, store it once as a template, then POST the template id and a JSON data object to /v1/render. You get application/pdf bytes back in one synchronous call — no SDK to install and no browser to run yourself.
Can I attach the confirmation to the order-placed email automatically?
Yes. Call /v1/render in the same flow that records the order, get the PDF bytes back in roughly 400ms, and attach them to the confirmation email you are already sending — no queue, no callback, all in one request.
How do I render a long list of ordered items?
Because the merge engine is loop-free, you render the item rows to HTML yourself — name, quantity, line total — join them into one string, and drop them in through a single raw {{{ itemsHtml }}} placeholder. A long list flows onto extra pages as needed.
Can the confirmation match my invoice and delivery note?
Yes. Drive the confirmation, the invoice and the delivery note from the same order data shape and the same HTML/CSS family, so every document for one order reads consistently.
Can I use my own logo, fonts and brand colours?
Always — the PDF is your own HTML/CSS, so the confirmation matches your storefront and emails. Drive the logo and accent colour from data, or save a brand kit and {{brand.logo}} / {{brand.color}} fill in automatically.
Are my order confirmations stored on your servers?
No. Each PDF is streamed back in the response and discarded — the content is processed transiently and never persisted on our side.

Render your first order confirmation PDF in the next five minutes

One endpoint, real PDFs, 25 free credits to start. No credit card to begin.

Cancel anytime · no long-term contract