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.
FacturaSustituida is a lightweight reference model that identifies the original invoice being fully substituted by a new one. It is used alongside FacturaRectificada in scenarios where tipoRectificativa (lista L3) is set to the substitution method: rather than recording a difference amount, the correcting RegistroAlta replaces the original invoice entirely. Pass a populated FacturaSustituida instance in the RegistroAlta objects array under the key facturaSustituida when the rectification method is substitution.
Construction
RegistroAlta that uses the substitution rectification method:
The three fields in
FacturaSustituida must exactly match the IDEmisorFactura, NumSerieFactura, and FechaExpedicionFactura of the original RegistroAlta as stored in AEAT.Fields
NIF of the issuer of the original invoice being substituted. Maps to API field
IDEmisorFactura.Series and number of the original invoice being substituted. Maps to API field
NumSerieFactura.Issue date of the original invoice being substituted, in
YYYY-MM-DD format. Maps to API field FechaExpedicionFactura.Getters and Setters
| Method | Description |
|---|---|
getIDEmisorFactura(): string | Returns the issuer NIF of the original invoice. |
setIDEmisorFactura(string $v): void | Sets the issuer NIF of the original invoice. |
getNumSerieFactura(): string | Returns the series/number of the original invoice. |
setNumSerieFactura(string $v): void | Sets the series/number of the original invoice. |
getFechaExpedicionFactura(): string | Returns the issue date of the original invoice. |
setFechaExpedicionFactura(string $v): void | Sets the issue date of the original invoice. |
getArrayData()
getArrayData(): array returns an associative array containing only the fields with non-empty string values. All three PHP property names map directly to the same names in the API payload:
| PHP property | API field key |
|---|---|
IDEmisorFactura | IDEmisorFactura |
numSerieFactura | NumSerieFactura |
fechaExpedicionFactura | FechaExpedicionFactura |
RegistroAlta::getArrayData() wraps the result in a single-element array under the key FacturasSustituidas, matching the API’s expected structure. If getArrayData() returns an empty array (i.e. all fields are empty), the FacturasSustituidas key is omitted entirely from the payload.empty()
FacturaSustituida::empty(): FacturaSustituida returns a FacturaSustituida with all three fields set to ''. Because getArrayData() skips empty strings, an empty instance produces no output in the API payload. Pass it to RegistroAlta when the invoice is not using the substitution rectification method.

