Skip to content
ThemesIonic — home
WooCommerce

WooCommerce Invoices: Creating and Sending PDF Invoices

WooCommerce sends order emails, not invoices. What the built-in Order details email actually is, where the core stops, and what to check before you trust a plugin with numbered PDF invoices and credit notes.

5 min read beginner

Some links on this page are affiliate links: if you buy through one, we may earn a commission at no extra cost to you. It does not change what we recommend; see the editorial policy.

WooCommerce sends order emails, not invoices: there is no PDF, no invoice number and no credit note in the core plugin. If a customer, an accountant or a tax authority needs a numbered invoice document, it has to come from somewhere else. What follows is what the core does provide, where it stops, and what to check before handing the job to a plugin. None of it is tax advice — what an invoice must contain is set by the law where you trade.

What WooCommerce already sends

The email that looks like an invoice is the one WooCommerce calls Order details (internally customer_invoice, class WC_Email_Customer_Invoice; with the block email editor enabled it is titled Payment request). It is marked as a manual email: nothing sends it automatically. You trigger it from the order screen with the order action Send order details to customer.

Its default subject is Details for order #{order_number} on {site_title}. The body lists the items, totals and addresses, and for an unpaid order it includes a link to the payment page. That makes it useful for orders created in the admin and paid later. It does not make it an invoice:

An invoice usually needs The Order details email
A unique, sequential invoice number Shows the order number
A fixed document that does not change Rendered fresh each time it is sent
Seller details, tax IDs, tax per rate Only what the email template shows
A file the customer can keep An HTML email
A credit note when you refund Nothing — a refund is only recorded on the order

The automatic customer emails — processing, completed, refunded — have the same limits. You can add fields to them with woocommerce_email_order_meta, which is fine for a VAT number or a purchase order reference, but the result is still an email, not a document.

Why the order number is not an invoice number

By default get_order_number() returns the order ID, passed through the woocommerce_order_number filter. The ID comes from a shared counter: on the classic posts storage it is a post ID, and with High-Performance Order Storage WooCommerce still creates a placeholder post for each order to reserve one. Products, pages, revisions, refunds and the draft orders the block checkout creates all take numbers from the same sequence. A store's orders therefore run 1043, 1051, 1052, 1060.

That is harmless for an order reference and a problem for invoices in jurisdictions that expect consecutive numbering. Changing the displayed order number is covered in sequential order numbers; for invoices, the cleaner rule is a separate counter that only moves when an invoice is issued, so cancelled and unpaid orders never consume one.

Where the core stops

WooCommerce gives developers the pieces: the woocommerce_email_attachments filter lets code attach a file to any email, and order data is available through $order in every email template. Generating a PDF, numbering it, storing it so it never changes, and producing a credit note on refund is a small application of its own.

That is plugin territory. WooCommerce PDF Invoices is one example of what such a plugin covers: it generates PDF invoices and packing slips, creates credit notes for refunded orders, attaches documents to the order emails for the statuses you choose, and lets customers download them from their account.

What to check in any invoice plugin

Numbering. It should have its own sequence, independent of the order ID, with a prefix or suffix and the option to restart each year if your accountant wants that. Check what happens to the number when an order is cancelled after the invoice was issued: the invoice should stay, and a credit note should cancel it.

Immutability. An issued invoice should not silently change when someone edits the order afterwards. Look for a setting that controls whether documents are regenerated, and keep it off once an invoice has gone out.

Legal fields. Seller name and address, your tax registration number, the customer's tax number for business sales, the tax amount per rate, and the dates required where you trade. If the plugin cannot show a field you need, the template has to be editable.

Trigger status. Decide whether the sale is invoiced when the order is paid or when it ships, and attach the document to that one email. The status flow is the same one described in woocommerce_order_status_completed.

Customer access. A download link in My Account saves you resending documents. Some stores add their own tab for this, as in account menu items; a plugin that adds the link itself makes that unnecessary.

Characters and fonts. PDF libraries need fonts that cover the scripts your customers use. Place a test order with a name in Greek, Cyrillic or Chinese and look at the result.

B2B details. Wholesale customers often need a purchase order number and net payment terms on the invoice; that pattern is covered in WooCommerce B2B and wholesale.

Packing slips are the same kind of document with prices removed, and the decisions behind them are in WooCommerce packing slips.

Common mistakes

  • Treating the Order details email as an invoice. It has no number and changes when the order changes.
  • Using order IDs as invoice numbers where gap-free numbering is expected.
  • Attaching invoices to two statuses, which sends the document twice.
  • Regenerating issued invoices after editing an order instead of issuing a credit note.
  • Never testing a refund. The credit note is the part most stores discover is missing at year end.
  • Forgetting the emails themselves. An attachment cannot arrive if the order emails do not; if they go missing, start with WooCommerce emails not sending.

Verify

  1. Place a test order and confirm the invoice arrives with the email you chose, and only that one.
  2. Check the invoice number is in its own sequence and does not match the order ID by accident.
  3. Edit the order and confirm the issued invoice does not change.
  4. Refund part of the order and confirm a credit note is produced.
  5. Log in as the customer and download the document from My Account.

Frequently asked

No. The closest built-in feature is the Order details email, which you send manually from the order screen. It is an HTML email with the order contents and a payment link for unpaid orders — no PDF, no invoice number, and nothing stored for the customer to download later.
Usually not. The order number is the order ID by default, and IDs skip values because they come from the same counter as posts, pages, drafts and refunds. Where invoices must be numbered without gaps, give them their own sequence that only increments when an invoice is actually issued.
Attach it to the status at which you consider the sale invoiced. Many stores use processing, because payment has been taken; stores that invoice on shipment use completed. Pick one, because attaching to both issues the document twice and, with some plugins, burns two invoice numbers.

Related guides