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.
RegistroAnulacion is the cancellation record submitted to AEAT when a previously registered invoice must be voided. It identifies the original invoice by issuer NIF, series/number, and issue date, and optionally carries information about the party that generated the cancellation when it differs from the original issuer. Unlike RegistroAlta, this model takes a single flat array of data — no nested sub-model objects are required.
Construction
generadoPor and generador* fields:
Fields
Invoice identification
NIF of the issuer of the invoice being cancelled. Maps to API field
IDEmisorFactura. Must match the IDEmisorFactura of the original RegistroAlta.Series and number of the invoice being cancelled. Maps to API field
NumSerieFactura. Must match the NumSerieFactura of the original RegistroAlta.Issue date of the invoice being cancelled, in
YYYY-MM-DD format. Maps to API field FechaExpedicionFactura. Must match the original record.Optional free-text external reference for your own internal systems. Maps to API field
RefExterna.Special flags
Indicates that no prior AEAT registration exists for the invoice being cancelled, from lista L4. Both the integer ID and the string code are accepted. Maps to API field
SinRegistroPrevio.Prior rejection flag for the original registration, from lista L4. Both the integer ID and the string code are accepted. Maps to API field
RechazoPrevioA.Generator details
Identifies who generated this cancellation record, from lista L16. Both the integer ID and the string code are accepted. Maps to API field
GeneradoPor. Populate when the cancellation is generated by a third party or recipient rather than the issuer.Legal name of the party that generated this cancellation. Maps to API field
Generador_NombreRazon. Required when generadoPor is set.Spanish NIF of the party that generated this cancellation. Maps to API field
Generador_NIF. Use for Spanish generators.ISO 3166-1 alpha-2 country code of the foreign generator. Maps to API field
Generador_OtroCodPais. Use for non-Spanish generators.Foreign ID type of the generator, from lista L7. Both the integer ID and the string code are accepted. Maps to API field
Generador_OtroIDType.Foreign identification number of the generator. Maps to API field
Generador_OtroID.Getters and Setters
| Method | Description |
|---|---|
getIDEmisorFactura(): string | Returns the issuer NIF. |
setIDEmisorFactura(string $v): void | Sets the issuer NIF. |
getNumSerieFactura(): string | Returns the invoice series/number. |
setNumSerieFactura(string $v): void | Sets the invoice series/number. |
getFechaExpedicionFactura(): string | Returns the issue date. |
setFechaExpedicionFactura(string $v): void | Sets the issue date. |
getRefExterna(): string | Returns the external reference. |
setRefExterna(string $v): void | Sets the external reference. |
getSinRegistroPrevio(): int|string | Returns the no-prior-record flag (lista L4). |
setSinRegistroPrevio(int|string $v): void | Sets the no-prior-record flag (lista L4). |
getRechazoPrevioA(): int|string | Returns the prior rejection flag (lista L4). |
setRechazoPrevioA(int|string $v): void | Sets the prior rejection flag (lista L4). |
getGeneradoPor(): int|string | Returns the generator type (lista L16). |
setGeneradoPor(int|string $v): void | Sets the generator type (lista L16). |
getGeneradorNombreRazon(): string | Returns the generator’s legal name. |
setGeneradorNombreRazon(string $v): void | Sets the generator’s legal name. |
getGeneradorNIF(): string | Returns the generator’s NIF. |
setGeneradorNIF(string $v): void | Sets the generator’s NIF. |
getGeneradorOtroCodPais(): string | Returns the generator’s country code. |
setGeneradorOtroCodPais(string $v): void | Sets the generator’s country code. |
getGeneradorOtroIDType(): int|string | Returns the generator’s foreign ID type (lista L7). |
setGeneradorOtroIDType(int|string $v): void | Sets the generator’s foreign ID type (lista L7). |
getGeneradorOtroID(): string | Returns the generator’s foreign ID number. |
setGeneradorOtroID(string $v): void | Sets the generator’s foreign ID number. |
getArrayData()
getArrayData(): array returns an associative array containing only non-empty fields, ready to be submitted to the API.
PHP property names differ from the API field names used in the payload:
| PHP property | API field key |
|---|---|
IDEmisorFactura | IDEmisorFactura |
numSerieFactura | NumSerieFactura |
fechaExpedicionFactura | FechaExpedicionFactura |
refExterna | RefExterna |
sinRegistroPrevio | SinRegistroPrevio |
rechazoPrevioA | RechazoPrevioA |
generadoPor | GeneradoPor |
generadorNombreRazon | Generador_NombreRazon |
generadorNIF | Generador_NIF |
generadorOtroCodPais | Generador_OtroCodPais |
generadorOtroIDType | Generador_OtroIDType |
generadorOtroID | Generador_OtroID |
empty()
RegistroAnulacion::empty(): RegistroAnulacion returns a RegistroAnulacion with all string fields set to '' and all integer/flag fields set to 0. Use it as a placeholder or for testing purposes.

