Download the PHP package tmonier/sylius-facturx-plugin without Composer

On this page you can find all versions of the php package tmonier/sylius-facturx-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-facturx-plugin

Sylius Factur-X Plugin

Français : README.fr.md

Build

Factur-X / ZUGFeRD (EN 16931) electronic invoices for the Sylius 2 Invoicing Plugin.

The official Sylius Invoicing Plugin generates PDF invoices. Since September 2026, French businesses must be able to receive electronic invoices, and large and mid-sized companies must issue them (SMEs from September 2027); German businesses must accept them since 2025. A plain PDF is not an electronic invoice.

This plugin turns the invoice PDFs into Factur-X PDF/A-3 files with an embedded factur-x.xml (UN/CEFACT Cross Industry Invoice, EN 16931 profile), the hybrid format accepted in France and in Germany (where it is called ZUGFeRD), free and open source.

Features

Need What the plugin does
Issue e-invoices without changing the invoicing flow The PDF rendered by the Invoicing Plugin becomes a PDF/A-3 with factur-x.xml and the Factur-X XMP metadata, before it is stored: the existing admin and shop download links serve it.
A machine-readable invoice that adds up XML at the EN 16931 (COMFORT) profile: lines with net and gross prices, item discounts, shipping as a line, multi-rate VAT breakdown, totals that reconcile to the cent with the PDF.
Hand the XML to an accountant or a platform Factur-X XML download button on the admin invoice page, in the invoices grid and in the invoices of the order page.
Legal data of the seller Factur-X settings per channel: legal name, SIREN, SIRET, VAT number, legal form and share capital, trade register, electronic address, payment terms and due date, IBAN / BIC, payment notes. SIREN, SIRET and French VAT numbers are checked (Luhn, VAT key).
French 2026 mentions Category of operation and payment state in the business process (BT-23: B1, S2, M1...), seller and buyer SIREN, delivery address when different, VAT on debits option (BT-8), notes PMT / PMD / AAB.
B2B customers Optional B2B identifiers card on the admin customer page: company name, SIREN, VAT number, electronic address.
VAT exemptions Category used for the lines without VAT (exempt, zero rated, reverse charge, intra-community, export, not subject to VAT) with the exemption reason and VATEX code.
Install on a running shop tmonier:facturx:regenerate-pdfs renders the stored invoice PDFs again as Factur-X.
Send invoices to a plateforme agréée Not included: the tmonier_facturx.invoice_generated event gives a connector the XML and the PDF.

Also included: translations in English, French, German, Spanish, Italian, Dutch and Polish; Twig Hooks everywhere; MySQL, MariaDB and PostgreSQL support.

Screenshots

Requirements

Version
PHP 8.2+ (ext-dom, ext-gd, ext-zip, ext-fileinfo)
Sylius 2.2, 2.3
Symfony 6.4, 7.4, 8.0
sylius/invoicing-plugin 2.2+, with PDF generation enabled

The PDF of the Invoicing Plugin must be readable by the free FPDI parser (no compressed cross-reference streams): this is the case of PDFs rendered by wkhtmltopdf, the default renderer. The plugin depends on horstoeko/zugferd (MIT), which itself requires smalot/pdfparser (LGPL-3.0, installed by Composer, not bundled).

Installation

  1. Install and configure the Sylius Invoicing Plugin first (bundles, configuration, routes, migrations, wkhtmltopdf).

  2. Require the package:

  3. Register the bundle in config/bundles.php, after the Invoicing Plugin:

  4. Import the configuration in config/packages/tmonier_sylius_facturx.yaml:

  5. Import the admin routes in config/routes/tmonier_sylius_facturx.yaml:

  6. Run the migrations:

  7. In the admin, open Channels → (edit a channel) → Factur-X settings, enable Factur-X and fill in the seller data. The address of the seller comes from the shop billing data of the channel (company, tax ID, street, postcode, city, country): fill it in too.

  8. Optionally, render the PDFs of the invoices issued before as Factur-X:

Configuration

Alternative is required in Germany for the EN 16931 profile and accepted in France.

The ChannelSettings and CustomerIdentifiers resources can be extended like any Sylius resource (tmonier_sylius_facturx.resources.channel_settings.classes.model, ...).

What ends up in the XML

Invoice data Factur-X
Invoice number, issue date, currency, order number BT-1, BT-2, BT-5, BT-14
Seller: legal name, SIREN, SIRET, VAT number, legal form + trade register, address BT-27, BT-30 (scheme 0002), BT-29 (0009), BT-31, BT-33, BG-5
Buyer: billing company or name, address, B2B identifiers BT-44, BG-8, BT-47, BT-48, BT-49
Shipping address, when different from the billing address BG-15
Last shipping date of the order (nothing while no shipment is shipped) BT-72
Lines: product (or shipping method), variant code, quantity, gross and net unit price, net amount, VAT category and rate BG-25
VAT breakdown per category and rate BG-23
Totals, amount paid, amount due, due date (channel settings or a payment terms provider) BG-22, BT-9
IBAN / BIC, payment terms (channel settings or a payment terms provider), notes BG-16, BT-20, BT-22

The amounts are the ones of the invoice: Sylius rounds the VAT per unit, so a VAT amount may differ by a few cents from taxable amount × rate, which EN 16931 allows. The full mapping, the French rules and the sources are in SPEC.md.

Extension point: per-order payment terms

By default the due date (BT-9) is the issue date plus the channel's payment due days when an amount is due, and the payment terms (BT-20) are the channel's payment terms text. A plugin that knows better for some orders (e.g. trade credit: "45 days end of month", per-customer terms) provides them with an InvoicePaymentTermsProviderInterface:

Autoconfigured services get the tmonier_facturx.invoice_payment_terms_provider tag (set priority on the tag or with #[AsTaggedItem], highest first). The first provider returning terms wins; the channel settings apply when none does. When an amount is due, terms with neither due date nor text are skipped, so the XML always satisfies BR-CO-25. Paid invoices (nothing due) never get a due date (BT-9), whatever the provider returns; its text is kept. The aggregate is available as InvoicePaymentTermsProviderInterface (tmonier_facturx.payment_terms_provider).

Extension point: transmission to a platform

The event is dispatched every time the PDF is rendered, before it is stored, including when it is rendered again: listeners must be idempotent (use the invoice id). A failing listener is logged and does not prevent the invoice.

Customisation

Hook Content
sylius_admin.invoice.show.content.header.title_block.actions → tmonier_facturx_download_xml XML download button of the invoice page
sylius_admin.order.show.content.sections.invoices.table.body.actions → tmonier_facturx_download_xml XML download in the invoices of the order page
sylius_admin.channel.update.content.header.title_block.actions → tmonier_facturx_settings Link to the Factur-X settings
sylius_admin.customer.show.content.sections → tmonier_facturx_identifiers B2B identifiers card
tmonier_facturx.admin.channel.settings / tmonier_facturx.admin.customer.identifiers Settings pages (sections seller, vat, payment, notes)

Grid actions are added to sylius_admin_channel (tmonier_facturx) and sylius_invoicing_invoice (tmonier_facturx_xml). Services can be decorated: tmonier_facturx.mapper.invoice (invoice → data), tmonier_facturx.xml.writer (data → XML), tmonier_facturx.pdf.embedder (PDF + XML → PDF/A-3).

A project decorates tmonier_facturx.xml.writer as shown in the override guide of the B2B demo, which also covers templates, forms and entities.

The XML download route (tmonier_facturx_admin_invoice_download_xml) checks InvoiceVoter::ACCESS (from sylius/invoicing-plugin) before serving the file, mirroring the access control applied to the core PDF download (DownloadInvoiceAction).

Limitations

This plugin is not legal or tax advice. It produces a technically valid document from the data you enter and the taxes Sylius computes. The legal mentions, VAT rates, categories and exemption reasons, the buyer data and the choice of a PA remain the merchant's responsibility: check them with your accountant.

Development

Placeholder PDFs: when WKHTMLTOPDF_PATH does not point to an executable wkhtmltopdf, the test application (dev and test environments) renders every invoice as a one-page FPDF placeholder (Invoice 2026/10/000001), which still becomes a valid Factur-X PDF. To see the real invoices without installing wkhtmltopdf, use the Docker wrapper (wkhtmltopdf 0.12.6 with patched Qt), then clear the cache and render the stored PDFs again:

The tests validate every generated XML against the Factur-X EN 16931 XSD and re-compute the EN 16931 calculation rules in PHP. The functional tests write etc/build/factur-x.pdf and etc/build/factur-x.xml (and, with a real wkhtmltopdf, etc/build/factur-x-wkhtmltopdf.pdf); the CI renders a real invoice and validates them with Mustang (EN 16931 schematron and veraPDF):

B2B demo

This plugin is used in the Sylius B2B demo: a Sylius 2.3 shop with fictitious sample data where the B2B plugins work together. The source code, setup and fixtures of the demo are in that repository.

The demo is an example, not a production setup.

License

MIT. See LICENSE.


All versions of sylius-facturx-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
horstoeko/zugferd Version ^1.0.120
sylius/invoicing-plugin Version ^2.2
sylius/sylius Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tmonier/sylius-facturx-plugin contains the following files

Loading the files please wait ...