KoSIT-strict valid output
Generates XRechnung 3.0 XML that satisfies UBL XSD and the optional KoSIT Schematron rules (BR-DE-* and CIUS). Output is byte-stable within a patch release.
A KoSIT-strict valid e-invoice generator and validator. A framework-agnostic core, with first-class adapters for Laravel, Symfony, CakePHP, and Laminas.
| Code | Name | Constructor |
|---|---|---|
| 380 | Standard invoice | MappingData::standardInvoice(...) |
| 326 | Partial invoice / Anzahlung | MappingData::partialInvoice(...) |
| 326 | Caution / security deposit | MappingData::cautionInvoice(...) |
| 381 | Credit note / cancellation | MappingData::creditNote(...) |
| 381 | Deposit cancellation | MappingData::depositCancellation(...) |
composer require vineethkrishnan/xrechnung-kit-coreuse 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.
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.