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.

The Emisor model represents the legal entity that issues invoices in the VeriFactu system. Every RegistroAlta and RegistroAnulacion is linked to an Emisor, which supplies the issuer’s NIF and legal name automatically. You can construct an Emisor directly or retrieve a pre-configured one through the ClienteVerifactu factory.

Construction

Pass a keyed array of property names to the constructor, or use the ClienteVerifactu factory method when working within the full client context:
use verifactuPHP\Models\Emisor;

$emisor = new Emisor([
    'nif'                      => 'B12345678',
    'nombre'                   => 'Mi Empresa S.L.',
    'representanteRazonSocial' => 'Juan García López',
    'representanteNif'         => '12345678A',
    'webhookID'                => 42,
    'enviarAeat'               => true,
    'enviarAeatPaused'         => false,
]);
nif and nombre are the two fields consumed by RegistroAlta to populate IDEmisorFactura and NombreRazonEmisor automatically. Always supply them when the Emisor will be attached to an invoice record.

Fields

nif
string
required
Tax identification number (NIF) of the issuing entity. Maps to API field nif. This value is automatically copied into the IDEmisorFactura field of every RegistroAlta that references this Emisor.
nombre
string
required
Legal company name or business name (razón social) of the issuer. Maps to API field nombre. Automatically propagated to NombreRazonEmisor in RegistroAlta.
representanteRazonSocial
string
Legal name of the issuer’s authorised representative. Maps to API field representante_razon_social. Only required when the invoice is signed by a representative rather than the issuer directly.
representanteNif
string
NIF of the issuer’s authorised representative. Maps to API field representante_nif.
webhookID
int
Default webhook ID used for AEAT submission notifications. Maps to API field default_webhook_id. This value is used as the fallback webhook_id in any RegistroAlta that does not specify its own webhook.
enviarAeat
bool
Whether invoices belonging to this issuer should be submitted to AEAT automatically. Maps to API field enviar_aeat. Defaults to false when omitted.
enviarAeatPaused
bool
Whether automatic AEAT submission is currently paused for this issuer. Maps to API field enviar_aeat_paused. Defaults to false when omitted.

Getters and Setters

Each field exposes a matching getter and setter:
MethodDescription
getNif(): stringReturns the issuer’s NIF.
setNif(string $v): voidSets the issuer’s NIF.
getNombre(): stringReturns the legal company name.
setNombre(string $v): voidSets the legal company name.
getRepresentanteRazonSocial(): stringReturns the representative’s legal name.
setRepresentanteRazonSocial(string $v): voidSets the representative’s legal name.
getRepresentanteNif(): stringReturns the representative’s NIF.
setRepresentanteNif(string $v): voidSets the representative’s NIF.
getWebhookID(): intReturns the default webhook ID.
setWebhookID(int $v): voidSets the default webhook ID.
getEnviarAeat(): boolReturns the AEAT auto-submission flag.
setEnviarAeat(bool $v): voidSets the AEAT auto-submission flag.
getEnviarAeatPaused(): boolReturns the AEAT paused flag.
setEnviarAeatPaused(bool $v): voidSets the AEAT paused flag.

getArrayData()

getArrayData(): array serialises the model into the API-ready format. Only fields that are non-empty (non-empty string, non-zero integer, or true boolean) are included in the output — omitted fields are not sent to the API. PHP property names differ from the API field names used in the payload:
PHP propertyAPI field key
nifnif
nombrenombre
representanteRazonSocialrepresentante_razon_social
representanteNifrepresentante_nif
webhookIDdefault_webhook_id
enviarAeatenviar_aeat
enviarAeatPausedenviar_aeat_paused
$payload = $emisor->getArrayData();
// Example output:
// [
//     'nif'    => 'B12345678',
//     'nombre' => 'Mi Empresa S.L.',
//     'enviar_aeat' => true,
// ]

empty()

Emisor::empty(): Emisor is a static factory that returns an Emisor instance with all fields set to their zero values ('', 0, false). It is used internally by RegistroAlta::empty() and RegistroAnulacion::empty() as a safe placeholder when no real issuer is required.
$placeholder = Emisor::empty();
Use Emisor::empty() in unit tests or as a default value when constructing other model stubs, rather than passing null or an uninitialised array.

Build docs developers (and LLMs) love