How to create a WooCommerce invoice from an order ID

Updated 27 October 2026

A WooCommerce order records what a customer bought. To create a separate branded invoice in Business Hub, connect the store through its REST API, fetch the numeric order ID, review the imported details and generate a PDF. This guide covers the first import, the difference between order and invoice numbers, and what to check when a connection fails.

What you need

  • A WooCommerce store using HTTPS, an existing order and access to its WordPress administration area.
  • A Business Hub plan with an available WooCommerce data source. Check current plan limits before connecting another store.
  • Your business profile, invoice prefix and payment instructions, plus a ready-made or saved invoice template.

Step-by-step

  1. Create a dedicated read-only API keyIn WooCommerce, open Settings → Advanced → REST API → Add key. Choose a user who can access orders, give the key a recognisable description and select Read permission. Generate the key and copy the consumer key and consumer secret into the connection form; keep them private.
  2. Connect the correct storeIn Business Hub, open Data Sources → Add Data Source and choose WooCommerce. Enter the store URL, consumer key and consumer secret, then test the connection. Use the store address rather than a product page or WordPress login URL.
  3. Review mapping with a real orderOpen Mapping Rules for the data source and fetch a sample. Check billing name, email and address, the line-item names and quantities, prices, tax and shipping. Standard fields have suggested mappings; custom fields may need an adjustment.
  4. Fetch the order and review the invoiceOpen Create Invoice → From Data Source, select the store and enter the numeric order ID. Check the customer, currency, line items, discounts, tax and shipping against the WooCommerce order before sending anything.
  5. Download or send the PDFChoose the business profile and invoice template you want to use, generate the invoice and review its PDF. Download it or email it after configuring your sending mailbox. WhatsApp delivery depends on the plan and configured connection.
  6. Save the workflow for the next orderSave the data source, field mapping, business profile and template as an Invoice Flow. Use it to generate the next invoice by entering another order ID. This is an on-demand workflow; connecting the store does not automatically invoice every new order.

Order ID, order number and invoice number

These identifiers serve different purposes. The WooCommerce REST API fetches an order by its numeric ID. A numbering plugin may show customers a different order number, such as WEB-2048; that display number may not work as the API lookup ID.

Business Hub assigns the invoice its own number and keeps the imported order reference separately. Set Invoice Prefix and Starting Number in Settings → Business Profile. A fresh sequence with prefix BH- and starting number 1 produces BH-00001; an existing sequence continues after its last used number. Changing the prefix does not rename historical invoices.

For example, numeric order ID 2048 can become invoice BH-00001. Keep both references when answering a customer enquiry so you can find the source order and its invoice.

Check an imported order before sending

Treat your first import as a comparison with the original order. For a simple order with two items at 25 each, no tax or discount and shipping of 5, the expected total is 55 in the order currency. If the invoice differs, inspect the field mapping before emailing the customer.

Stores with tax-inclusive pricing, coupons, fees or custom checkout fields need particular care. Do not add the same tax or shipping amount twice. The generated invoice is a separate record; a later refund or edit in WooCommerce should be reviewed against that record rather than assumed to have synchronised automatically.

Fix connection and import problems

Start with the connection test, then the order ID, then the mapping. This helps distinguish a store access problem from a field selection problem.

  • Authentication or permission error: check that the key belongs to this store, has not been revoked and has Read permission. Its WordPress user must also have access to orders. Replace an exposed key rather than sharing it in a support message.
  • Order not found: confirm that you selected the right store and entered the numeric API order ID rather than a custom display number. Test with an order returned by the connection test.
  • Timeout, HTML response or blocked request: check the HTTPS store URL and ask the site administrator to inspect security rules or hosting restrictions affecting the WooCommerce REST API. Keep authentication enabled.
  • Customer or items missing: fetch a sample of that exact order and review the billing and line-item mappings. A custom checkout field may use a different location from the standard field.
  • Unexpected totals: compare quantities, unit prices, discounts, tax and shipping with the source order. Correct the mapping and review the regenerated result before sending.

Tips

  • Search existing invoices for the order reference before generating another invoice for the same order.
  • Use a dedicated API key for this connection so it can be revoked independently.
  • Check the pricing page for data source, invoice and delivery limits; connecting a store does not remove those limits.

Learn more about the WooCommerce invoice integration →

See all guides →

Further reading

Try it yourself

Create a free account and follow along in a few minutes.

Create free account