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.
InvoiceCancellation cancels a previously submitted invoice. It extends InvoiceEntry but generates a RegistroAnulacion XML record (instead of a RegistroAlta) and routes the submission through the AEAT’s cancellation workflow. All response properties, the Save() lifecycle, and blockchain management are inherited from InvoiceEntry.
Namespace
VeriFactu.Business
Herencia
Constructor
InvoiceCancellation(Invoice invoice)
Creates a new cancellation record for the given invoice.
The
Invoice to cancel. The minimum required data is:InvoiceID— must match the original submitted invoice number exactly.InvoiceDate— must match the original issue date exactly.SellerID— seller’s NIF/VAT number.SellerName— required by theInvoiceActionbase-class validation.
TaxItems) is not required for cancellations.InvoiceAction). Throws InvalidOperationException if validation fails.
Diferencias con InvoiceEntry
| Aspect | InvoiceEntry | InvoiceCancellation |
|---|---|---|
| XML record type | RegistroAlta | RegistroAnulacion |
InvoiceEntryID format | "00000000000000000042" | "00000000000000000042.DEL" |
| Stored file name | <encodedID>.xml | <encodedID>.DEL.xml |
| Response file name | <entryID>.xml | <entryID>.DEL.xml |
TaxItems required | Yes | No |
.DEL suffix is appended to both InvoiceEntryID and the physical file paths to distinguish cancellation records from regular submissions in the blockchain and on disk.
Propiedades adicionales
Blockchain link ID with a
.DEL suffix appended (e.g. "00000000000000000042.DEL").Full path to the stored cancellation XML in the outbox directory:
{InvoiceEntryPath}{InvoiceEntryID}.xml.Full path to the stored AEAT response XML:
{ResponsesPath}{InvoiceEntryID}.xml.Hexadecimal encoding of
InvoiceID + ".DEL" used as the file name stem on disk.Status, CSV, ErrorCode, ErrorDescription, Response, Posted, IsSent) are inherited from InvoiceEntry.
Ejemplo
The
InvoiceID, InvoiceDate, and SellerID you provide must exactly match the values in the original RegistroAlta submitted to the AEAT. Any mismatch will result in an AEAT rejection.