Skip to content

E-invoices with PHP. With Symfony, another framework or none.

quittio/core creates ZUGFeRD, XRechnung and Peppol according to EN 16931, validates every invoice before output and reads incoming invoices. In any project with PHP 8.3, without Laravel.

In short

For e-invoices in PHP, install quittio/core and the country pack quittio/country-de. Both are MIT licensed and need PHP 8.3, no framework, no account and no external service. One instance from Quittio::create() creates ZUGFeRD (PDF/A-3 with XML), XRechnung and Peppol, validates them according to EN 16931 and reads incoming invoices.

Installation

One Composer command, no config file. You need:

  • PHP 8.3 or newer
  • the extensions ctype, dom, gd, libxml, mbstring, xmlwriter and zlib; intl is recommended
  • Java 11 or newer (or Docker) only for the official KoSIT validator, veraPDF (or Docker) only for the PDF/A check; both are optional
composer require quittio/core quittio/country-de

A complete example

The script creates a ZUGFeRD invoice and saves it. render() calculates, validates and renders; an invalid invoice throws a ValidationException with rule code, field and hint before any file is written.

invoice.php
<?php
require __DIR__.'/vendor/autoload.php';

use Quittio\Core\Builder\InvoiceBuilder;
use Quittio\Core\Builder\Party;
use Quittio\Core\Quittio;
use Quittio\Core\Tax\CountryDefaultVat;
use Quittio\Country\DE\CountryDE;

// once at start-up: seller, bank account, country pack and default VAT (19 %)
$quittio = Quittio::create([
    'seller' => Party::make('Muster GmbH')
        ->vatId('DE123456789')
        ->address('Hauptstraße 1', '12345', 'Musterstadt', 'DE')
        ->electronicAddress('[email protected]', 'EM')
        ->contact('Erika Muster', '+49 30 1234567', '[email protected]'),
    'bank_account' => ['iban' => 'DE02120300000000202051'],
], [new CountryDE]);
InvoiceBuilder::useDefaultVat(new CountryDefaultVat($quittio->countries()));

$result = $quittio->invoice()
    ->number('RE-2026-0042')
    ->deliveryDate('2026-09-30')
    ->buyer(Party::make('Kunde AG')->vatId('DE987654321')->address('Bahnhofstraße 5', '54321', 'Beispielstadt', 'DE'))
    ->line('Web development', netPrice: '95.00', quantity: 24)
    ->dueInDays(14)
    ->render();                                   // ZUGFeRD: PDF/A-3 with embedded XML

$result->save(__DIR__.'/invoices/');              // invoices/Rechnung_RE-2026-0042.pdf

For a German authority the Leitweg-ID is enough; Quittio then picks XRechnung, or you name the format:

invoice.php
$result = $quittio->invoice()
    // ...
    ->buyerReference('04011000-12345-03')         // Leitweg-ID of the authority
    ->render('xrechnung-cii');

Validate and read

Every invoice is validated before output: the rules of EN 16931, XRechnung, Peppol and German VAT law in PHP, plus the XSD. Add the KoSIT validator and veraPDF for CI.

Validating e-invoices with KoSIT and veraPDF

The same instance reads incoming invoices: CII, UBL and ZUGFeRD PDFs, into the same data model.

Read e-invoices with PHP

incoming.php
// content of an XML or PDF file
$read = $quittio->read($content);
$read->data->number;                 // "RE-2026-0042"
$read->data->totals?->amountDue;

// all validation levels on the incoming invoice
$report = $quittio->validateFile($content);
$report->isValid();

Using it in Symfony

There is no Symfony bundle, and none is needed. A small factory creates the instance, the service definition calls it, and autowiring passes it to controllers and services. Tested with Symfony DependencyInjection 8.1.

QuittioFactory.php
<?php
// src/Invoicing/QuittioFactory.php
namespace App\Invoicing;

use Quittio\Core\Builder\InvoiceBuilder;
use Quittio\Core\Builder\Party;
use Quittio\Core\Quittio;
use Quittio\Core\Tax\CountryDefaultVat;
use Quittio\Country\DE\CountryDE;

final class QuittioFactory
{
    public static function create(string $iban): Quittio
    {
        $quittio = Quittio::create([
            'seller' => Party::make('Muster GmbH')          // seller instead of config/quittio.php
                ->vatId('DE123456789')
                ->address('Hauptstraße 1', '12345', 'Musterstadt', 'DE')
                ->electronicAddress('[email protected]', 'EM')
                ->contact('Erika Muster', '+49 30 1234567', '[email protected]'),
            'bank_account' => ['iban' => $iban],
        ], [new CountryDE]);
        InvoiceBuilder::useDefaultVat(new CountryDefaultVat($quittio->countries()));   // lines without vat(): 19 %

        return $quittio;
    }
}
services.yaml
# config/services.yaml
services:
    # ...

    Quittio\Core\Quittio:
        factory: ['App\Invoicing\QuittioFactory', 'create']
        arguments:
            $iban: '%env(QUITTIO_IBAN)%'

A controller that returns the invoice as a download is in the guide Create e-invoices with plain PHP, no Laravel needed.

What only works with Laravel

  • Facade, config file and Artisan commands
  • Blade templates, queue, events, mail and storage
  • Quittio::fake() and the test assertions (factories and scenarios also work without Laravel)
  • Quittio Managed with numbering, archive and cancellations

Everything that makes a valid e-invoice lives in the core. The Laravel integration is a wrapper around it. Quittio with Laravel.

Packages

PackageContentLinks
quittio/coreCountry-neutral core: EN 16931 data model, calculation, CII and UBL, ZUGFeRD/Factur-X, validation. Works without Laravel.GitHub · Packagist
quittio/country-deCountry pack for Germany: mandatory fields under the VAT Act, tax presets, XRechnung, BR-DE rules, DIN 5008.GitHub · Packagist
quittio/country-atCountry pack for Austria: mandatory fields of the UStG 1994, tax presets, CIUS-AT, ebInterface, default interest. Not part of quittio/quittio, not yet reviewed by a tax adviser.GitHub · Packagist
quittio/country-beCountry pack for Belgium: mandatory fields of Royal Decree No. 1, tax presets, Peppol BIS, language regions, default interest. Not part of quittio/quittio, not yet reviewed by a tax adviser.GitHub · Packagist
quittio/country-chCountry pack for Switzerland: MWSTG requirements, tax presets, QR bill, rounding to 5 Rappen. Not part of quittio/quittio, not yet reviewed by a tax adviser.GitHub · Packagist
quittio/country-frCountry pack for France: mentions of the CGI and the Code de commerce, e-invoicing reform, SIREN, late payment penalties. Not part of quittio/quittio, not yet reviewed by a tax adviser.GitHub · Packagist

Frequently asked questions

Do I need Laravel?

No. quittio/core has no dependency on Laravel. You only need Laravel 13 for the quittio/laravel integration and for Quittio Managed.

Which PHP version do I need?

PHP 8.3 or newer with the extensions ctype, dom, gd, libxml, mbstring, xmlwriter and zlib. intl is recommended for numbers and dates in the language of the invoice.

Do I need Java?

Only for the official KoSIT validator. It can run as a separate service or Docker container, so your application itself does not need Java. The checks in PHP and the XSD run without Java.

Does Quittio run in a Shopware or WordPress plugin?

If the server has PHP 8.3 with the required extensions and the plugin loads Composer packages, yes. Quittio brings its own dependencies, such as mPDF and Carbon. Check with composer require beforehand whether they fit the versions of your shop.

What does Quittio cost?

Nothing. The core, the Laravel integration and the country packs are MIT licensed. Only Quittio Managed, the invoice management for Laravel apps, is paid.

Which other PHP libraries exist for ZUGFeRD and XRechnung?

For example horstoeko/zugferd, easybill/zugferd-php, josemmo/einvoicing, num-num/ubl-invoice and atgp/factur-x. What they do is in the comparison of PHP libraries.

Try it in five minutes.

One Composer command, one script, one validated e-invoice.