Skip to main content

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.

Verifactu-PHP is an open-source PHP library that covers the complete lifecycle of billing records required by Spain’s VERI*FACTU regulation (RD 1007/2023). From building chained RegistrationRecord and CancellationRecord objects with correct SHA-256 hashes, to validating them against AEAT rules and submitting them via SOAP with an mTLS certificate — the library handles all the low-level complexity so you can focus on your invoicing logic.

Quickstart

Send your first billing record to the AEAT in minutes

Installation

PHP requirements, Composer setup, and dependencies

VERI*FACTU Overview

Understand the regulation and the two compliance modes

API Reference

Full reference for every class, method, and enum

Core capabilities

Registration Records

Create RegistrationRecord objects with invoice details, tax breakdown, and chained hashes

Cancellation Records

Annul previously submitted records using CancellationRecord

AEAT Communication

Submit records via the AEAT SOAP endpoint with mTLS certificate authentication

Model Validation

Validate any model against AEAT rules before submission

QR Code URLs

Generate AEAT verification URLs to print on invoices

XML Import / Export

Round-trip serialization: export records to XML or import them back

Get started

1

Install via Composer

composer require josemmo/verifactu-php
Requires PHP 8.2+ and the libxml extension.
2

Build a registration record

Create a RegistrationRecord, populate the invoice header and tax breakdown, then call calculateHash() to produce the chained SHA-256 fingerprint.
3

Configure the AEAT client

Instantiate AeatClient with your ComputerSystem and taxpayer FiscalIdentifier, point it at your PFX/PEM certificate, and switch to the pre-production endpoint for testing.
4

Submit and process the response

Call send([$record])->wait() and inspect the returned AeatResponse. Check $response->status and read the CSV code or error description from $response->items.
Verifactu-PHP is a tool for building Sistemas Informáticos de Facturación (SIFs). It does not ship with a self-certification declaration. As the SIF developer, you are responsible for auditing the library and issuing your own responsible declaration. See Certification for details.

Build docs developers (and LLMs) love