PHPackages                             josemmo/einvoicing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. josemmo/einvoicing

ActiveLibrary[Payment Processing](/categories/payments)

josemmo/einvoicing
==================

Library for reading and creating European-compliant electronic invoices (EN 16931)

v0.3.1(11mo ago)173279.6k↑13.1%41[2 PRs](https://github.com/josemmo/einvoicing/pulls)2MITPHPPHP &gt;=7.1CI failing

Since Sep 1Pushed 11mo ago16 watchersCompare

[ Source](https://github.com/josemmo/einvoicing)[ Packagist](https://packagist.org/packages/josemmo/einvoicing)[ Docs](https://github.com/josemmo/einvoicing)[ RSS](/packages/josemmo-einvoicing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (22)Used By (2)

 [![](docs/logo.svg)
European Invoicing (eInvoicing)](https://josemmo.github.io/einvoicing/)
============================================================================================

[](#----european-invoicing-einvoicing)

 [![Build Status](https://github.com/josemmo/einvoicing/workflows/CI/badge.svg)](https://github.com/josemmo/einvoicing/actions) [![Latest Version](https://camo.githubusercontent.com/3aaf4d421d08ef4f6d110f2c47024414b8ceb655e960270fcafbdf9c0e6fa220/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f73656d6d6f2f65696e766f6963696e67)](https://packagist.org/packages/josemmo/einvoicing) [![Supported PHP Versions](https://camo.githubusercontent.com/24c3711f219819aaa9c0a40961198e63c4930253add0fe00fefdc8e35b4ffd29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a6f73656d6d6f2f65696e766f6963696e67)](#installation) [![License](https://camo.githubusercontent.com/a8c1debdd280b070bed3a5368c6ff08a92140c2c67a921084e1ee693e3816415/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f73656d6d6f2f65696e766f6963696e67)](LICENSE) [![Documentation](https://camo.githubusercontent.com/3d7ade9635b634ef7989c8040782b3b39292eafe4c719bb48b2bb9ff43506865/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f6e6c696e652d646f63732d626c756576696f6c6574)](https://josemmo.github.io/einvoicing/)

About
-----

[](#about)

eInvoicing is a PHP library for creating and reading electronic invoices according to the [eInvoicing Directive and European standard](https://ec.europa.eu/digital-building-blocks/wikis/display/DIGITAL/eInvoicing).

It aims to be 100% compliant with [EN 16931](https://ec.europa.eu/digital-building-blocks/wikis/x/boTXGw) as well as with the most popular CIUS and extensions, such as [PEPPOL BIS](https://docs.peppol.eu/poacc/billing/3.0/bis/).

Installation
------------

[](#installation)

First of all, make sure your environment meets the following requirements:

- PHP 7.1 or higher
- [SimpleXML extension](https://www.php.net/book.simplexml) for reading and exporting UBL/CII invoices

Then, you should be able to install this library using Composer:

```
composer require josemmo/einvoicing

```

Usage
-----

[](#usage)

For a proper quick start guide, visit the documentation website at .

### Importing invoice documents

[](#importing-invoice-documents)

```
use Einvoicing\Exceptions\ValidationException;
use Einvoicing\Readers\UblReader;

$reader = new UblReader();
$document = file_get_contents(__DIR__ . "/example.xml");
$inv = $reader->import($document);
try {
    $inv->validate();
} catch (ValidationException $e) {
    // Invoice is not EN 16931 complaint
}
```

### Exporting invoice documents

[](#exporting-invoice-documents)

```
use Einvoicing\Identifier;
use Einvoicing\Invoice;
use Einvoicing\InvoiceLine;
use Einvoicing\Party;
use Einvoicing\Presets;
use Einvoicing\Writers\UblWriter;

// Create PEPPOL invoice instance
$inv = new Invoice(Presets\Peppol::class);
$inv->setNumber('F-202000012')
    ->setIssueDate(new DateTime('2020-11-01'))
    ->setDueDate(new DateTime('2020-11-30'));

// Set seller
$seller = new Party();
$seller->setElectronicAddress(new Identifier('9482348239847239874', '0088'))
    ->setCompanyId(new Identifier('AH88726', '0183'))
    ->setName('Seller Name Ltd.')
    ->setTradingName('Seller Name')
    ->setVatNumber('ESA00000000')
    ->setAddress(['Fake Street 123', 'Apartment Block 2B'])
    ->setCity('Springfield')
    ->setCountry('DE');
$inv->setSeller($seller);

// Set buyer
$buyer = new Party();
$buyer->setElectronicAddress(new Identifier('ES12345', '0002'))
    ->setName('Buyer Name Ltd.')
    ->setCountry('FR');
$inv->setBuyer($buyer);

// Add a product line
$line = new InvoiceLine();
$line->setName('Product Name')
    ->setPrice(100)
    ->setVatRate(16)
    ->setQuantity(1);
$inv->addLine($line);

// Export invoice to a UBL document
header('Content-Type: text/xml');
$writer = new UblWriter();
echo $writer->export($inv);
```

Roadmap
-------

[](#roadmap)

These are the expected features for the library and how's it going so far:

- Representation of invoices, parties and invoice lines as objects
- Compatibility with the most used [CIUS and extensions](https://ec.europa.eu/digital-building-blocks/wikis/display/EINVCOMMUNITY/Registry+of+CIUS+%28Core+Invoice+Usage+Specifications%29+and+Extensions)
- Export invoices to UBL documents
- Import invoices from UBL documents
- Export invoices to CII documents
- Import invoices from CII documents
- Proper documentation

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance51

Moderate activity, may be stable

Popularity54

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~203 days

Total

18

Last Release

343d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35634d9b598826205bb05ac611f5e0b322a79a1fdec13168ca0019d584e87450?d=identicon)[josemmo](/maintainers/josemmo)

---

Top Contributors

[![josemmo](https://avatars.githubusercontent.com/u/4470267?v=4)](https://github.com/josemmo "josemmo (219 commits)")[![ChristianVermeulen](https://avatars.githubusercontent.com/u/1062751?v=4)](https://github.com/ChristianVermeulen "ChristianVermeulen (4 commits)")[![hmazter](https://avatars.githubusercontent.com/u/805377?v=4)](https://github.com/hmazter "hmazter (3 commits)")[![dennisfransen](https://avatars.githubusercontent.com/u/30899136?v=4)](https://github.com/dennisfransen "dennisfransen (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![rycks](https://avatars.githubusercontent.com/u/1468823?v=4)](https://github.com/rycks "rycks (1 commits)")

---

Tags

eueuropeinvoiceinvoicingpeppolphpublinvoiceinvoicingublpeppolcii

### Embed Badge

![Health badge](/badges/josemmo-einvoicing/health.svg)

```
[![Health](https://phpackages.com/badges/josemmo-einvoicing/health.svg)](https://phpackages.com/packages/josemmo-einvoicing)
```

###  Alternatives

[num-num/ubl-invoice

A modern object-oriented PHP library to create and read valid UBL and EN 16931/Peppol BIS 3.0 files

135820.5k](/packages/num-num-ubl-invoice)[horstoeko/zugferd

A library for creating and reading european electronic invoices

4174.3M18](/packages/horstoeko-zugferd)[horstoeko/zugferdublbridge

Convert Factur-X/ZUGFeRD (CII-Syntax) to PEPPOL (UBL-Syntax) and visa versa

16135.6k5](/packages/horstoeko-zugferdublbridge)[cleverit/ubl_invoice

A PHP wrapper for UBL invoices

36283.4k](/packages/cleverit-ubl-invoice)[easybill/e-invoicing

A package to read and create EN16931 e-invoices or CIUS like: XRechnung, ZUGFeRD etc.

12122.5k](/packages/easybill-e-invoicing)[greenter/ubl-validator

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

15180.9k9](/packages/greenter-ubl-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
