Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Eseperio/verifactu-php/llms.txt

Use this file to discover all available pages before exploring further.

Verifactu PHP is a modern, object-oriented PHP 8.1+ library for integrating with Spain’s AEAT Verifactu digital invoicing system. It covers the full compliance workflow — invoice registration (Alta), cancellation (Anulación), querying, SHA-256 hash chaining, XAdES XML signing, and QR code generation — all mapped directly to the official AEAT XSD schemas.
The VERI*FACTU obligation has been delayed to 2027 for companies and 1 July 2027 for self-employed individuals. This library is provided without warranties; it is the integrator’s responsibility to verify correct operation and legal compliance.

Installation

Install via Composer and set up your PHP project in minutes

Quickstart

Submit your first invoice to AEAT in a few lines of PHP

Core Concepts

Understand the Verifactu regulation, workflow, and key components

API Reference

Explore every class, method, and enum in the public API

What this library does

Verifactu PHP handles all the technical heavy lifting required by the AEAT regulation:

Invoice Registration

Submit new invoices (Alta) to AEAT via a signed SOAP request

Invoice Cancellation

Cancel previously registered invoices (Anulación) with full hash chaining

Invoice Querying

Query submitted invoices from AEAT with flexible filters and pagination

QR Code Generation

Generate AEAT-compliant QR codes in PNG, Imagick, or SVG format

Hash Chaining

SHA-256 huella calculation following the official AEAT field ordering

XML Signing

XAdES Enveloped digital signatures using your PFX/P12 certificate

Get started in three steps

1

Install the library

composer require eseperio/verifactu-php
2

Configure with your certificate

use eseperio\verifactu\Verifactu;

Verifactu::config(
    '/path/to/certificate.pfx',
    'your-password',
    Verifactu::TYPE_CERTIFICATE,
    Verifactu::ENVIRONMENT_SANDBOX
);
3

Submit your first invoice

$response = Verifactu::registerInvoice($invoice);

if ($response->submissionStatus === InvoiceResponse::STATUS_OK) {
    echo "AEAT CSV: " . $response->csv;
}
See the Quickstart for the full working example.

Build docs developers (and LLMs) love