verifactuPHP is an open-source PHP library built by Invocash that wraps the VeriFactuAPI — Spain’s electronic invoicing platform — into a clean, object-oriented interface. It handles token authentication automatically and provides factory methods and model classes for every resource you need to register, submit, and cancel electronic invoices in compliance with Spain’s new fiscal regulations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/NemonInvocash/verifactu-php/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Authenticate, register an issuer, and submit your first invoice in minutes.
Installation
Install via Composer using either the VCS repository method or git clone.
API Reference
Complete reference for every method on
ClienteVerifactu and all models.Guides
Step-by-step guides for managing emisores, invoices, cancellations, and webhooks.
What is VeriFactu?
VeriFactu is Spain’s mandatory electronic invoicing system operated by the AEAT (Agencia Estatal de Administración Tributaria). Under Spain’s new electronic invoicing legislation, billing software must be able to validate and submit electronic invoices through VeriFactu. verifactuPHP makes this requirement straightforward to fulfil in any PHP application.You need a VeriFactuAPI account to use this library. Register at verifactuapi.es to obtain your API credentials.
Key Capabilities
Token Authentication
Automatically logs in with your email and password on construction and stores the Bearer token for all subsequent requests.
Invoice Registration
Build and submit
RegistroAlta records for standard, simplified, and rectified invoices directly to AEAT.Invoice Cancellation
Cancel invoice records using
bajaRegistro (by ID) or a full RegistroAnulacion object.Webhook Support
Register webhooks to receive real-time POST notifications when invoice records are processed.
Full VAT/IGIC Breakdown
Model detailed tax breakdowns with
Desglose, supporting IVA, IGIC, tax regimes, exempt operations, and surcharges.PHP 7.4 & 8.x
Compatible with PHP 7.4 and all PHP 8.x versions. Uses Guzzle for HTTP transport.
Quick Example
quickstart.php
Library Structure
| Component | Description |
|---|---|
ClienteVerifactu | Main client class — authentication, factories, API calls |
Emisor | Invoice issuer model |
Destinatario | Invoice recipient model |
Desglose | Tax breakdown model |
Tercero | Third-party issuer model |
RegistroAlta | Invoice registration record |
RegistroAnulacion | Invoice cancellation record |
FacturaRectificada | Reference to a corrected invoice |
FacturaSustituida | Reference to a substituted invoice |

