VeriFactu error codes
Every public API error code emitted by VeriFactu, with its HTTP status, its type and a page per code.
Error codes emitted by VeriFactu. Each code links to its own page with the cause and the action to take.
| Code | Type | HTTP | Description |
|---|---|---|---|
alta_record_not_found | not_found_error | 404 | The invoice has no registration record, so the operation that depends on it has nothing to work with. |
anulacion_record_already_exists | conflict_error | 409 | The invoice already carries an annulment record in the chain, and annulment is reported only once. |
certificate_expired | invalid_request_error | 422 | The certificate is outside its validity window: it has expired, or it is not valid yet. |
certificate_nif_mismatch | invalid_request_error | 422 | The tax id of the certificate holder does not match the company tax id. AEAT records are signed on behalf of the company, so both must be the same. |
certificate_not_found | not_found_error | 404 | The company has no FNMT certificate matching the identifier, or none uploaded at all. |
certificate_too_large | invalid_request_error | 422 | The file exceeds the 100 KB limit, while a real FNMT certificate weighs a few kilobytes. |
clock_drift_exceeded | invalid_request_error | 422 | The server clock drifted from NTP beyond the allowed margin. The generation timestamp is part of the AEAT fingerprint, so an unsynchronised clock would produce records AEAT rejects. |
declaracion_already_exists | conflict_error | 409 | The company already filed its SIF responsibility statement for that period. |
declaracion_not_found | not_found_error | 404 | The company has no SIF responsibility statement filed for the requested period. |
event_already_processed | invalid_request_error | 422 | That SIF event is already recorded in the event chain, and each event is processed exactly once. |
invalid_certificate_format | invalid_request_error | 422 | The file is not a PKCS#12 container: its first bytes do not match the ASN.1 structure the format requires, whatever its extension says. |
invalid_certificate_password | invalid_request_error | 422 | The password does not open the certificate file. |
max_retries_exceeded | invalid_request_error | 422 | The record exhausted the technical retry budget for resending the stored XML. Retrying the same content again would fail the same way. |
mode_switch_blocked_until_year_end | invalid_request_error | 422 | VeriFactu mode was activated during this fiscal year and at least one billing record was issued. Stepping back would degrade the integrity of a chain already reported to AEAT. |
record_already_accepted | invalid_request_error | 422 | AEAT already accepted the record. Acceptance is terminal and its content is frozen as part of the fingerprint chain. |
record_immutable | invalid_request_error | 422 | The record belongs to an append-only ledger: once written, its fiscal content is closed to changes and to deletion. |
record_not_rejected | invalid_request_error | 422 | The correction flow only applies to records AEAT rejected on data grounds. This record is in another state — a technical failure, for instance, is covered by the automatic retry. |
record_not_subsanable | invalid_request_error | 422 | The record cannot be amended: it is not a registration record, or it has no source invoice from which its content could be regenerated. |
requires_annulment | invalid_request_error | 422 | The regenerated content changes a field that takes part in the fingerprint — issuer tax id, series and number, issue date, invoice type, tax amount or total — and the chain cannot be rewritten. |
sii_excluded | invalid_request_error | 422 | The company is registered with SII, and SII filers are excluded from the VeriFactu regulation. |
verifactu_already_submitted | invalid_request_error | 422 | The invoice already has its registration record. Exactly one registration exists per invoice, so a second one would break the idempotency of the chain. |
verifactu_mode_invalid | invalid_request_error | 422 | The mode is outside the catalogue verifactu / no_verifactu. |
verifactu_not_eligible | invalid_request_error | 422 | The invoice cannot be registered with AEAT right now: the company is not on VeriFactu mode, it has no active certificate, or the certificate is revoked or issued for a different tax id. |
verifactu_record_not_found | not_found_error | 404 | The identifier does not match any billing record of the authenticated company. |
verifactu_transmission_failed | invalid_request_error | 422 | The transmission of the record to AEAT did not complete: the endpoint was unreachable or answered with an incident. |