PHPackages                             flexible-ux/verifactu-bundle - 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. [API Development](/categories/api)
4. /
5. flexible-ux/verifactu-bundle

ActiveSymfony-bundle[API Development](/categories/api)

flexible-ux/verifactu-bundle
============================

Symfony bundle to deal with Veri\*Factu Spanish digital invoicing law and legal QR code generation

v0.1.6(6mo ago)44MITPHPPHP &gt;=8.2CI passing

Since Dec 20Pushed 6mo agoCompare

[ Source](https://github.com/Flexible-User-Experience/verifactu-bundle)[ Packagist](https://packagist.org/packages/flexible-ux/verifactu-bundle)[ Docs](https://github.com/Flexible-User-Experience/verifactu-bundle)[ RSS](/packages/flexible-ux-verifactu-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (13)Versions (9)Used By (0)

VerifactuBundle
===============

[](#verifactubundle)

VerifactuBundle is a Symfony bundle to deal with Veri\*Factu Spanish digital invoicing law. This bundle relies on `josemmo/verifactu-php` library to send your invoices to the AEAT[1](#user-content-fn-aeat-a41be4abbd4a25f67959c50b2f1b08e8) Veri\*Factu API.

This bundle also can generate legal QR validation codes as PNG image to include into your printed invoices.

Disclaimer
----------

[](#disclaimer)

This Symfony bundle is provided without a responsible declaration, as it is **not** an Invoicing Computer System ("Sistema Informático de Facturación" or "SIF"[2](#user-content-fn-sif-a41be4abbd4a25f67959c50b2f1b08e8) as known reference in Spain's law).

This is a third-party tool to integrate your SIF[2](#user-content-fn-sif-a41be4abbd4a25f67959c50b2f1b08e8) with the Veri\*Factu API to comply with the Spanish state government's anti-fraud law. It is **your responsibility** to audit its code and use it in accordance with the applicable regulations.

For more information, see [Artículo 13 del RD 1007/2023](https://www.boe.es/buscar/act.php?id=BOE-A-2023-24840#a1-5).

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

[](#installation)

VerifactuBundle requires PHP 8.2 or higher and Symfony 6.4 or higher. Run the following command to install it in your application:

```
composer require flexible-ux/verifactu-bundle
```

### Configure the bundle in your `config/packages/flux_verifactu.yaml` file:

[](#configure-the-bundle-in-your-configpackagesflux_verifactuyaml-file)

```
flux_verifactu:
    aeat_client:
        is_prod_environment: false # only set to true to make real AEAT API calls, be careful here
        pfx_certificate_filepath: '%your_pfx_certificate_filepath%'
        pfx_certificate_password: '%pfx_certificate_password%'
    # SIF (developer) credentials
    computer_system:
        vendor_name: '%your_vendor_name%'
        vendor_nif: '%your_vendor_nif%' # 9 digits (Spanish NIF or CIF)
        name: '%your_name%'
        id: 'ID' # only 2 letters
        version: '%your_version%'
        installation_number: '%your_installation_number%'
        only_supports_verifactu: false # depending on your Invoicing Computer System or ERP
        supports_multiple_taxpayers: false # for now this bundle only supports a single taxpayer, keep it to false
        has_multiple_taxpayers: false # for now this bundle only has a single taxpayer, keep it to false
    # Taxpayer (enterprise who emit the legal invoices) credentials
    fiscal_identifier:
        name: '%your_name%'
        nif: '%your_nif%' # 9 digits (Spanish NIF or CIF)
```

Usage
-----

[](#usage)

### `AeatClientHandler` and `QrCodeHandler` Services

[](#aeatclienthandler-and-qrcodehandler-services)

You can inject the `AeatClientHandler` service in your app. Make `sendRegistrationRecord` method calls to send registration records to AEAT API. Your `Invoice` model (or entity) must implement `Flux\VerifactuBundle\Contract\RegistrationRecordInterface`.

For now, you must generate the QR code image at same time, so inject `QrCodeHandler` service too.

```
use Flux\VerifactuBundle\Handler\AeatClientHandler;
use Flux\VerifactuBundle\Handler\QrCodeHandler;
use josemmo\Verifactu\Models\Responses\ResponseStatus;

class AppTestController
{
    public function test(Invoice $invoice, InvoiceManager $invoiceManager, AeatClientHandler $aeatClientHandler, QrCodeHandler $qrCodeHandler)
    {
        $registrationRecord = $invoiceManager->transformInvoiceToRegistrationRecordInterface($invoice, $invoice->getPreviousInvoice());
        // is up to you to create an `InvoiceManager` (or whatever) to transform your Invoice model into a data value object that implements the `RegistrationRecordInterface` contract.
        // to keep traceability you must include a reference to the previous registered invoice, only can be null for the very first invoice.
        $result = $aeatClientHandler->sendRegistrationRecord($registrationRecord);
        // $result is an `AeatResponseInterface` contract, you must check the response status received and manage it accordingly.
        // you must decide what to do with the response status, and check $result->getStatus() against ResponseStatus::Correct, ResponseStatus::PartiallyCorrect or ResponseStatus::Incorrect possible values
        // you must read Veri*Factu documentation to handle Invoice integrity and traceability, this is out of the scope of this bundle!
        $aeatJsonArrayResponse = $aeatClientHandler->getJsonArrayFromAeatResponseDto($result);
        // we recommend you to always store the result array or a JSON serialized version into your Invoice entity
        $invoice->setAeatJsonResponse($aeatJsonArrayResponse);
        // if $result->getStatus() is equals to ResponseStatus::Correct or ResponseStatus::PartiallyCorrect you must persist the `hash` and `hashedAt` values into your Invoice because it is mandatory to attach with the previous invoice traceability information and to keep the current Invoice integrity.
        // this values has been updated into the `$registrationRecord` object during the `sendRegistrationRecord` method call.
        $invoice
            ->setAeatHash($registrationRecord->getHash())
            ->setAeatHashedAt($registrationRecord->getHashedAt())
        ;
        $this->invoiceRepository->update(true);
        // store the changes into your Invoice entity.
        $qrCodePngImage = $qrCodeHandler->buildQrCodeAsPngImageFromRegistrationRecordAndAeatResponseInterfaces($registrationRecord, $result);
        // finally you can get a legal QR code as a PNG image, but keep in mind that for now must be generated at the same moment with successfully responses.
        $qrCodePngImage->saveToFile(sprintf('%s/var/qr_invoice_id_%s.png', $this->assetsManager->getProjectRootDir(), $invoice->getId()));
        // save QR PNG image to disk.
        // read `endroid/qr-code` documentation to handle the image file.
    }
}
```

Code Style
----------

[](#code-style)

```
php ./vendor/bin/php-cs-fixer fix src/
```

Code Analysis
-------------

[](#code-analysis)

```
php ./vendor/bin/phpstan analyse
```

Testing
-------

[](#testing)

```
php ./vendor/bin/phpunit tests/
```

---

Footnotes
---------

1. **AEAT** — *Agencia Estatal de Administración Tributaria*.
    Agency of the Government of Spain. [↩](#user-content-fnref-aeat-a41be4abbd4a25f67959c50b2f1b08e8)
2. **SIF** — *Sistema Informático de Facturación*.
    Certified invoicing software compliant with Spanish tax regulations. [↩](#user-content-fnref-sif-a41be4abbd4a25f67959c50b2f1b08e8) [↩2](#user-content-fnref-sif-2-a41be4abbd4a25f67959c50b2f1b08e8)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance69

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

8

Last Release

183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e96d5cf1c3fe5912ca44c4de5b39a34a40b94bd9c23c3993e8b7c19737e68c3?d=identicon)[davidromani](/maintainers/davidromani)

---

Top Contributors

[![davidromani](https://avatars.githubusercontent.com/u/698779?v=4)](https://github.com/davidromani "davidromani (214 commits)")

---

Tags

qrsymfonybundlesiiverifactuaeat

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/flexible-ux-verifactu-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/flexible-ux-verifactu-bundle/health.svg)](https://phpackages.com/packages/flexible-ux-verifactu-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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