Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mdiago/VeriFactu/llms.txt
Use this file to discover all available pages before exploring further.
InvoiceFix is used when a previously submitted invoice was rejected by the AEAT and needs to be resubmitted as a correction (subsanación). It generates a RegistroAlta with the Subsanacion field set to "S", signalling to the AEAT that this submission corrects an earlier, failed record.
InvoiceFix extends InvoiceEntry, so it uses exactly the same constructor signature and .Save() call. The only difference is the internal SetRegistro() override, which sets registroAlta.Subsanacion = "S" before the record is chained and sent.
Ejemplo
Provide the same identifying data (InvoiceID, InvoiceDate, SellerID) as the rejected submission, along with the corrected invoice data:
Archivos generados
InvoiceFix uses timestamped file paths to preserve a history of resubmissions:
| Archivo | Path |
|---|---|
| XML de factura | {InvoicePostedPath}{EncodedInvoiceID}.SUB.{timestamp}.xml |
| Entrada en cadena | {InvoiceEntryPath}{InvoiceEntryID}.SUB.{timestamp}.xml |
| Respuesta AEAT | {ResponsesPath}{InvoiceEntryID}.SUB.{timestamp}.xml |
{InvoicePostedPath}{EncodedInvoiceID}.xml is expected to exist — GetBusErrors() validates this before submission.
Comprobar la respuesta
InvoiceFix inherits all response properties from InvoiceEntry:
| Propiedad | Descripción |
|---|---|
Status | Estado del resultado ("Correcto" si la subsanación fue aceptada). |
CSV | Código Seguro de Verificación devuelto por la AEAT. |
ErrorCode | Código de error (si Status != "Correcto"). |
ErrorDescription | Descripción del error devuelto por la AEAT. |
Response | Respuesta XML completa de la AEAT. |
Cuándo usar InvoiceFix
- ✅ Use
InvoiceFixwhen a previousInvoiceEntry.Save()completed (reached the AEAT) but was rejected with an error code, and you have corrected the data for resubmission. - ✅ Use
InvoiceFixwhen the invoice file already exists on disk at the expected path for the givenSellerID, year, andInvoiceID. - ❌ Do not use
InvoiceFixfor invoices that were never submitted — useInvoiceEntryfor those. - ❌ Do not use
InvoiceFixto cancel a correctly accepted invoice — useInvoiceCancellationfor that.
InvoiceFix.GetBusErrors() checks that the original invoice file already exists on disk. If it does not find it, it adds a validation error: "No existe una entrada con SellerID: ... en el año ... con el número ...". Make sure the failed entry is still present before calling the constructor.