Cancel invoice in deferred mode (canonical command endpoint)
POST
/no-verifactu/invoices/cancellationsRequest body
requiredapplication/jsongenerated_bystringIndica quién genera el registro de anulación: E=Expedidor, D=Destinatario, T=Tercero
Allowed:
EDTgeneratorobjectDatos del generador (obligatorio si generated_by está informado)
Show propertiesHide properties
id_otroobjectIDOtro del generador (si no se identifica por NIF)
Show propertiesHide properties
country_codestringCountry code in ISO 3166-1 alpha-2 format (e.g., FR, DE, IT). Required unless id_type = 02 (NIF-IVA). Not allowed when id_type = 07 and country ≠ ES.
idstringrequiredIdentifier value. Maximum 20 characters.
min length 1 · max length 20
id_typestringrequiredType of identification:
• 02 = NIF-IVA (EU VAT number)
• 03 = Passport
• 04 = Official identification document issued in country of residence
• 05 = Residence certificate
• 06 = Other supporting document
• 07 = Not registered in census (only allowed for Spain)
Allowed:
020304050607namestringrequiredNombreRazon del generador del registro de anulación
max length 120
NIFstringNIF del generador (si se identifica por NIF)
incidencestringSet to "S" only if an incident occurred during cancellation
matches FLAG_S_RE
issue_datestringrequiredIssue date of the invoice to cancel (DD-MM-YYYY). Cannot be future date.
matches ISSUE_DATE_RE
numberstringrequiredInvoice number. Required. The concatenation of series + number cannot exceed 60 characters.
previous_rejectionstringN = First cancellation attempt (or invoice was accepted)
S = Previous cancellation was rejected by AEAT (retry)
default: "N"
Allowed:
NSseriesstringrequiredInvoice series. Can be empty string (""). Must not begin with a space. The concatenation of series + number cannot exceed 60 characters.
matches NO_LEADING_SPACE_OR_EMPTY_RE
without_prior_registrationstringN = Invoice IS registered in AEAT (most common case)
S = Invoice was NEVER registered in AEAT (e.g. cancel before sending, or error in emission)
default: "N"
Allowed:
NSResponses
200Invoice successfully canceled
correlationIdstringrequiredCorrelation ID for tracking this cancellation request across distributed systems
dataobjectrequiredCancellation data returned after successful submission to AEAT
Show propertiesHide properties
csvstringCSV devuelto por AEAT para el registro
estadostringrequiredValidation status returned by VeriFactu AEAT for the cancellation
Allowed:
CorrectaAceptadaConErroresIncorrectohuellastringrequiredVeriFactu hash (huella) of the cancellation record - SHA-256 fingerprint used for chain integrity
min length 64 · max length 64
idPeticionstringIdPeticion devuelto por AEAT
nifPresentadorstringNIFPresentador devuelto por AEAT
timestampPresentacionstringTimestampPresentacion devuelto por AEAT
uuidstring<uuid>requiredUnique identifier (UUID) of the cancellation record in the system
successbooleanrequiredIndicates whether the cancellation submission was successful
warningobjectPresent only when VeriFactu accepts the cancellation with correctable errors (EstadoRegistro = 'AceptadaConErrores'). These are admissible errors in the RegistroAnulacion that don't prevent cancellation registration.
Show propertiesHide properties
additionalErrorInfoobjectAdditional detailed error information
Show propertiesHide properties
causastringrequiredRoot cause of the error
messagestringrequiredBrief error message describing the issue
solucionstringrequiredDetailed solution or recommended action to resolve the error
subsanablebooleanrequiredIndicates whether the error is correctable/recoverable through subsanation (correction) process
codigostringrequiredError code from VeriFactu (correctable error code 2000-2999)
mensajestringrequiredHuman-readable error description from VeriFactu AEAT
severitystringrequiredSeverity level of the warning
Allowed:
warningtypestringrequiredWarning type identifier
400Bad request
correlationIdstringrequiredmessagestringrequiredpathstringrequiredstatusCodenumberrequiredsuccessbooleanrequiredtimestampstringrequired422Unprocessable error
correlationIdstringrequirederrorDetailsobjectPresent only when the error comes from VeriFactu submission
Show propertiesHide properties
verifactuErrorVerifactuErrorrequiredShow propertiesHide properties
causastringRoot cause of the error
codigoErrorRegistrostringdescripcionErrorRegistrostringerrorTypestringrequiredAllowed:
ADMISSIBLEINADMISSIBLEmessagestringBrief error message describing the issue
registroDuplicadoobjectInformación del registro ya existente cuando AEAT rechaza por duplicidad
Show propertiesHide properties
codigoErrorRegistrostringCódigo de error del registro duplicado almacenado en AEAT, si aplica
descripcionErrorRegistrostringDescripción del error del registro duplicado almacenado en AEAT, si aplica
estadoRegistroDuplicadostringEstado del registro duplicado almacenado en AEAT (Correcta, AceptadaConErrores, Anulada)
idPeticionRegistroDuplicadostringIdPeticion asociado a la factura registrada previamente en AEAT (solo se informa si el rechazo es por duplicidad)
solucionstringDetailed solution or recommended action to resolve the error
subsanablebooleanIndicates whether the error is correctable/recoverable through subsanation (correction) process
messagestringrequiredpathstringrequiredstatusCodenumberrequiredsuccessbooleanrequiredtimestampstringrequired500Internal server error
correlationIdstringrequiredmessagestringrequiredpathstringrequiredstatusCodenumberrequiredsuccessbooleanrequiredtimestampstringrequiredRequest
curl -X POST "https://api.multifactu.com/no-verifactu/invoices/cancellations" \
-H "Content-Type: application/json" \
-d '{
"generated_by": "E",
"generator": {
"id_otro": {
"country_code": "FR",
"id": "FR123456789",
"id_type": "02"
},
"name": "ACME Asesores S.L.",
"NIF": "B12345678"
},
"incidence": "S",
"issue_date": "07-12-2025",
"number": "2025/00123",
"previous_rejection": "N",
"series": "",
"without_prior_registration": "N"
}'const response = await fetch("https://api.multifactu.com/no-verifactu/invoices/cancellations", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"generated_by": "E",
"generator": {
"id_otro": {
"country_code": "FR",
"id": "FR123456789",
"id_type": "02"
},
"name": "ACME Asesores S.L.",
"NIF": "B12345678"
},
"incidence": "S",
"issue_date": "07-12-2025",
"number": "2025/00123",
"previous_rejection": "N",
"series": "",
"without_prior_registration": "N"
})
});import requests
response = requests.post(
"https://api.multifactu.com/no-verifactu/invoices/cancellations",
headers={
"Content-Type": "application/json"
},
json={
"generated_by": "E",
"generator": {
"id_otro": {
"country_code": "FR",
"id": "FR123456789",
"id_type": "02"
},
"name": "ACME Asesores S.L.",
"NIF": "B12345678"
},
"incidence": "S",
"issue_date": "07-12-2025",
"number": "2025/00123",
"previous_rejection": "N",
"series": "",
"without_prior_registration": "N"
},
)Response
{
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"data": {
"csv": "CSV1234567890",
"estado": "Correcta",
"huella": "4C5E93A95C5F78A45EE1D0GB5598GAFE0FG565C26B2B13FCC9AC2DBEF00C70GA",
"idPeticion": "1234567890ABCDEF",
"nifPresentador": "B12345678",
"timestampPresentacion": "2025-01-01T12:34:56",
"uuid": "dcfe95fd-b6b8-5bg4-b9gb-4d865c43822b"
},
"success": true,
"warning": {
"codigo": "2007",
"mensaje": "No debería informarse como primer registro; existen facturas emitidas con el obligado emisor y el sistema informático actual. Should not be reported as first record - previous invoices exist.",
"severity": "warning",
"type": "verifactu_accepted_with_errors"
}
}{
"correlationId": "xyz",
"message": "series is required when number is provided",
"path": "/v1/verifactu/invoices/search",
"statusCode": 400,
"success": false,
"timestamp": "2025-12-21T12:10:46.668Z"
}{
"correlationId": "xyz",
"errorDetails": {
"verifactuError": {
"codigoErrorRegistro": "3000",
"descripcionErrorRegistro": "Registro de facturación duplicado.",
"errorType": "INADMISSIBLE"
}
},
"message": "series is required when number is provided",
"path": "/v1/verifactu/invoices/search",
"statusCode": 422,
"success": false,
"timestamp": "2025-12-21T12:10:46.668Z"
}{
"correlationId": "xyz",
"message": "Internal server error",
"path": "/v1/verifactu/invoices",
"statusCode": 500,
"success": false,
"timestamp": "2025-12-21T12:10:46.668Z"
}