VeriFactuAPI supports two distinct paths for cancelling a previously submitted invoice record. The first is a lightweight cancellation by internal record ID, suitable when you already know the VeriFactuAPI-assigned ID of the record you want to cancel. The second builds a fullDocumentation 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 object from invoice data fields — useful when you want to cancel by invoice series number and date, or when you need to supply additional metadata about why the cancellation is being issued.
Method 1 — Cancel by Record ID
If you have the VeriFactuAPI internal ID of theRegistroAlta you want to cancel, call bajaRegistro() with that integer ID:
/api/anulacion-registro-facturacion/{id} with no additional body payload. It is the fastest way to cancel a record when the ID is already known, for example after storing it from a previous listarRegistrosAlta() call.
Method 2 — Cancel with a RegistroAnulacion Object
For more control, build aRegistroAnulacion object using nuevoRegistroAnulacion() and then submit it with altaRegistroAnulacion(). This approach lets you identify the target invoice by its series number and issue date, and optionally include cancellation metadata.
Populate the cancellation data array
Provide the identifying fields for the invoice you are cancelling, along with any optional metadata fields your use case requires:
RegistroAnulacion Fields Reference
The following fields are accepted bynuevoRegistroAnulacion(). All fields are optional at the object-construction level, but IDEmisorFactura, numSerieFactura, and fechaExpedicionFactura are required by the API to identify the invoice being cancelled.
NIF of the issuer of the invoice being cancelled.
Series and number of the invoice being cancelled (e.g.
AX/202412-075).Issue date of the invoice being cancelled, in
YYYY-MM-DD format.Your own external reference string for this cancellation record.
Indicates there is no prior registration for this invoice (list L4).
Identifies a prior rejection that this cancellation addresses (list L4).
Identifies who generated this cancellation record (list L16).
Legal name of the entity that generated the cancellation.
NIF of the entity that generated the cancellation.
Country code of the generator, when the generator is a foreign entity.
Type of foreign identification used by the generator (list L7).
Foreign identification number of the generator.
You only need to include the fields relevant to your cancellation scenario. Any field left out of the data array is treated as empty and excluded from the API request body entirely — verifactuPHP never sends empty values to the API.

