# Send a PDF invoice for every WooCommerce order automatically WooCommerce order PDF invoices created automatically with Zapier, n8n or a webhook, without another WordPress plugin, then emailed or saved. **Quick answer.** When a WooCommerce order is paid, Zapier or n8n receives the order. The order details go into an invoice template, html-pdf.com turns it into a PDF, and the next step emails it to your customer or saves it to Google Drive. ## What you'll build Every paid order produces a clean, branded invoice PDF within seconds. It shows your store name, order number, billing address, products, shipping, tax and total. The PDF lands in the customer's inbox as an attachment, and a copy can go to a Drive folder for bookkeeping. Nothing runs on your WordPress server, so your site stays as fast as it is today. ## What you need - **A WooCommerce store** on a public URL with HTTPS. - **Zapier or n8n.** Zapier needs the official WooCommerce integration and a plan that includes Webhooks by Zapier. n8n has a built in WooCommerce Trigger node. - **An invoice design.** Use the [invoice template](https://html-pdf.com/templates/invoice). The template is a web page design that we turn into a PDF, so you only change the text, logo and colors. - **An API key** from [html-pdf.com](https://html-pdf.com/login). You get 100 free pages once, no card needed. ## Step by step with Zapier 1. **Trigger.** Create a Zap with **WooCommerce** as the app and **Order paid** as the event. This needs the Zapier Integration for WooCommerce extension installed on your store. 2. **Make the PDF.** Add **Webhooks by Zapier → Custom Request**. Method `POST`, URL `https://html-pdf.com/v1/pdf`. 3. **Headers.** `Authorization` set to `Bearer hp_live_...` and `Content-Type` set to `application/json`. 4. **Data.** Paste the JSON below and swap the sample values for WooCommerce fields from the dropdown. 5. **Deliver.** Add **Gmail → Send Email** (or any email app). Map the billing email into **To** and the `url` from the Custom Request into **Attachments**. ```json { "html": "
Billed to Sam Lee
Total: 74.50 EUR
", "format": "A4", "margin": "15mm", "filename": "invoice-2087.pdf", "response": "url" } ``` `"response": "url"` gives you a download link that works for 24 hours. Zapier fetches the file from it, so you don't handle files yourself. ## Step by step with n8n n8n is a good fit if you already host it or want to avoid per task pricing. 1. Add a **WooCommerce Trigger** node and choose the `order.updated` or `order.created` event. n8n registers the webhook in your store for you. 2. Add an **If** node that keeps only orders with status `processing` or `completed`, so unpaid orders are skipped. 3. Add a **Code** node that builds the invoice HTML from `line_items`, `billing` and `total`. 4. Add an **HTTP Request** node that posts to `https://html-pdf.com/v1/pdf`. Set the response format to **File** to get the PDF directly. 5. Add **Gmail → Send** and attach the binary `data` field. Full node settings are in the [n8n guide](https://html-pdf.com/guides/n8n). Make users can follow the [Make guide](https://html-pdf.com/guides/make). ## Code path for developers You can also add a webhook yourself in **WooCommerce → Settings → Advanced → Webhooks** with the topic **Order updated**, pointing at your own endpoint. ```js app.post("/woo/order", express.json(), async (req, res) => { const o = req.body; if (!["processing", "completed"].includes(o.status)) return res.sendStatus(200); const rows = o.line_items .map(i => `${o.billing.first_name} ${o.billing.last_name}
Total ${o.total} ${o.currency}
`; const r = await fetch("https://html-pdf.com/v1/pdf", { method: "POST", headers: { Authorization: `Bearer ${process.env.HTML_PDF_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ html, filename: `invoice-${o.number}.pdf`, response: "url" }), }); const { url } = await r.json(); // Email the link or download and attach the file. res.sendStatus(200); }); ``` Check the `X-WC-Webhook-Signature` header with your webhook secret before using the data. Order updated fires more than once per order, so remember which order numbers already got an invoice. ## Ask your AI agent With the [html-pdf.com MCP server](https://html-pdf.com/pdf-mcp-server) connected to [Claude](https://html-pdf.com/guides/claude) or [ChatGPT](https://html-pdf.com/guides/chatgpt), you can shape the design before automating it. > Use html-pdf to create a sample invoice PDF for my WooCommerce store "Hillside Coffee". Include a VAT line at 21%, a bank transfer note and my address in the footer with page numbers. When the sample looks right, ask for the HTML and paste it into your Zapier or n8n step. ## Plugin or API? Invoice plugins run inside WordPress and are fine for many shops. An API approach keeps the work off your server, gives you full control of the design and plugs into the rest of your automations. Pick the one that matches how you already work. ## FAQ ### Do I need a WordPress plugin for this? No PDF plugin is needed. With Zapier you install the Zapier Integration for WooCommerce extension, and with n8n or your own webhook nothing extra is required. ### How do I avoid sending two invoices for one order? Use a trigger that fires once, like Order paid in Zapier. With the Order updated webhook, store the order numbers you already processed and skip repeats. ### Can I use my own invoice numbers? Yes. Put any number you like into the template, for example the WooCommerce order number with a prefix, or a counter from Google Sheets. ### How much does it cost per invoice? One credit per PDF page, so a one page invoice is one credit. Packs start at $10 for 1,000 pages and never expire.