PHPackages                             num-num/ubl-invoice - 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. num-num/ubl-invoice

ActiveLibrary[Payment Processing](/categories/payments)

num-num/ubl-invoice
===================

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

v2.4.1(3mo ago)135820.5k↓37.5%97[9 issues](https://github.com/num-num/ubl-invoice/issues)[3 PRs](https://github.com/num-num/ubl-invoice/pulls)MITPHPPHP ^7.4 || ^8.0CI passing

Since Nov 9Pushed 3mo ago8 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (87)Used By (0)

UBL-Invoice
===========

[](#ubl-invoice)

A modern object-oriented PHP library to **create** and **read** valid UBL and Peppol BIS 3.0 files. Please feel free to [contribute](https://github.com/num-num/ubl-invoice/pulls) if you are missing features or tags.

[![Latest Version on Packagist](https://camo.githubusercontent.com/e8ecd5b0a1a290864169acf6e47a26452953ff0144bbc0cec55a7cc7f324edb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e756d2d6e756d2f75626c2d696e766f6963652e7376673f7374796c653d726f756e6465642d737175617265)](https://packagist.org/packages/num-num/ubl-invoice)[![Total Downloads](https://camo.githubusercontent.com/ced8b4623d49b335c4af4a13f9efdae0740a198882839406a7b08caed2b58e41/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e756d2d6e756d2f75626c2d696e766f6963652e7376673f7374796c653d726f756e6465642d737175617265)](https://packagist.org/packages/num-num/ubl-invoice)

[![Num•Num UBL Invoice](https://camo.githubusercontent.com/48a9f1df49b6e144fa3221137f776dd81650b4bec3f19414c27c649f4b85747e/68747470733a2f2f692e696d6775722e636f6d2f4a5079464259512e706e67)](https://camo.githubusercontent.com/48a9f1df49b6e144fa3221137f776dd81650b4bec3f19414c27c649f4b85747e/68747470733a2f2f692e696d6775722e636f6d2f4a5079464259512e706e67)

Installation and usage
----------------------

[](#installation-and-usage)

This package is fully compatible with **PHP 8.x** and also supports **PHP 7.4**. You can install it using [Composer](https://www.getcomposer.org).

```
$ composer require num-num/ubl-invoice
```

#### Creating UBL files

[](#creating-ubl-files)

```
$invoice = (new \NumNum\UBL\Invoice())
    ->setUBLVersionId('2.4')
    ->setId(123);
    // ... etc, all other props you need

$generator = new \NumNum\UBL\Generator();
$ublXml = $generator->invoice($invoice);
```

Please check some of the example code in the `tests/Write` folder to see how you can quickly create an UBL file and use all included properties.

#### Reading UBL files ✨

[](#reading-ubl-files-)

Need to quickly read UBL files? As of version 2.0, this library now supports UBL file reading. It's simple and easy to use:

```
$ublReader = \NumNum\UBL\Reader::ubl();
$invoice = $ublReader->parse(file_get_contents($fileName));
var_dump($invoice); // An \NumNum\UBL\Invoice instance with filled properties!
```

Please check some additional example code in the `tests/Read` folder.

Upgrading
---------

[](#upgrading)

If you are upgrading from version 1.x to 2.0, please check the [UPGRADING.md](UPGRADING.md) guide for breaking changes and migration instructions.

Contributing - bug reporting
----------------------------

[](#contributing---bug-reporting)

This library is **not 100% UBL/Peppol feature-complete**, in the sense that it doesn't (yet) support **all** UBL XML tags &amp; functionality. "Yet" being the keyword, since this definitely is the long-term goal. However, **all common UBL tags that are required to create and read most common invoices and creditnotes** are present in the library. This includes tags for discounts, cash discounts, special vat rates, etc...

If you are missing functionality, please feel free to add it :-) Adding additional tags &amp; attributes is *very* straight-forward. Check out [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

Are you experiencing a bug? Please feel free to open an issue in the issue tracker!

Documentation
-------------

[](#documentation)

- [Getting Started](docs/getting-started.md) - Quick start guide with installation and basic examples
- [Creating Invoices](docs/creating-invoices.md) - Detailed invoice creation guide
- [Creating Credit Notes](docs/creating-credit-notes.md) - Credit note creation guide
- [Reading UBL Files](docs/reading-ubl-files.md) - Parsing existing UBL documents
- [Advanced Features](docs/advanced-features.md) - Payment means, attachments, EN16931 compliance

For additional examples, check the unit tests in the `tests` folder.

Changelog
---------

[](#changelog)

Since version 2.0, all changelog information can be found on the [GitHub Releases](https://github.com/num-num/ubl-invoice/releases) page.

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 77.8% 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 ~32 days

Recently: every ~4 days

Total

84

Last Release

99d ago

Major Versions

v1.21.3 → v2.0.0-beta122025-07-01

v1.21.4 → v2.0.0-beta132025-11-06

v1.22.0 → v2.0.0-beta142025-12-17

v1.22.1 → v2.0.0-beta152025-12-18

v1.22.2 → v2.0.02025-12-18

PHP version history (6 changes)v1.1PHP ^7.0

v1.9.0PHP ^7.1

v1.12PHP ^7.1||^8.0

v1.0.0PHP ^8.0

v1.14PHP ^7.3 || ^8.0

v2.0.0-alpha1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0d27d7db734ffaf5377cd5e388483271916928cb4782bcb85e3fe427180428b?d=identicon)[brtdv](/maintainers/brtdv)

---

Top Contributors

[![brtdv](https://avatars.githubusercontent.com/u/932365?v=4)](https://github.com/brtdv "brtdv (368 commits)")[![TSimkus](https://avatars.githubusercontent.com/u/14792406?v=4)](https://github.com/TSimkus "TSimkus (15 commits)")[![CasperBE](https://avatars.githubusercontent.com/u/22048227?v=4)](https://github.com/CasperBE "CasperBE (14 commits)")[![JorisDebonnet](https://avatars.githubusercontent.com/u/3286264?v=4)](https://github.com/JorisDebonnet "JorisDebonnet (8 commits)")[![p1eterdeboer](https://avatars.githubusercontent.com/u/33135160?v=4)](https://github.com/p1eterdeboer "p1eterdeboer (7 commits)")[![fMads](https://avatars.githubusercontent.com/u/832842?v=4)](https://github.com/fMads "fMads (6 commits)")[![rodehoed](https://avatars.githubusercontent.com/u/6515395?v=4)](https://github.com/rodehoed "rodehoed (6 commits)")[![tgeorgel](https://avatars.githubusercontent.com/u/11785727?v=4)](https://github.com/tgeorgel "tgeorgel (5 commits)")[![PlayeMatthieu](https://avatars.githubusercontent.com/u/27778440?v=4)](https://github.com/PlayeMatthieu "PlayeMatthieu (5 commits)")[![antal-levente](https://avatars.githubusercontent.com/u/63246047?v=4)](https://github.com/antal-levente "antal-levente (4 commits)")[![mabjavaid](https://avatars.githubusercontent.com/u/62252347?v=4)](https://github.com/mabjavaid "mabjavaid (4 commits)")[![Stormyy](https://avatars.githubusercontent.com/u/5009558?v=4)](https://github.com/Stormyy "Stormyy (3 commits)")[![ronaldsgailis](https://avatars.githubusercontent.com/u/422543?v=4)](https://github.com/ronaldsgailis "ronaldsgailis (2 commits)")[![stedekay](https://avatars.githubusercontent.com/u/1071560?v=4)](https://github.com/stedekay "stedekay (2 commits)")[![vsadrn](https://avatars.githubusercontent.com/u/141677995?v=4)](https://github.com/vsadrn "vsadrn (2 commits)")[![japsen](https://avatars.githubusercontent.com/u/4325546?v=4)](https://github.com/japsen "japsen (2 commits)")[![KarelBrijs](https://avatars.githubusercontent.com/u/16884712?v=4)](https://github.com/KarelBrijs "KarelBrijs (2 commits)")[![karstennilsen](https://avatars.githubusercontent.com/u/8917480?v=4)](https://github.com/karstennilsen "karstennilsen (2 commits)")[![markovic131](https://avatars.githubusercontent.com/u/1120908?v=4)](https://github.com/markovic131 "markovic131 (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

peppolphpublubl-invoiceubl20ubl21xmlxmlinvoiceeinvoiceE-Invoiceublinvoiceelectronic invoicexml invoiceubl invoicedigital invoiceublefffpeppolpeppol bispeppolbispeppol invoiceeuinvoice

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/num-num-ubl-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/num-num-ubl-invoice/health.svg)](https://phpackages.com/packages/num-num-ubl-invoice)
```

###  Alternatives

[saleh7/php-zatca-xml

An unofficial PHP library for generating ZATCA Fatoora e-invoices. This library facilitates the creation of compliant e-invoices, QR Codes, and certificates, as well as the submission of e-invoices to ZATCA's servers. It provides developers with an easy-to-use, customizable, and robust toolkit to integrate and automate ZATCA e-invoicing processes in PHP applications.

5112.5k](/packages/saleh7-php-zatca-xml)[sevaske/php-zatca-xml

An unofficial PHP library for generating ZATCA Fatoora e-invoices. This library facilitates the creation of compliant e-invoices, QR Codes, and certificates, as well as the submission of e-invoices to ZATCA's servers. It provides developers with an easy-to-use, customizable, and robust toolkit to integrate and automate ZATCA e-invoicing processes in PHP applications.

193.3k1](/packages/sevaske-php-zatca-xml)[cleverit/ubl_invoice

A PHP wrapper for UBL invoices

36283.4k](/packages/cleverit-ubl-invoice)[josemmo/einvoicing

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

173279.6k2](/packages/josemmo-einvoicing)[atgp/factur-x

PHP library to manage your Factur-X / ZUGFeRD 2.0 PDF invoices files

138825.5k3](/packages/atgp-factur-x)[easybill/e-invoicing

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

12122.5k](/packages/easybill-e-invoicing)

PHPackages © 2026

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