Skip to main content

Spanish Veri*Factu Invoice Hash Validator

Validate the authenticity, format, and checksum of Spanish Veri*Factu Invoice Hash.

About Spanish Veri*Factu Invoice Hash Validation

The Veri*Factu validator inspects QR URLs printed on Spanish invoices, ensuring the official AEAT domain (`sede.agenciatributaria.gob.es`), mandatory query parameters (`nif`, `numserie`, `fecha`, `importe`, `huella`), and format compliance.

Essential for technical billing software audits, QA pipeline assertions, and tax compliance validation in staging environments.

Anatomy & Structure of Veri*Factu (AEAT)

The Spanish Veri*Factu system specifies structured query parameters for immediate tax audit verification:

PositionFieldLengthMeaning & RuleExample
nifIssuer NIF9 charactersTax ID of invoice issuer (DNI, NIE, or CIF)B12345678
numserieSeries & InvoiceUp to 60 charsSeries code and sequential invoice numberFAC-2026-1001
fechaDate10 charsDate of issuance formatted as DD-MM-YYYY26-08-2026
importeTotal AmountVariableTotal invoice monetary amount in Euros with 2 decimal places150.50
huellaSHA-256 Hash16 hex charsCryptographic fingerprint of previous invoice for immutable chaininga1b2c3d4e5f67890

Veri*Factu Cryptographic Chaining Algorithm (SHA-256)

Invoice chain integrity and immutability are guaranteed via the SHA-256 cryptographic hash function:

Fingerprint = SHA-256(NIF + Series + Date + InvoiceType + TotalAmount + PreviousHash)
  1. 1. Concatenate in UTF-8 all mandatory invoice tax fields without spaces.
  2. 2. Include the cryptographic fingerprint of the immediately preceding invoice to form the blockchain-like link.
  3. 3. Execute standard SHA-256 algorithm per FIPS PUB 180-4.
  4. 4. Extract the first 16 hexadecimal characters to embed in the QR code URL parameters.
  5. 5. The generated QR URL enables instant verification on the AEAT electronic tax portal.

Frequently Asked Questions & Technical Guidelines