Each VERI*FACTU invoice must include a QR code that encodes a URL pointing to the AEAT’s invoice validation service. This allows buyers, auditors, or any third party to verify that the invoice was correctly registered with the tax authority. VeriFactu exposes two methods directly on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mdiago/VeriFactu/llms.txt
Use this file to discover all available pages before exploring further.
RegistroAlta object — GetUrlValidate() and GetValidateQr() — so you can generate both the URL and the QR bitmap without any external dependencies.
Obtener la URL de validación
Callinvoice.GetRegistroAlta() to obtain a RegistroAlta instance, then call GetUrlValidate() to build the validation URL. The URL parameters (nif, numserie, fecha, importe) are URL-encoded automatically from the invoice data.
| Parámetro | Origen |
|---|---|
nif | IDFacturaAlta.IDEmisorFactura — seller’s tax ID. |
numserie | IDFacturaAlta.NumSerieFactura — invoice number / series. |
fecha | IDFacturaAlta.FechaExpedicionFactura — invoice date in dd-MM-yyyy format. |
importe | ImporteTotal — total invoice amount including taxes. |
Obtener el QR como bitmap
GetValidateQr() calls GetUrlValidate() internally and encodes the resulting URL as a QR code, returning the image as a raw BMP byte array.
The QR bitmap is returned in BMP format. Embed it directly into your invoice PDF generation workflow (e.g. via
System.Drawing, a PDF library, or a reporting tool) as required by the VERI*FACTU regulation. The regulation requires the QR code to appear visibly on the printed or electronic invoice.Cálculo de la huella (hash)
The chain-of-custody hash (Huella) is a SHA-256 digest computed over key fields of the RegistroAlta as defined in Artículo 137, Orden HAC/1177/2024. Call GetHashOutput() to obtain the hex-encoded hash string.
In normal operation the hash is computed automatically when a record is saved. You can also compute it manually — useful for auditing, testing, or verifying a specific registration record matches what was submitted to the AEAT:
GetHashOutput() is built from the following fields in order (per Artículo 137):
IDEmisorFactura— seller NIFNumSerieFactura— invoice number and seriesFechaExpedicionFactura— invoice issue dateTipoFactura— invoice typeCuotaTotal— total tax amountImporteTotal— total invoice amountHuellaof the previous registration recordFechaHoraHusoGenRegistro— timestamp including timezone offset
URL de preproducción vs producción
The validation endpoint prefix is controlled bySettings.Current.VeriFactuEndPointValidatePrefix. By default it points to the AEAT preproduction environment. Switch it to the production value before going live:
VeriFactuEndPointPrefixes are:
| Entorno | Constante | URL base |
|---|---|---|
| Preproducción | VeriFactuEndPointPrefixes.TestValidate | https://prewww2.aeat.es/wlpl/TIKE-CONT/ValidarQR |
| Producción | VeriFactuEndPointPrefixes.ProdValidate | https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR |
Settings object also controls the SOAP submission endpoint via VeriFactuEndPointPrefix (VeriFactuEndPointPrefixes.Test / VeriFactuEndPointPrefixes.Prod). Make sure both prefixes are set to the same environment (test or production) consistently.