Skip to content

xrechnung-kitEN 16931 / XRechnung 3.0 for PHP

A KoSIT-strict valid e-invoice generator and validator. A framework-agnostic core, with first-class adapters for Laravel, Symfony, CakePHP, and Laminas.

xrechnung-kit monogram

Document classes supported

CodeNameConstructor
380Standard invoiceMappingData::standardInvoice(...)
326Partial invoice / AnzahlungMappingData::partialInvoice(...)
326Caution / security depositMappingData::cautionInvoice(...)
381Credit note / cancellationMappingData::creditNote(...)
381Deposit cancellationMappingData::depositCancellation(...)

At a glance

bash
composer require vineethkrishnan/xrechnung-kit-core
php
use XrechnungKit\Builder\XRechnungBuilder;
use XrechnungKit\XRechnungGenerator;
use XrechnungKit\XRechnungValidator;

$entity    = XRechnungBuilder::buildEntity($mappingData);
$generator = new XRechnungGenerator($entity);
$path      = $generator->generateXRechnung('out/Invoice-001.xml');

$validator = new XRechnungValidator();
$ok = $validator->validate($path);

The generator runs UBL XSD validation in memory before writing. If validation fails, the file is written to a *_invalid.xml sibling for inspection rather than the requested path; a deduplicated operator alert is emitted through PSR-3.

See the full walkthrough for a step-by-step tour from composer require to a Schematron-valid file on disk.

Status and compliance

xrechnung-kit is published on Packagist as vineethkrishnan/xrechnung-kit-core. It targets the XRechnung 3.0 standard and the underlying EN 16931 European norm. The bundled schemas are the official OASIS UBL 2.4 Invoice and CreditNote XSDs. Schematron validation is performed by the official KoSIT validator, wrapped by the optional kosit-bundle package and gated behind a Java 17+ requirement at validation time only.

xrechnung-kit is an independent open source library, distributed under the MIT license. It is neither affiliated with nor endorsed by KoSIT, the Bundesregierung, or any German federal or state agency. The "XRechnung" name refers to the federal e-invoicing standard maintained by KoSIT (Koordinierungsstelle fuer IT-Standards). See trademarks for full wording.

Released under the MIT License. xrechnung-kit is an independent open source library and is neither affiliated with nor endorsed by KoSIT or any German government agency.