---
title: "E-invoicing in PHP: a library for ZUGFeRD and XRechnung"
description: "Open-source library for e-invoices in PHP 8.3: create ZUGFeRD, XRechnung and Peppol, validate them and read incoming invoices. Works without Laravel."
canonical_url: "https://quittio.dev/en/php"
locale: en
meta:
  "og:description": "Open-source library for e-invoices in PHP 8.3: create ZUGFeRD, XRechnung and Peppol, validate them and read incoming invoices. Works without Laravel."
  "og:image": "https://quittio.dev/og/php-en.jpg"
  "og:image:alt": "E-invoices with PHP, with Symfony, another framework or none: Quittio set up as a Symfony service."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "E-invoicing in PHP: a library for ZUGFeRD and XRechnung"
  "twitter:image": "https://quittio.dev/og/php-en.jpg"
  "twitter:image:alt": "E-invoices with PHP, with Symfony, another framework or none: Quittio set up as a Symfony service."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

# 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.

[**Guide in the docs**](https://quittio.dev/en/docs/getting-started#without-laravel) [**Step by step**](https://quittio.dev/en/guides/e-invoices-with-php-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('rechnung@muster.de', 'EM')
        ->contact('Erika Muster', '+49 30 1234567', 'erika@muster.de'),
    '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');
```

## Formats

Every format comes from the same data model. Details and code for Laravel and PHP are on the format pages.

- [**Create ZUGFeRD with PHP**PDF/A-3 with embedded CII XML, profiles BASIC to EXTENDED and XRECHNUNG.](https://quittio.dev/en/formats/zugferd)
- [**Create XRechnung with PHP**XRechnung 3.0 in CII or UBL, with Leitweg-ID, extension and CVD.](https://quittio.dev/en/formats/xrechnung)
- [**Create Peppol BIS with PHP**UBL according to Peppol BIS Billing 3.0, Peppol rules checked in PHP.](https://quittio.dev/en/formats/peppol)

## 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](https://quittio.dev/en/guides/validating-e-invoices-kosit-verapdf)

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

[Read e-invoices with PHP](https://quittio.dev/en/guides/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('rechnung@muster.de', 'EM')
                ->contact('Erika Muster', '+49 30 1234567', 'erika@muster.de'),
            '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](https://quittio.dev/en/guides/e-invoices-with-php-without-laravel#symfony).

## 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](https://quittio.dev/en).

## Packages

| **Package** | **Content** | **Links** |
| --- | --- | --- |
| quittio/core | Country-neutral core: EN 16931 data model, calculation, CII and UBL, ZUGFeRD/Factur-X, validation. Works without Laravel. | [GitHub](https://github.com/Quittio/core) · [Packagist](https://packagist.org/packages/quittio/core) |
| quittio/country-de | Country pack for Germany: mandatory fields under the VAT Act, tax presets, XRechnung, BR-DE rules, DIN 5008. | [GitHub](https://github.com/Quittio/country-de) · [Packagist](https://packagist.org/packages/quittio/country-de) |
| quittio/country-at | Country 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](https://github.com/Quittio/country-at) · [Packagist](https://packagist.org/packages/quittio/country-at) |
| quittio/country-be | Country 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](https://github.com/Quittio/country-be) · [Packagist](https://packagist.org/packages/quittio/country-be) |
| quittio/country-ch | Country 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](https://github.com/Quittio/country-ch) · [Packagist](https://packagist.org/packages/quittio/country-ch) |
| quittio/country-fr | Country 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](https://github.com/Quittio/country-fr) · [Packagist](https://packagist.org/packages/quittio/country-fr) |

## 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](https://quittio.dev/en/guides/php-e-invoicing-libraries-compared).

## Try it in five minutes.

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

[**Guide in the docs**](https://quittio.dev/en/docs/getting-started#without-laravel) [**Compare libraries**](https://quittio.dev/en/guides/php-e-invoicing-libraries-compared)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/en#website","@type":"WebSite","description":"E-invoicing for PHP and Laravel: create, validate, read and archive ZUGFeRD, XRechnung and Peppol invoices.","inLanguage":"en","name":"Quittio","url":"https://quittio.dev/en","publisher":{"@id":"https://quittio.dev/#identity"},"translationOfWork":{"@id":"https://quittio.dev/#website"}},{"@id":"https://quittio.dev/en/php#webpage","@type":"WebPage","description":"Open-source library for e-invoices in PHP 8.3: create ZUGFeRD, XRechnung and Peppol, validate them and read incoming invoices. Works without Laravel.","name":"E-invoicing in PHP: a library for ZUGFeRD and XRechnung","url":"https://quittio.dev/en/php","breadcrumb":{"@id":"https://quittio.dev/en/php#breadcrumb"},"isPartOf":{"@id":"https://quittio.dev/en#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/en/php"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/en/php#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://github.com/Quittio/core","description":"Open-source library for e-invoices in PHP 8.3: create ZUGFeRD, XRechnung and Peppol, validate them and read incoming invoices. Works without Laravel.","license":"https://opensource.org/licenses/MIT","name":"quittio/core","programmingLanguage":"PHP","runtimePlatform":"PHP 8.3","version":"1.1.0"},{"@id":"https://quittio.dev/en/php#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://quittio.dev/en","position":1},{"@type":"ListItem","name":"PHP","position":2}]},{"@id":"https://quittio.dev/en/php#/schema/question/1","@type":"Question","inLanguage":"en","name":"Do I need Laravel?","acceptedAnswer":{"@type":"Answer","text":"No. quittio/core has no dependency on Laravel. You only need Laravel 13 for the quittio/laravel integration and for Quittio Managed."}},{"@id":"https://quittio.dev/en/php#/schema/question/2","@type":"Question","inLanguage":"en","name":"Which PHP version do I need?","acceptedAnswer":{"@type":"Answer","text":"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."}},{"@id":"https://quittio.dev/en/php#/schema/question/3","@type":"Question","inLanguage":"en","name":"Do I need Java?","acceptedAnswer":{"@type":"Answer","text":"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."}},{"@id":"https://quittio.dev/en/php#/schema/question/4","@type":"Question","inLanguage":"en","name":"Does Quittio run in a Shopware or WordPress plugin?","acceptedAnswer":{"@type":"Answer","text":"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."}},{"@id":"https://quittio.dev/en/php#/schema/question/5","@type":"Question","inLanguage":"en","name":"What does Quittio cost?","acceptedAnswer":{"@type":"Answer","text":"Nothing. The core, the Laravel integration and the country packs are MIT licensed. Only Quittio Managed, the invoice management for Laravel apps, is paid."}},{"@id":"https://quittio.dev/en/php#/schema/question/6","@type":"Question","inLanguage":"en","name":"Which other PHP libraries exist for ZUGFeRD and XRechnung?","acceptedAnswer":{"@type":"Answer","text":"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."}},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"en","url":"https://quittio.dev/logo.png"}]}
```