You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/php-facturae/php-facturae)
Genera, firma y exporta facturas electrónicas en formato [FacturaE](http://www.facturae.gob.es/) con una API fluent y type-safe.
10
+
Librería PHP moderna para generar, firmar y exportar **facturas electrónicas** en formato [FacturaE](http://www.facturae.gob.es/) (3.2, 3.2.1, 3.2.2) con firma **XAdES-EPES** — sin dependencias externas.
11
+
12
+
> La alternativa moderna a [Facturae-PHP](https://github.com/josemmo/Facturae-PHP): API fluent con named arguments, enums nativos de PHP 8.2+, tipado estricto y PHPStan nivel 8.
8
13
9
14
```php
15
+
use PhpFacturae\Invoice;
16
+
use PhpFacturae\Party;
17
+
use PhpFacturae\Signer;
18
+
10
19
Invoice::create('FAC-001')
11
20
->series('A')
12
21
->date('2025-03-01')
13
-
->seller(Party::company('B12345678', 'Mi Empresa S.L.')->address('C/ Mayor 10', '28013', 'Madrid', 'Madrid'))
14
-
->buyer(Party::person('12345678Z', 'Laura', 'Gómez', 'Ruiz')->address('C/ Sol 3', '28012', 'Madrid', 'Madrid'))
22
+
->seller(Party::company('B12345674', 'Mi Empresa S.L.')
23
+
->address('C/ Mayor 10', '28013', 'Madrid', 'Madrid'))
->schema(Schema::V3_2_2) // Versión XSD (default 3.2.2)
154
-
->operationDate('2025-02-28') // Fecha operación
174
+
->schema(Schema::V3_2_2) // Versión XSD (por defecto 3.2.2)
175
+
->operationDate('2025-02-28') // Fecha operación (devengo)
155
176
->billingPeriod(from: '2025-02-01', to: '2025-02-28') // Periodo facturación
177
+
->legalLiteral('Factura exenta de IVA por aplicación del REF Canario.')
156
178
```
157
179
158
-
## Validación
159
-
160
-
Los XMLs se validan contra el [XSD oficial 3.2.2](http://www.facturae.gob.es/formato/Paginas/version-3-2.aspx) y en el [validador de FACe](https://face.gob.es/es/facturas/validar-visualizar-factura):
Rex nace como alternativa moderna a [Facturae-PHP](https://github.com/josemmo/Facturae-PHP) de josemmo, referencia durante años para la facturación electrónica en PHP. Si buscas una solución madura y probada en producción, su librería es una apuesta segura.
Copy file name to clipboardExpand all lines: composer.json
+24-4Lines changed: 24 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,53 @@
1
1
{
2
2
"name": "php-facturae/php-facturae",
3
-
"description": "Generate, validate and sign FacturaE (3.2.x) electronic invoices in PHP — the modern alternative for Spanish e-invoicing",
3
+
"description": "Generate, sign and export FacturaE electronic invoices in PHP 8.2+ — fluent API, XAdES-EPES signing, zero dependencies. Genera y firma facturas electrónicas.",
0 commit comments