PHPackages                             blafast-hq/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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. blafast-hq/ubl-invoice

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

blafast-hq/ubl-invoice
======================

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

016PHP

Since Dec 16Pushed 4mo agoCompare

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

READMEChangelogDependenciesVersions (1)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:^2.0@beta
```

#### 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 from package version 1.0 to 2.0
-----------------------------------------

[](#upgrading-from-package-version-10-to-20)

Version 2.0 of this package offers the ability to read UBL xml files and convert them into a `\NumNum\UBL\Invoice` or `\NumNum\UBL\CreditNote` + properties object structure.

To upgrade from 1.0, there are a few small, but breaking changes that need to be considered.

Please check the changelog!

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!

Examples &amp; documentation
----------------------------

[](#examples--documentation)

This repository does not have a documentation website at this moment. For now, please check out some code examples by checking the unit tests in the `tests` folder.

Changelog
---------

[](#changelog)

A changelog is available since version v1.9.0. If you are upgrading a minor version (1.x) or major version, please check the changelog to see if you need to implement any breaking changes...

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 77.6% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/552c4bb0698ccab7fcf23f4d47b16d33270118fb86b99ad2144c7a941087e91e?d=identicon)[SebastienDenooz](/maintainers/SebastienDenooz)

---

Top Contributors

[![brtdv](https://avatars.githubusercontent.com/u/932365?v=4)](https://github.com/brtdv "brtdv (294 commits)")[![TSimkus](https://avatars.githubusercontent.com/u/14792406?v=4)](https://github.com/TSimkus "TSimkus (15 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)")[![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)")[![mabjavaid](https://avatars.githubusercontent.com/u/62252347?v=4)](https://github.com/mabjavaid "mabjavaid (4 commits)")[![SebastienDenooz](https://avatars.githubusercontent.com/u/612884?v=4)](https://github.com/SebastienDenooz "SebastienDenooz (4 commits)")[![antal-levente](https://avatars.githubusercontent.com/u/63246047?v=4)](https://github.com/antal-levente "antal-levente (4 commits)")[![Stormyy](https://avatars.githubusercontent.com/u/5009558?v=4)](https://github.com/Stormyy "Stormyy (3 commits)")[![vsadrn](https://avatars.githubusercontent.com/u/141677995?v=4)](https://github.com/vsadrn "vsadrn (2 commits)")[![dietercoopman](https://avatars.githubusercontent.com/u/4672752?v=4)](https://github.com/dietercoopman "dietercoopman (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)")[![ronaldsgailis](https://avatars.githubusercontent.com/u/422543?v=4)](https://github.com/ronaldsgailis "ronaldsgailis (2 commits)")[![SanderVanKeer](https://avatars.githubusercontent.com/u/10955678?v=4)](https://github.com/SanderVanKeer "SanderVanKeer (2 commits)")[![stedekay](https://avatars.githubusercontent.com/u/1071560?v=4)](https://github.com/stedekay "stedekay (2 commits)")[![homer8173](https://avatars.githubusercontent.com/u/8720867?v=4)](https://github.com/homer8173 "homer8173 (1 commits)")

### Embed Badge

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

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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