Factuarea API

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.

CodeTypeHTTPDescription
alta_record_not_foundnot_found_error404The invoice has no registration record, so the operation that depends on it has nothing to work with.
anulacion_record_already_existsconflict_error409The invoice already carries an annulment record in the chain, and annulment is reported only once.
certificate_expiredinvalid_request_error422The certificate is outside its validity window: it has expired, or it is not valid yet.
certificate_nif_mismatchinvalid_request_error422The 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_foundnot_found_error404The company has no FNMT certificate matching the identifier, or none uploaded at all.
certificate_too_largeinvalid_request_error422The file exceeds the 100 KB limit, while a real FNMT certificate weighs a few kilobytes.
clock_drift_exceededinvalid_request_error422The 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_existsconflict_error409The company already filed its SIF responsibility statement for that period.
declaracion_not_foundnot_found_error404The company has no SIF responsibility statement filed for the requested period.
event_already_processedinvalid_request_error422That SIF event is already recorded in the event chain, and each event is processed exactly once.
invalid_certificate_formatinvalid_request_error422The 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_passwordinvalid_request_error422The password does not open the certificate file.
max_retries_exceededinvalid_request_error422The 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_endinvalid_request_error422VeriFactu 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_acceptedinvalid_request_error422AEAT already accepted the record. Acceptance is terminal and its content is frozen as part of the fingerprint chain.
record_immutableinvalid_request_error422The record belongs to an append-only ledger: once written, its fiscal content is closed to changes and to deletion.
record_not_rejectedinvalid_request_error422The 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_subsanableinvalid_request_error422The record cannot be amended: it is not a registration record, or it has no source invoice from which its content could be regenerated.
requires_annulmentinvalid_request_error422The 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_excludedinvalid_request_error422The company is registered with SII, and SII filers are excluded from the VeriFactu regulation.
verifactu_already_submittedinvalid_request_error422The 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_invalidinvalid_request_error422The mode is outside the catalogue verifactu / no_verifactu.
verifactu_not_eligibleinvalid_request_error422The 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_foundnot_found_error404The identifier does not match any billing record of the authenticated company.
verifactu_transmission_failedinvalid_request_error422The transmission of the record to AEAT did not complete: the endpoint was unreachable or answered with an incident.

On this page