Sell by Measure
By Kavio Labs · Version 1.0.2Sell products by weight, length, area or volume with decimal quantities, unit prices, step/min/max and a live price on the product page.
- WooCommerce10.1 – 11.2
- WordPress6.7+
- HPOS and blocksYes
by Kavio Labs · for WooCommerce 10.1+ on WordPress 6.7+
EN 16931 e-invoices and credit notes from WooCommerce orders: XRechnung (CII/UBL), ZUGFeRD/Factur-X PDF/A-3 and Peppol BIS 3.0 UBL, gapless numbering, B2B checkout fields, validation, e-mail attachments, My Account downloads and ZIP export (HPOS).
EN 16931 e-invoices and credit notes from WooCommerce orders: XRechnung (CII/UBL), ZUGFeRD/Factur-X PDF/A-3 and Peppol BIS 3.0 UBL, gapless numbering, B2B checkout fields, validation, e-mail attachments, My Account downloads and ZIP export (HPOS).
WooCommerce 10.1 - 11.2, WordPress 6.7+
EN 16931 e-invoices and e-credit notes from WooCommerce orders: XRechnung (CII and UBL), ZUGFeRD / Factur-X (PDF/A-3) and Peppol BIS Billing 3.0. Everything is created on your own server; no external service is needed.
Requirements: WordPress 6.7+, WooCommerce 10.1+ (tested with 11.2), PHP 7.4-8.3 with mbstring (and Zip for ZIP exports). Works with High-Performance Order Storage (HPOS), the Cart and Checkout blocks and the classic checkout, block themes and classic themes.
| Format | File | Typical use |
|---|---|---|
| ZUGFeRD / Factur-X EN 16931 | PDF/A-3 with factur-x.xml | B2B in Germany and France; readable by people and machines |
| XRechnung 3.0 CII | XML | German public sector (B2G), German B2B |
| XRechnung 3.0 UBL | XML | German public sector (B2G) |
| Peppol BIS Billing 3.0 | UBL XML | Belgium and other Peppol countries (sent through an access point) |
This plugin creates documents in the published formats and checks them against the published rules. It does not give tax or legal advice: which format you must send, and to whom, depends on your country and your buyers. Ask your tax advisor when in doubt.
Own-site build: enter the licence key on the General tab (see Configuration).
Upload the new zip (WordPress offers to replace the installed version). Documents, numbers and settings are kept.
Deleting the plugin keeps the e-invoice records (they are legal records) unless Remove data on uninstall is on. Orders are never changed.
All settings are in WooCommerce > Settings > E-invoicing (capability manage_woocommerce).
| Setting | Default | Notes |
|---|---|---|
| Enable | on | Off: no new documents, no attachments. Existing documents stay downloadable. |
| Formats | all four | Offered for download and export. |
| Default format | ZUGFeRD / Factur-X | Used for e-mails, the My Account list button and the document status. |
| Create invoice at | Completed | Order statuses that create the e-invoice automatically. Empty = only by hand. |
| Business orders only | off | Automatic invoices only for orders with a company, VAT ID, buyer reference or Peppol ID. |
| Credit notes | on / on | A credit note per refund; a full credit note when an invoiced order is cancelled. |
| Paid at | Processing, Completed | Orders in these statuses with a payment date show "Paid" and amount due 0; others get a due date. |
| Attach to e-mails | Completed order, Order details, Refunded order | The refund e-mail gets the newest credit note. |
| Attached format | Default format | Or one format, or all enabled formats. |
| Customer downloads | on | My Account, order confirmation page, guest links with the order key. |
| Numbering | INV-{YYYY}-{N}, CN-{YYYY}-{N}, 5 digits, yearly reset | Tokens {YYYY} {YY} {MM} {DD} {N}. The next numbers are shown above the fields. |
| First invoice / credit note number | 1 | Used when a series starts, for example to continue the numbers of a previous tool. |
| Payment terms (days) | 14 | Due date of unpaid invoices. |
| Buyer reference | Order number | Used when the buyer gave none (XRechnung and Peppol need one). |
| Untaxed sales | Z (zero rated) | Category of lines without tax. Small businesses exempt from VAT: E plus the exemption reason. |
| Exemption reason | (empty) | Printed for category E, for example the legal reference of your exemption. |
| EU B2B without VAT | K (intra-community supply) | Untaxed sales to a buyer with a VAT ID in another EU country (goods: K, services: AE). |
| Exports | on | Untaxed sales to countries outside the EU are category G. |
| Default unit | C62 (one) | Products can set their own unit (Product data > Inventory > E-invoice unit). |
| Note | (empty) | Printed on every invoice. |
| Remove data on uninstall | off | Keep it off: invoices are legal records. |
Legal name, trading name, VAT ID (with country prefix), tax number, registration ID and scheme, legal information (directors, register court), Peppol ID / electronic address and scheme, address, contact name, phone, e-mail, IBAN, BIC, account holder and a payment terms text. XRechnung needs a phone number and an e-mail; credit transfer needs the IBAN. Without a Peppol ID the Peppol format derives one from the VAT ID, XRechnung uses the e-mail.
One row per WooCommerce tax rate: Automatic writes S (standard rate) for rates above 0 % and Z for 0 %. Choose E, AE, K, G or O for special rates. Lines without any tax use the "Untaxed sales" setting, with these automatic rules: reverse charge / intra-community supply (buyer VAT ID in another EU country and no tax charged, or orders that a VAT number plugin marked as VAT exempt) and export (buyer outside the EU).
One row per payment method: Automatic guesses the payment means (bank transfer 58, cheque 20, cash on delivery 10, others 68 "online payment service"). Credit transfer without an IBAN in the seller data is written as "not defined" (1) with a warning.
VAT ID, buyer reference / Leitweg-ID, Peppol ID and purchase order number: each Optional, Required or Hidden. Classic checkout: billing fields after the name / company. Block checkout: "Additional order information" (WooCommerce additional checkout fields). Values are checked by format only (VAT ID letters and digits, Peppol ID scheme:identifier with a known scheme, Leitweg-ID pattern); nothing is looked up online.
Admins edit the classic values in the billing address of the order; block checkout values are shown and editable by WooCommerce on the order screen. VAT IDs stored by common VAT number plugins (_billing_vat_number, _billing_vat_id, _vat_number ...) are used when our field is empty.
Own-site build: enter the Kavio Labs licence key; the plugin checks it once a day from the admin area for your domain (development hosts such as localhost always work, a new install has a 14-day start period). Without a valid licence no new e-invoices or credit notes are created and nothing is attached to e-mails; existing documents stay downloadable for you and your customers, and the admin pages stay available.
CodeCanyon build: the purchase code enables updates and support; no feature depends on it.
kv-eu-e-invoicing).Every order has at most one e-invoice. Its content is frozen when it is created: the number, date, seller and buyer data, lines, VAT and totals. All formats are rendered from this frozen record, so every download is identical.
Shows each document with its number, date, total and status, one download button per format (the dot shows the status of that format), the messages to fix and Rebuild. Rebuild creates the document again from the current order and settings and keeps its number and date: use it after you completed the seller data or changed a mapping.
| Status | Meaning |
|---|---|
| Valid | The default format passes the built-in checks. |
| Valid with notes | Passes, with hints (for example "Buyer Peppol ID derived from the VAT ID"). |
| Errors | Something is missing for the default format (for example the seller VAT ID or the IBAN). |
Messages of the other formats are listed too: Peppol, for example, needs buyer IDs that consumers do not have.
The default format (or the format chosen in Attached format) is attached to the e-mails chosen in Attach to e-mails. The "Refunded order" e-mail carries the newest credit note. "Order details" (sent from the order screen with Send order details to customer) carries the invoice.
Customers see an E-invoices section on the order details in My Account and on the order confirmation page, with one button per format, and an E-invoice button in the My Account orders list. Guest customers download with the link on the order confirmation page (protected by the order key).
All documents with filters (invoices / credit notes, date range, status, search by number, buyer, VAT ID or order) and downloads. Download ... documents (ZIP) exports the filtered documents in the chosen format (up to 5,000 per ZIP). The orders list also has bulk actions Download e-invoices (format, ZIP).
| Key | Syntax | CustomizationID / profile |
|---|---|---|
facturx | PDF/A-3b + CII D16B (factur-x.xml, AFRelationship Alternative) | urn:cen.eu:en16931:2017 (Factur-X 1.0 / ZUGFeRD 2.x EN 16931) |
xrechnung_cii | UN/CEFACT CII D16B | urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 |
xrechnung_ubl | UBL 2.1 Invoice / CreditNote | same as above |
peppol | UBL 2.1 Invoice / CreditNote | urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 |
The XML is written by a small string builder and the PDF by an own PDF/A-3 writer (embedded subset of Noto Sans, OFL; sRGB output intent; XMP with the Factur-X extension schema). PHP needs mbstring (zlib is used for compression when present); ZipArchive is used for ZIP exports only. No external library or service.
| Table | Content |
|---|---|
{prefix}kv_einv_documents | One row per document: type (I/C), order, refund, invoice reference, number, series + sequence (unique), unique key (inv:<order>, refund:<refund>, full:<invoice>), dates, currency, totals, buyer, validation status, per-format messages (JSON) and the frozen EN 16931 model (JSON). |
{prefix}kv_einv_counters | Last number per series (I2026, C2026, or I / C without yearly reset). Locked with SELECT ... FOR UPDATE while a number is taken; the document row is written in the same transaction. |
Orders are only read through the WooCommerce CRUD API (HPOS safe). The plugin writes the order meta _kv_einv_invoice (number) and an order note. Checkout fields: classic _billing_kv_einv_{vat_id|buyer_reference|peppol_id|po_number}, block _wc_other/kv-einv/{vat-id|buyer-reference|peppol-id|po-number}. Product meta _kv_einv_unit (UN/ECE code).
| Hook | Type | Arguments |
|---|---|---|
kv_einv_document_created | action | $doc_id, $doc (row with the model in data) |
kv_einv_invoice_model | filter | $model, $order: change the EN 16931 model before it is stored |
kv_einv_buyer_data | filter | $data (vat_id, buyer_reference, peppol_id, peppol_scheme, po_number, reverse_charge), $order |
kv_einv_auto_invoice | filter | $wanted, $order: skip automatic creation for an order |
Example: hand every new document to a Peppol access point.
add_action( 'kv_einv_document_created', function ( $doc_id, $doc ) {
$file = \KavioLabs\EuEInvoicing\Output::file( $doc, 'peppol' );
// $file['content'] is the UBL XML, $file['filename'] its name: send it to your access point here.
}, 10, 2 );
wp kv-einv invoice <order_id> create the e-invoice
wp kv-einv credit <order_id> [--refund=<refund_id>] credit the whole invoice or one refund
wp kv-einv render <doc_id> --format=<format> --out=<file|dir>
wp kv-einv validate <doc_id> built-in checks of every enabled format
wp kv-einv docs <order_id> documents of an order as JSON
The built-in checks cover the rules a store can fix (EN 16931 BR-xx, XRechnung BR-DE-xx, Peppol rules and check digits of Belgian, Swedish and GLN identifiers). The release tests run every format through the official validators: KoSIT validator with the XRechnung 3.0 configuration, the CEN EN 16931 and Peppol BIS 3.0 schematron, the CII and UBL XSDs and Mustang / veraPDF for PDF/A-3 and Factur-X.
includes/: Plugin (bootstrap, settings), Repository (tables, gapless numbers), Model/Builder (order and refund to model), Model/Calculator (VAT breakdown, totals), Format/{Xml,Ubl,Cii}, Pdf/{Document,Layout,TrueType,Icc,FacturX}, Formats, Validator, Codes, Issuer (lifecycle), Automation (status, refund, cancel, bulk), Emails, Checkout, Account, Downloads, Output, Parties, Texts, Cli, Admin/*, License/*.
Public authorities in Germany expect XRechnung. Most B2B buyers in Germany and France accept ZUGFeRD / Factur-X, which is also a normal PDF. Belgian and other Peppol buyers expect Peppol BIS Billing 3.0. Enable all four and let customers download the one they need.
The release tests check every format with the official validators (KoSIT XRechnung 3.0, EN 16931 and Peppol schematron, veraPDF / Mustang). In your store, the built-in checks show missing data (seller VAT ID, IBAN, buyer IDs) before you send a file.
It creates Peppol BIS 3.0 files. Sending needs a Peppol access point (a paid service, not included). Developers can use the kv_einv_document_created action, see Developer notes.
The ZUGFeRD / Factur-X PDF is a complete, readable invoice. If you keep another invoice plugin, use separate number series so that one invoice does not get two numbers.
Yes. WooCommerce stores net line totals and the tax per rate, so the e-invoice uses the same amounts as the order. Cent differences from per-line rounding are written as rounding (BT-114), so the amount due always equals the order total.
As document-level allowances ("Discount (CODE)") per VAT rate; the lines show the price before the discount.
E-invoicing mandates cover B2B and B2G sales. Turn on Business orders only to create automatic invoices only for orders with a company or a VAT ID.
No, it checks the format only. Use a VAT number plugin for VIES checks; its VAT ID and VAT-exempt flag are used.
No new e-invoices are created or attached; existing ones stay downloadable. See Configuration.
More for WooCommerce
Sell products by weight, length, area or volume with decimal quantities, unit prices, step/min/max and a live price on the product page.
Year/make/model parts search for WooCommerce: fitment table per product, CSV import, My Garage, fits / does not fit badge and vehicle-filtered shop and search pages.
Text and monogram engraving with a live preview on the product image: 12 fonts, positions, fixed or per-character fees, offensive-word filter and a printable production sheet.