How invoice numbering and XML generation work based on order status
Goal
Understand exactly when POP assigns the invoice number and when it generates the XML, to avoid mismatches between document numbering and dates.
When the invoice number is assigned
The number is assigned the first time the order moves to “Processing” or “Completed” status (whichever comes first). From that point on, the order already has a sequential number, even if the document hasn’t been sent to the customer yet.
When the XML is generated
By default, the XML is generated when the order reaches “Completed” status (this behavior can be customized via a filter for developers, not through a UI setting). For refunds, POP automatically generates the credit note XML the moment the refund is registered in WooCommerce — no manual action is needed just to generate the document.
If you use an add-on that transmits to an external accounting software (e.g. Fatture in Cloud, Aruba), sending to the external software may still require a manual upload from the “Invoices” tab depending on the add-on’s configuration: check the specific behavior in the active add-on’s configuration, since it can differ from what’s described here for the native flow.
The invoice date depends on when it’s sent
This is the point that causes the most confusion:
- If the invoice is sent while the order is still “Processing”, the document date stays the date of the move to Processing.
- If it’s not sent while the order is “Processing” and is only sent once the order is completed, the date updates to the day of completion.
Mismatch example:
- 01/04 — Order #101 moves to Processing → invoice no. 1 generated, not yet sent.
- 01/07 — Order #102 moves to Processing → invoice no. 2 generated and sent dated 01/07.
- 03/04 — Order #101 is completed and invoice no. 1 is only sent now → the date updates to 03/04.
Result: invoice no. 2 has a date (01/07) earlier than invoice no. 1 (03/04), even though it has a lower number.
Verify
Before sending invoices in bulk, check in the Invoices tab that numbering and dates are consistent (increasing number = increasing date).
Common errors
- Numbering and dates out of chronological order — avoid leaving orders “Processing” for a long time before sending the invoice; if you know an order will stay in Processing for a while, consider not moving it to that status until you’re ready to handle it.
- The refund XML doesn’t show up — check that the refund was actually registered in WooCommerce (not just an external refund noted separately).
- The XML doesn’t reach the external accounting software connected via add-on — document generation and sending it to the external software are two separate steps when an add-on is active: check whether a manual upload is needed.
Related configuration
For the credit note and its requirements, see credit-note-generation; for where/how the XML files are stored, see generated-files-storage.