Report Manager
ENES

← All articles

Where does the Verifactu QR code go on the invoice, and how big is it?

· Toni Martir, arquitecto de software

Under the Verifactu regulation, Spanish companies that invoice with software must have it compliant before 1 January 2027, and the self-employed and everyone else covered, before 1 July. Every invoice that software produces carries a QR code that the recipient can use to check it against the Spanish Tax Agency. Whoever maintains the invoice template, the report that prints it, has to make room for it.

It goes at the top, preferably centred, measures 30 to 40 millimetres, and has the label «QR tributario:» (tax QR) above it, «VERI*FACTU» below it if the software sends its invoice records to the Agency, and at least 2 millimetres of white space around it. In the designer there is also a setting that is easy to miss: the error-correction level, which has to be M.

Preview of an invoice from Talleres Ribera, S.L.: at the top centre, the label «QR tributario:», a QR code and «VERI*FACTU» below it; the issuer's details on the left and the customer's on the right; further down, invoice number FA2026/0125, the date 10/11/2026, four lines of items and a total of 285,44.
A made-up invoice in the Report Manager designer's preview. The QR code fills a 4 × 4 cm box and carries the URL of the Tax Agency's test environment; the issuer and the customer sit on either side of it, as in one of the Agency's examples.

What the order sets

Order HAC/1177/2024 fills in article 6.5 of the invoicing regulation. Its article 21 sets the size, between 30 × 30 and 40 × 40 millimetres; the standard the code follows, ISO/IEC 18004; and the error-correction level, M. That level is the spare information that lets a reader restore the data if the code gets dirty or damaged. According to Denso Wave's QR code website, there are four levels, M is the one most often chosen, and a higher level makes the code bigger.

The QR code holds a URL with four pieces of the invoice: the issuer's tax ID (NIF), the series and number, the date and the total amount. The phrase «VERI*FACTU», or the longer «Factura verificable en la sede electrónica de la AEAT» (invoice verifiable on the Tax Agency's website), only goes on invoices from software that sends all its records to the Agency. And on an e-invoice, the kind that travels as data from one program to another, the URL in a separate field is enough.

The 2027 dates are those of the text in force in the Official Gazette; how they are set and who can move them I covered, in Spanish, in ¿Puede el Gobierno aplazar Verifactu en periodo electoral?

Where it goes and what goes with it

The Tax Agency spells out the rest in its QR technical document. The code goes at the start of the invoice, before its content, and only once, on page 1, even if the invoice runs to several. On a portrait invoice, at the top and preferably centred; on a landscape one, on the left. The label «QR tributario:» always goes above it and, where it applies, the VERI*FACTU phrase below, both in type the same size as the rest of the invoice or larger. At least 2 millimetres around it must stay blank, and the Agency recommends 6. In its A4 examples, the issuer's details, logo included, and the customer's can sit on either side of the code, as on the invoice in the image.

The URL inside it

The URL points to the Agency's checking service, at www2.agenciatributaria.gob.es, and its path ends in ValidarQR if the software is VERI*FACTU, or in ValidarQRNoVerifactu if it is not. It takes four parameters: nif; numserie, the series and number, up to 60 characters; fecha, the date as day-month-year with hyphens; and importe, the amount with a decimal point. The values are encoded as in any web address: the Agency's example is an invoice number containing an &, which has to be written %26.

That URL is generated by the invoicing software, which is the one that knows whether it issues as VERI*FACTU. The practical approach is for it to store the URL with the invoice and for the report simply to print it.

In the designer: the barcode component

This is how the invoice in the image is built in Report Manager. The code sits in the invoice's group header, which prints once per invoice, not in the page header, which would repeat on every sheet. The labels «QR tributario:» and «VERI*FACTU» are two centred labels above and below, bold and at 10 points, the same size as the data. The code itself is a barcode component with these properties:

The barcode properties for the tax QR code

Bar type The kind of code
QR
Expression Where its content comes from
FACT.QR_URL the field holding the URL
Width and Height The box it fills, margin included
4 cm
ECC Level The error-correction level
Level1: M with Delphi and Lazarus Level3: M with .NET
Transparent The background of the box
False: white margin
Left The horizontal position
7.5 cm: centred

Property names as the designer shows them in English. The position is for an A4 page with 1 cm margins: it centres a 4 cm box in the 19 cm of usable width.

Two of those properties hide a catch. The error-correction level is chosen in «ECC Level», called «PDF417 ECC» in earlier versions of the designer, and the value that gives level M depends on the engine that prints the report. With the Delphi and Lazarus engine, the one behind the Delphi and Lazarus designers, printreptopdf and the web report server, it is Level1; with the .NET engine, the one behind the .NET designer, the web designer and Reportman Server, it is Level3. With Auto, the default, both print the QR code at level L.

The other one is the size. The component keeps a white margin of four modules, the small squares the code is made of, inside its box. In the invoice PDF, made with the Delphi and Lazarus engine, with a 4 × 4 cm box, the code measures 33.3 millimetres and the margin almost 3 on each side, more than the 2 the Agency asks for. With a 3 × 3 cm box, the code shrinks to 25.4 millimetres, under the 30 minimum. At 4 cm it complies whether you measure the code alone or with its margin.

Check that it reads

Before signing off the template, read the code. I decoded the QR code in the preview and the one in the PDF, and both return the exact URL, at level M. A phone camera is enough: it has to show the URL with that invoice's tax ID, number, date and amount. To test without using the production address, the Agency has a test environment, at prewww2.aeat.es, which is what the example invoice uses.

So where does it go, and how big is it?

At the top, preferably centred, only once, 30 to 40 millimetres and at level M, between «QR tributario:» and «VERI*FACTU», with at least 2 millimetres of white space. In the designer: QR type, the URL in the expression, a 4 × 4 cm box and, in «ECC Level», Level1 with the Delphi and Lazarus engine or Level3 with the .NET one. Recording and sending each invoice is the invoicing software's job: the template only prints the code.


Report Manager prints QR codes from a field or an expression (barcode component), and the invoice template is the same .rep file for the designer, printreptopdf, the web report server and Reportman Server, though level M takes a different value in each engine.

Sources

Toni Martir, arquitecto de software · · sources checked on