PHPackages                             josemmo/facturae-php - 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. josemmo/facturae-php

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

josemmo/facturae-php
====================

Librería para la generación, firma y envío de facturas electrónicas

v1.8.4(8mo ago)285648.1k↓20%115[1 issues](https://github.com/josemmo/Facturae-PHP/issues)1MITPHPPHP &gt;=5.6

Since Sep 9Pushed 1w ago27 watchersCompare

[ Source](https://github.com/josemmo/Facturae-PHP)[ Packagist](https://packagist.org/packages/josemmo/facturae-php)[ Docs](https://github.com/josemmo/Facturae-PHP)[ GitHub Sponsors](https://github.com/josemmo)[ RSS](/packages/josemmo-facturae-php/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (1)Versions (41)Used By (1)

Facturae-PHP
============

[](#facturae-php)

[![CI](https://github.com/josemmo/Facturae-PHP/workflows/Tests/badge.svg)](https://github.com/josemmo/Facturae-PHP/actions)[![Codacy Badge](https://camo.githubusercontent.com/4623f89b58ac4467b3545a4ca6360c4c7991a42a8d8539e7a94e5799f7ac45ba/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3763343564356562646639613465383862306665366230653132643732306231)](https://www.codacy.com/gh/josemmo/Facturae-PHP)[![Coverage](https://camo.githubusercontent.com/4467a85b67444201349e7f49561908a414ce1d6b64040aa76611cb8b82a4497d/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3763343564356562646639613465383862306665366230653132643732306231)](https://www.codacy.com/gh/josemmo/Facturae-PHP)[![Última versión estable](https://camo.githubusercontent.com/e61c8aed802852d3bbc5c575f2a3e841a1d37f5530f258ecf27160f50d82136e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f73656d6d6f2f66616374757261652d706870)](https://packagist.org/packages/josemmo/facturae-php)[![Versión de PHP](https://camo.githubusercontent.com/3192874d97d805a8a817f9eac68b545fb08d9b295cb34531bc9ec172d002b106/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344352e36253230253743253743253230253345253344372e30253230253743253743253230253345253344382e302d383839324246)](composer.json)[![Documentación](https://camo.githubusercontent.com/c504b03100248d94785837215ba7cbe69e3ca7d1b9ddc0047ab147b6adac7ff1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6f6e6c696e652d626c75652e7376673f6c6f6e6743616368653d74727565)](https://josemmo.github.io/Facturae-PHP/)

Facturae-PHP es un paquete escrito puramente en PHP que permite generar facturas electrónicas siguiendo el formato estructurado [Facturae](http://www.facturae.gob.es/), **añadirlas firma electrónica** XAdES y sellado de tiempo, e incluso **enviarlas a FACe o FACeB2B** sin necesidad de ninguna librería o clase adicional.

Note

Esta librería **no** genera registros de facturación de VERI\*FACTU. Para ello, consulta [Verifactu-PHP](https://github.com/josemmo/Verifactu-PHP).

En apenas 25 líneas de código y con un tiempo de ejecución inferior a 0,4 µs es posible generar, firmar y exportar una factura electrónica totalmente válida:

```
$fac = new Facturae();
$fac->setNumber('FAC201804', '123');
$fac->setIssueDate('2018-04-01');

$fac->setSeller(new FacturaeParty([
  "taxNumber" => "A00000000",
  "name"      => "Perico de los Palotes S.A.",
  "address"   => "C/ Falsa, 123",
  "postCode"  => "12345",
  "town"      => "Madrid",
  "province"  => "Madrid"
]));
$fac->setBuyer(new FacturaeParty([
  "isLegalEntity" => false,
  "taxNumber"     => "00000000A",
  "name"          => "Antonio",
  "firstSurname"  => "García",
  "lastSurname"   => "Pérez",
  "address"       => "Avda. Mayor, 7",
  "postCode"      => "54321",
  "town"          => "Madrid",
  "province"      => "Madrid"
]));

$fac->addItem("Lámpara de pie", 20.14, 3, Facturae::TAX_IVA, 21);

$fac->sign("certificado.pfx", null, "passphrase");
$fac->export("mi-factura.xsig");
```

También permite firmar facturas que hayan sido generadas con otro programa:

```
$signer = new FacturaeSigner();
$signer->loadPkcs12("certificado.pfx", "passphrase");

$xml = file_get_contents(__DIR__ . "/factura.xml");
$signedXml = $signer->sign($xml);
file_put_contents(__DIR__ . "/factura.xsig", $signedXml);
```

Requisitos
----------

[](#requisitos)

- PHP 5.6 o superior
- OpenSSL (solo para firmar facturas)
- cURL (solo para *timestamping* y FACe / FACeB2B)
- libXML (solo para FACe y FACeB2B)

Características
---------------

[](#características)

- Generación de facturas 100% conformes con la [Ley 25/2013 del 27 de diciembre](https://www.boe.es/diario_boe/txt.php?id=BOE-A-2013-13722)
- Exportación según las versiones de formato [3.2, 3.2.1 y 3.2.2](http://www.facturae.gob.es/formato/Paginas/version-3-2.aspx) de Facturae
- Firmado de acuerdo a la [política de firma de Facturae 3.1](http://www.facturae.gob.es/formato/Paginas/politicas-firma-electronica.aspx) basada en XAdES
- Sellado de tiempo según el [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- Envío automatizado de facturas a **FACe y FACeB2B** 🔥

Usan Facturae-PHP
-----------------

[](#usan-facturae-php)

Estas son algunas de las organizaciones y soluciones software que usan Facturae-PHP o mantienen un fork interno basado en el código de la librería:

[![Holded](https://camo.githubusercontent.com/0b921fd60348335c3f5c1250bec401c554df08f45438ef7e84545db4c74d8b7d/68747470733a2f2f692e696d6775722e636f6d2f7a7164517350412e706e67)](https://www.holded.com/)[![hotelgest](https://camo.githubusercontent.com/633c818e448769566141743070cd7d95af0d5e5f2d29571c46c9823eb537143e/68747470733a2f2f692e696d6775722e636f6d2f6879754b414f742e706e67)](https://hotelgest.com/)[![InvoiceNinja](https://camo.githubusercontent.com/53f99511201ca18054756686b79f6db54d85b6bbd3b0245048463129a28ba377/68747470733a2f2f692e696d6775722e636f6d2f795372794155412e706e67)](https://invoiceninja.com/)[![FacturaScripts](https://camo.githubusercontent.com/cb442c39c9f379ed5212bd591612a7db39e2ce2bb8da3d459432d9c593123c2d/68747470733a2f2f692e696d6775722e636f6d2f55506e555643442e706e67)](https://facturascripts.com/)

Licencia
--------

[](#licencia)

Facturae-PHP se encuentra bajo [licencia MIT](LICENSE). Eso implica que puedes utilizar este paquete en cualquier proyecto (incluso con fines comerciales), siempre y cuando hagas referencia al uso y autoría de la misma.

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance80

Actively maintained with recent releases

Popularity59

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 93.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 ~78 days

Recently: every ~140 days

Total

39

Last Release

268d 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 (319 commits)")[![alphp](https://avatars.githubusercontent.com/u/8992091?v=4)](https://github.com/alphp "alphp (5 commits)")[![KaiserVito](https://avatars.githubusercontent.com/u/7655604?v=4)](https://github.com/KaiserVito "KaiserVito (5 commits)")[![txusms](https://avatars.githubusercontent.com/u/804715?v=4)](https://github.com/txusms "txusms (3 commits)")[![PhoneixS](https://avatars.githubusercontent.com/u/1279539?v=4)](https://github.com/PhoneixS "PhoneixS (2 commits)")[![ct2glx](https://avatars.githubusercontent.com/u/4106464?v=4)](https://github.com/ct2glx "ct2glx (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![smagret](https://avatars.githubusercontent.com/u/82170493?v=4)](https://github.com/smagret "smagret (1 commits)")[![FabioIYT](https://avatars.githubusercontent.com/u/37196600?v=4)](https://github.com/FabioIYT "FabioIYT (1 commits)")[![duhow](https://avatars.githubusercontent.com/u/1145001?v=4)](https://github.com/duhow "duhow (1 commits)")[![franbarro](https://avatars.githubusercontent.com/u/67473576?v=4)](https://github.com/franbarro "franbarro (1 commits)")

---

Tags

e-invoicefacefaceb2bfactura-electronicafacturaexadesfacefacturaexadesfaceb2b

### Embed Badge

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

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

###  Alternatives

[rodenastyle/stream-parser

PHP Multiformat Streaming Parser

442206.4k2](/packages/rodenastyle-stream-parser)[cybermonde/odtphp

ODT document generator

49123.4k1](/packages/cybermonde-odtphp)[akeneo-labs/excel-connector-bundle

Akeneo PIM Excel connector bundle

166.4k](/packages/akeneo-labs-excel-connector-bundle)[ambersive/documentviewer

Laravel package to create beautiful printable documents. We recommend the use with the ambersive/pdfprinter package to create documents.

142.6k](/packages/ambersive-documentviewer)

PHPackages © 2026

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