vineethkrishnan/xrechnung-kit-core

EN 16931 / XRechnung 3.0 compliant e-invoice generator and validator. Framework-agnostic core.

Maintainers

Package info

github.com/vineethkrishnan/xrechnung-kit-core

Homepage

Issues

Documentation

pkg:composer/vineethkrishnan/xrechnung-kit-core

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v2.0.0 2026-05-09 16:28 UTC

This package is auto-updated.

Last update: 2026-05-10 05:10:49 UTC


README

EN 16931 / XRechnung 3.0 compliant e-invoice generator and validator for PHP. Framework-agnostic core.

Packagist License PHP Version

This is the framework-agnostic core of xrechnung-kit. It turns a typed PHP value object describing an invoice into a KoSIT-strict valid XRechnung 3.0 / EN 16931 XML document, validates the output in memory before writing to disk, and quarantines invalid output.

This package is intentionally minimal. It has no framework dependencies and no runtime network calls. Framework adapters (Laravel, Symfony, CakePHP, Laminas) and the optional KoSIT Schematron bundle are published as separate packages from the same monorepo.

Installation

composer require vineethkrishnan/xrechnung-kit-core

Optional KoSIT Schematron validation:

composer require --dev vineethkrishnan/xrechnung-kit-kosit-bundle

Framework adapters:

composer require vineethkrishnan/xrechnung-kit-laravel
composer require vineethkrishnan/xrechnung-kit-symfony
composer require vineethkrishnan/xrechnung-kit-cakephp
composer require vineethkrishnan/xrechnung-kit-laminas

Quick start

use XrechnungKit\Builder\XRechnungBuilder;
use XrechnungKit\Generator\XRechnungGenerator;
use XrechnungKit\Validator\XRechnungValidator;

$mappingData = (new MyInvoiceMapper($invoice, $customer))->produce();

$entity = XRechnungBuilder::buildEntity($mappingData);
$generator = new XRechnungGenerator($entity);
$path = $generator->generateXRechnung('/path/to/Invoice_RE-1.xml');

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

The generator runs UBL XSD validation in memory before writing. Invalid output lands at *_invalid.xml and triggers a deduplicated operator alert.

Document classes supported:

  • Standard invoice (UNTDID 380)
  • Partial invoice / deposit / Anzahlung (UNTDID 326)
  • Caution / security deposit
  • Credit note / cancellation (UNTDID 381)
  • Deposit cancellation

Requirements

  • PHP 8.1, 8.2, 8.3, or 8.4
  • ext-libxml, ext-dom, ext-mbstring
  • Optional psr/log
  • Java 11+ for KoSIT Schematron validation (only when running validate-kosit)

Repository

Source, issues, docs, and PRs live in the monorepo: vineethkrishnan/xrechnung-kit.

This repo (xrechnung-kit-core) is an auto-generated split of the monorepo's core/ subtree, published for Packagist. Do not open PRs here; open them against the monorepo.

License

MIT. Bundled UBL XSDs and KoSIT scenarios retain their original licenses; see LICENSE-third-party.md.

Trademark notice

"XRechnung" is a German federal e-invoicing standard maintained by KoSIT (Koordinierungsstelle fuer IT-Standards). xrechnung-kit is an independent open source library and is neither affiliated with nor endorsed by KoSIT or any German government agency.