VERIFACTU is a Spanish tax regulation established by Royal Decree RD 1007/2023 that mandates the use of certified billing software (a Sistema Informático de Facturación, or SIF) to record summarized information about every invoice issued. Rather than replacing the invoice itself, VERIFACTU creates a tamper-proof chain of billing records whose goal is, in the law’s own words, to “guarantee the integrity, conservation, accessibility, readability, traceability, and unalterability” of those records. By chaining each record to the previous one via a SHA-256 hash, the regulation makes retroactive manipulation of billing history detectable — directly targeting VAT fraud through off-the-books accounting.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/josemmo/Verifactu-PHP/llms.txt
Use this file to discover all available pages before exploring further.
Who is affected
The obligation to comply with VERI*FACTU applies to all individuals and legal entities that are subject to any of the following Spanish tax regimes and have their fiscal domicile under Spain’s common fiscal regime (régimen común):- IRPF (personal income tax) arising from economic activity
- Impuesto de Sociedades (corporate income tax)
- IRNR (non-resident income tax) through a permanent establishment in Spain
- Businesses already enrolled in SII (Suministro Inmediato de Información), which submit invoice data to the AEAT daily through a separate mechanism.
- Operations that do not legally require an invoice, or that operate under special billing authorizations granted by the tax authority.
If your business already files through the SII system, you are not required to implement VERI*FACTU. Check with your tax advisor if you are unsure which regime applies to you.
Two compliance modes
Businesses that must comply with VERI*FACTU can choose between two valid implementation modes. Both require the SIF to maintain a hash-chained record log, but they differ in whether records are proactively sent to the AEAT.- VERI*FACTU mode
- Non-VERI*FACTU mode
In VERI*FACTU mode, the SIF must transmit each registration record to the AEAT’s Electronic Headquarters immediately after the invoice is issued. Sending is automatic and near-real-time — the AEAT receives a copy of every billing record as it is created.Key characteristics:
- Each
RegistrationRecordis submitted to the AEAT right after issuance. - The AEAT acknowledges receipt and returns a status response.
- Records must still be hash-chained before submission.
- No electronic signature of individual records is required beyond the AEAT web service authentication.
What a billing record contains
A VERI*FACTU billing record is not a full electronic invoice. It is a lightweight, structured summary that contains just enough information for the AEAT to verify the integrity of the billing chain. A typical registration record includes:| Field | Description |
|---|---|
| Invoice identifier | Issuer NIF, invoice series/number, and issue date |
| Issuer name | Legal name or trading name of the invoice issuer |
| Invoice type | Classification code (e.g., standard, simplified, corrective) |
| Tax breakdown | For each applicable tax: taxable base amount, tax rate, and tax amount |
| Totals | Total tax amount (CuotaTotal) and total invoice amount (ImporteTotal) |
| Previous record hash | First 64 hex characters of the SHA-256 hash of the preceding record |
| Own hash | SHA-256 hash of this record’s key fields, linking it into the chain |
| Generation timestamp | Date, time, and timezone offset when the record was created (FechaHoraHusoGenRegistro) |
How this library fits in
Verifactu-PHP is a PHP 8.2+ library that handles the low-level mechanics of VERI*FACTU compliance:Record creation
Provides typed model classes (
RegistrationRecord, CancellationRecord, BreakdownDetails, …) so you can construct billing records with IDE autocompletion and type safety.Hash chaining
Implements the exact SHA-256 payload format required by the AEAT spec. Call
calculateHash() and the library computes the correct chain hash for you.Validation
Every model exposes a
validate() method backed by Symfony Validator. Catch InvalidModelException before submitting to the AEAT to surface any constraint violations early.AEAT submission
Serialises records to the AEAT-specified XML schema and handles the web service communication, returning a parsed
AeatResponse object.Verifactu-PHP is not itself a certified SIF. Developers who build a SIF on top of this library are responsible for completing the AEAT’s self-certification process for their own software product, ensuring it meets all technical and operational requirements of RD 1007/2023.