Skip to main content

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.

In Spain’s VeriFactu system, an emisor (issuer) is the company or individual legally registered to issue electronic invoices that must be reported to the AEAT tax authority. Before you can submit any invoice records, you must construct an Emisor object in verifactuPHP and register it with VeriFactuAPI using altaEmisor. Once registered, the emisor’s NIF is automatically attached to every invoice record it generates.

Create an Emisor Object

Use nuevoEmisor() on your ClienteVerifactu instance to build an Emisor object from an associative array. The method validates and stores your data locally — nothing is sent to the API yet.
nif
string
required
Tax identification number (NIF) of the issuer. Must be a valid Spanish NIF.
nombre
string
required
Legal name (razón social) of the issuer.
representanteRazonSocial
string
Legal name of the issuer’s representative, if applicable.
representanteNif
string
NIF of the issuer’s representative, if applicable.
webhookID
integer
Default webhook ID to associate with this emisor. Invoice records created under this emisor will use this webhook unless overridden. See Webhooks for how to obtain a webhook ID.
enviarAeat
boolean
When true, invoice records for this emisor are automatically submitted to AEAT. Defaults to false.
enviarAeatPaused
boolean
When true, AEAT submissions for this emisor are paused even if enviarAeat is enabled. Defaults to false.
$emisor = $client->nuevoEmisor([
    'nif'                     => 'A39200019',
    'nombre'                  => 'Mi Empresa S.L.',
    'enviarAeat'              => true,
    'enviarAeatPaused'        => false,
    'webhookID'               => 10,
]);
Fields you omit are treated as empty and are excluded from the API payload. Only nif and nombre are required for registration.

Register the Emisor with VeriFactuAPI

Once you have an Emisor object, call altaEmisor() to POST it to the /api/emisor endpoint and create the record in VeriFactuAPI:
$client->altaEmisor($emisor);
The NIF provided must be a valid Spanish tax identification number. VeriFactuAPI will reject registration requests that contain an invalid NIF.

Retrieve Registered Emisores

Use listarEmisores() to fetch emisores previously registered under your VeriFactuAPI account. Call it without arguments to retrieve all emisores, or pass an integer ID to fetch a single record:
// Retrieve all registered emisores
$allEmisores = $client->listarEmisores();

// Retrieve a specific emisor by its API ID
$oneEmisor = $client->listarEmisores(1);
Both calls return the full API response array. The registered emisores appear under data.items in the response.
Enable debug mode with $client->setDebug(true) before calling altaEmisor() or listarEmisores() to print the full request and response to the console. This is useful for confirming that the emisor was created and inspecting the returned data structure.

Build docs developers (and LLMs) love