# QR code and PDF

The tax QR code on every invoice: when it exists, what it encodes, and how any document that carries it presents it.

[← All rules](/rules#all-rules)

Every invoice issued with a billing system carries a QR code that lets its recipient check it with AEAT. The API returns the QR data with the invoice; these rules apply to any document that carries it.

10 rules: 6 from the law, 3 AEAT criteria, 1 BeeL. rule. [How to read a rule](/rules#how-to-read-a-rule).

## QRC-001 · Every invoice carries the tax QR code

`Required` · Law · Impact: high · Responsibility: your integration.

An invoice issued with a billing system carries the tax QR code, whether it is a full or a simplified invoice, on any document of the invoice. The invoice's `verifactu` block returns the QR data: `qr_url` and `qr_base64`.

**Why:** The QR is how the recipient checks the invoice with AEAT. A document without it is not the invoice the regulation describes.

**Applies to:** Invoices of a company under VeriFactu, full or simplified.

**Legal basis:**

- RD 1619/2012 (Reglamento de facturación), art. 6.5.a) — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2012-14696#a6)

  > «La representación gráfica del contenido parcial de la factura mediante un código “QR”.»

- RD 1619/2012 (Reglamento de facturación), art. 7.5 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2012-14696#a7)

  > «deberá incluirse, además, lo contenido en el apartado 5 del artículo 6 de este Reglamento.»

**Incorrect:** Sending the customer a document of your own with the invoice data and no QR.

**Correct:** Printing the invoice's QR (`qr_base64`, or `qr_url` encoded) on every document of the invoice you hand over.

**Related:** [QRC-002 · Wait for the QR before you distribute the PDF](/rules/qr#qrc-002) · [QRC-005 · Use qr_url exactly as returned](/rules/qr#qrc-005) · [QRC-003 · The QR measures between 30 mm and 40 mm](/rules/qr#qrc-003)

**Explained in:** [QR code and the invoice PDF](/verifactu/qr-and-pdf) · [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-002 · Wait for the QR before you distribute the PDF

`Required` · BeeL. rule · Impact: critical · Responsibility: your integration. The API also answers the error codes listed.

Do not render or send a document of an invoice under VeriFactu before its QR data exists. Wait for the `invoice.pdf.generated` webhook, or read the invoice until `verifactu.qr_url` is present. The API applies the same rule to its own PDF: it is painted once, with the QR, and never modified afterwards — voiding or correcting the invoice does not change it. Asking for the PDF of an invoice whose record ended without QR data answers `INVOICE_NOT_REGISTERED_NO_PDF`; an email requested before the PDF exists is accepted with `202` and sent when the PDF is stored, or recorded as failed if the record ends without QR data.

**Why:** A document rendered without the QR data cannot carry the QR the invoice needs.

**Applies to:** operations [`POST /v1/companies/{company_id}/invoices/{invoice_id}/issue`](/invoices/issueCompanyInvoice), [`GET /v1/companies/{company_id}/invoices/{invoice_id}/pdf`](/invoices/getCompanyInvoicePdf), [`POST /v1/companies/{company_id}/invoices/{invoice_id}/send`](/invoices/sendCompanyInvoice); Invoices of a company under VeriFactu.

**Error codes:** [`INVOICE_NOT_REGISTERED_NO_PDF`](/errors/INVOICE_NOT_REGISTERED_NO_PDF) (`400`)

**Incorrect:** Rendering your own PDF before the invoice carries `qr_url`.

**Correct:** Waiting for the `invoice.pdf.generated` webhook, or reading the invoice again until `verifactu.qr_url` is present.

**Related:** [QRC-001 · Every invoice carries the tax QR code](/rules/qr#qrc-001) · [REC-008 · Follow submission_status and fix what AEAT rejects](/rules/records#rec-008)

**Explained in:** [QR code and the invoice PDF › The PDF and the QR](/verifactu/qr-and-pdf#the-pdf-and-the-qr) · [QR code and the invoice PDF › The QR exists from PENDING](/verifactu/qr-and-pdf#the-qr-exists-from-pending)

## QRC-003 · The QR measures between 30 mm and 40 mm

`Required` · Law · Impact: medium · Responsibility: your integration.

The QR code printed on an invoice measures at least 30 mm × 30 mm and at most 40 mm × 40 mm.

**Why:** A smaller QR may not scan, and the Orden fixes the range: neither smaller nor larger.

**Applies to:** Any document that carries the QR, including one you render.

**Legal basis:**

- Orden HAC/1177/2024, art. 21.1 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-3)

  > «El código «QR» deberá tener un tamaño entre 30x30 y 40x40 milímetros y seguir las especificaciones de la norma ISO/IEC 18004.»

- AEAT, Preguntas frecuentes SIF y VERI*FACTU, Remisión de información por el receptor / QR — [source](https://sede.agenciatributaria.gob.es/Sede/iva/sistemas-informaticos-facturacion-verifactu/preguntas-frecuentes/posibilidad-remision-informacion-factura-parte-receptor.html)

  > «no puede ser menor de 30x30 mm no puede ser mayor de 40x40 mm.»

**Incorrect:** Scaling the `qr_base64` image down to fit a narrow header.

**Correct:** Placing the image at a fixed physical size inside the range, whatever the page layout.

**Related:** [QRC-004 · The QR follows ISO/IEC 18004 with error correction M](/rules/qr#qrc-004) · [QRC-009 · Keep a blank margin around the QR](/rules/qr#qrc-009) · [QRC-008 · The QR goes once, at the start of the first page](/rules/qr#qrc-008)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-004 · The QR follows ISO/IEC 18004 with error correction M

`Required` · Law · Impact: low · Responsibility: your integration.

A QR code generated for an invoice follows ISO/IEC 18004 and uses error-correction level M. Set it when you encode `qr_url` with your own library.

**Why:** Other levels change the density of the code, and the Orden fixes this one.

**Applies to:** A QR you generate yourself from `qr_url`.

**Legal basis:**

- Orden HAC/1177/2024, art. 21.1 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-3)

  > «Para la generación del código «QR» se empleará el nivel M (medio) de corrección de errores.»

**Incorrect:** Encoding `qr_url` with a library that defaults to error-correction level L.

**Correct:** Encoding it with level M, or printing `qr_base64` unchanged.

**Related:** [QRC-003 · The QR measures between 30 mm and 40 mm](/rules/qr#qrc-003) · [QRC-005 · Use qr_url exactly as returned](/rules/qr#qrc-005)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-005 · Use qr_url exactly as returned

`Required` · Law · Impact: high · Checked by the API: BeeL. applies it.

Do not build or change the URL the QR encodes: use `qr_url` as BeeL. returns it. It carries only the four parameters AEAT requires, the issuer NIF, the number, the issue date and the amount AEAT registered.

**Why:** The URL has to match the registered record. A URL built from your own invoice total, or with extra parameters, points AEAT at an invoice that does not exist.

**Applies to:** Invoices of a company under VeriFactu.

**Legal basis:**

- Orden HAC/1177/2024, art. 21.2 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-3)

  > «b) Información de la factura que formará parte de la «URL»: 1.º NIF del obligado a expedir la factura. 2.º Número de serie y número de la factura expedida. 3.º Fecha de expedición de la factura. 4.º Importe total de la factura.»

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 6 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «IMPORTANTE: este parámetro nunca podrá incorporarse en la «URL» que va en el código «QR» de la factura»

**Incorrect:** Rebuilding the URL from your own data, with the invoice total including IRPF, or adding `formato=json`.

**Correct:** Encoding the `qr_url` string from the invoice, unchanged.

```json
{ "verifactu": { "qr_url": "https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR?nif=B27534239&numserie=S-2026-0001&fecha=19-09-2026&importe=121.00" } }
```

**Related:** [QRC-001 · Every invoice carries the tax QR code](/rules/qr#qrc-001) · [QRC-004 · The QR follows ISO/IEC 18004 with error correction M](/rules/qr#qrc-004)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf) · [What AEAT receives from your invoice › The total](/verifactu/what-aeat-receives#the-total)

## QRC-006 · The VeriFactu legend goes just below the QR

`Required` · Law · Impact: medium · Responsibility: your integration.

Just below the QR, print «Factura verificable en la sede electrónica de la AEAT» or «VERI*FACTU», preferably centred on it. The Orden asks for a type and size clearly visible and similar to the rest of the invoice data; AEAT's specification, for one equal to or larger than it. Print it only on invoices whose record goes to AEAT.

**Why:** The legend tells the recipient the invoice was sent to AEAT and can be checked there; on an invoice that was not, it would say something false.

**Applies to:** Any document that carries the QR of an invoice registered under VeriFactu.

**Legal basis:**

- RD 1619/2012 (Reglamento de facturación), art. 6.5.b) — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2012-14696#a6)

  > «Estas facturas, sean electrónicas o no, incorporarán además la frase “Factura verificable en la sede electrónica de la AEAT” o “VERI*FACTU” únicamente en aquellos casos en los que el sistema informático realice la remisión de todos los registros de facturación a la Agencia Estatal de Administración Tributaria»

- Orden HAC/1177/2024, art. 20.1.b) — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-2)

  > «la frase «Factura verificable en la sede electrónica de la AEAT» o «VERI*FACTU», que deberá tener un tipo de letra y tamaño bien visibles, similares a los del resto de datos de la factura.»

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «justo debajo del código «QR» deberá aparecer la frase «Factura verificable en la sede electrónica de la AEAT» o «VERI*FACTU», preferiblemente centrada con respecto al código «QR».»

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «deberán tener un tipo de letra y tamaño legibles, siempre iguales o superiores a los del resto de datos de la factura.»

**Incorrect:** Printing the legend in small print in the footer, away from the QR.

**Correct:** Printing «Factura verificable en la sede electrónica de la AEAT» centred just below the QR, as large as the invoice lines.

**Related:** [QRC-007 · «QR tributario:» goes just above the QR](/rules/qr#qrc-007) · [QRC-003 · The QR measures between 30 mm and 40 mm](/rules/qr#qrc-003)

**Explained in:** [QR code and the invoice PDF › The legend next to the QR](/verifactu/qr-and-pdf#the-legend-next-to-the-qr)

## QRC-007 · «QR tributario:» goes just above the QR

`Required` · AEAT criterion · Impact: medium · Responsibility: your integration.

Above the QR, print the text «QR tributario:», preferably centred on it, in a legible type size equal to or larger than the rest of the invoice data.

**Why:** AEAT's specification presents the QR with this label, so that the recipient knows which code to scan.

**Applies to:** Any document that carries the QR, including one you render.

**Legal basis:**

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «La presentación del código «QR» incluirá también un texto que siempre deberá ir precediéndolo: «QR tributario:», y que se situará encima del propio código «QR» (preferiblemente centrado con respecto a este)»

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «Tanto el texto que siempre debe preceder al código «QR», como, en su caso, la frase que habrán de incluir los sistemas «VERI*FACTU» deberán tener un tipo de letra y tamaño legibles, siempre iguales o superiores a los del resto de datos de la factura.»

**Incorrect:** Printing the QR on its own, or with a label in a smaller font than the invoice lines.

**Correct:** Printing «QR tributario:» centred above the QR, at the same size as the invoice data.

**Related:** [QRC-006 · The VeriFactu legend goes just below the QR](/rules/qr#qrc-006) · [QRC-008 · The QR goes once, at the start of the first page](/rules/qr#qrc-008)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-008 · The QR goes once, at the start of the first page

`Required` · AEAT criterion · Impact: medium · Responsibility: your integration.

Place the QR at the beginning of the invoice, before its content. On a portrait page it goes near the top margin, preferably centred (otherwise top left); on a landscape page, on the left, preferably near the top-left corner (otherwise centred between the top and bottom margins). On an invoice of several pages it appears once, on the first page.

**Why:** AEAT's specification fixes where the recipient finds the code; a QR repeated or buried in the footer departs from it.

**Applies to:** Any document that carries the QR, including one you render.

**Legal basis:**

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «Si la factura ocupara varias páginas, el código «QR» aparecería una única vez, en la primera página.»

- AEAT, Preguntas frecuentes SIF y VERI*FACTU, Remisión de información por el receptor / QR — [source](https://sede.agenciatributaria.gob.es/Sede/iva/sistemas-informaticos-facturacion-verifactu/preguntas-frecuentes/posibilidad-remision-informacion-factura-parte-receptor.html)

  > «El QR tributario solo debe aparecer una vez, al principio de la factura y antes del contenido de esta.»

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «En el caso de utilizar un formato de orientación horizontal (apaisado) para la factura, el código «QR» se situará a la izquierda de esta, preferiblemente cercana al margen superior-izquierdo (o, si no, centrada respecto a los márgenes superior e inferior de la factura).»

**Incorrect:** Repeating the QR in the footer of every page.

**Correct:** Printing it once, at the top of page one, centred between the margins.

**Related:** [QRC-007 · «QR tributario:» goes just above the QR](/rules/qr#qrc-007) · [QRC-009 · Keep a blank margin around the QR](/rules/qr#qrc-009)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-009 · Keep a blank margin around the QR

`Required` · AEAT criterion · Impact: low · Responsibility: your integration.

Leave at least 2 mm of blank space on all four sides of the QR (6 mm recommended), with enough contrast against the background.

**Why:** Without a quiet zone, text or lines next to the code stop it from scanning.

**Applies to:** Any document that carries the QR, including one you render.

**Legal basis:**

- AEAT, Detalle de las especificaciones técnicas del código QR de la factura (v0.5.0), apartado 3 — [source](https://www.agenciatributaria.es/static_files/AEAT_Desarrolladores/EEDD/IVA/VERI-FACTU/DetalleEspecificacTecnCodigoQRfactura.pdf)

  > «se deben mantener como mínimo 2 milímetros de espacio vacío (en blanco) alrededor de los cuatro lados del código «QR», recomendándose que sean 6 milímetros.»

**Incorrect:** Placing the QR flush against a table border.

**Correct:** Keeping a white margin around it on every side.

**Related:** [QRC-003 · The QR measures between 30 mm and 40 mm](/rules/qr#qrc-003) · [QRC-008 · The QR goes once, at the start of the first page](/rules/qr#qrc-008)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

## QRC-010 · A structured e-invoice carries the QR URL as a field

`Required` · Law · Impact: low · Responsibility: your integration.

When you send an invoice as a structured electronic invoice, include the `qr_url` as a separate field; the QR image itself is then not needed. A PDF still shows the QR image.

**Why:** In a structured file there is no image to scan: the URL is how the recipient reaches AEAT's check.

**Applies to:** Invoices you send as structured e-invoices (Facturae, UBL and similar).

**Legal basis:**

- Orden HAC/1177/2024, art. 20.2 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-2)

  > «En caso de tratarse de una factura electrónica, destinada al intercambio de su información de forma estructurada»

- Orden HAC/1177/2024, art. 20.2 — [source](https://www.boe.es/buscar/act.php?id=BOE-A-2024-22138#a2-2)

  > «se deberá incluir como un campo independiente la «URL» contenida en el código «QR», no siendo necesario incluir el propio código «QR».»

**Incorrect:** Converting the invoice to a structured format and dropping the QR data.

**Correct:** Mapping `verifactu.qr_url` to its own field of the structured invoice.

**Related:** [QRC-005 · Use qr_url exactly as returned](/rules/qr#qrc-005) · [QRC-001 · Every invoice carries the tax QR code](/rules/qr#qrc-001)

**Explained in:** [QR code and the invoice PDF › Rendering your own PDF](/verifactu/qr-and-pdf#rendering-your-own-pdf)

[← All rules](/rules#all-rules)

## Related

<Related>

- [QR code and the invoice PDF](/verifactu/qr-and-pdf) — when the VeriFactu QR code data is available, how the PDF relates to it, and what applies to any document that carries the QR
- [What AEAT receives from your invoice](/verifactu/what-aeat-receives) — how BeeL. turns your invoice into the record AEAT registers — the description, the total, the number, the recipient and the late-submission flag — and why some of them differ from what you see on the invoice

</Related>

---

Full OpenAPI spec: https://docs.beel.es/api/openapi