Generate VeriFactu QR (ES)

Generate the AEAT VeriFactu QR for a Spanish invoice. Returns the verification URL plus PNG (base64) and SVG renderings of the QR code.

Note: PNG is base64-encoded (no data: prefix) so clients can embed it directly or decode it to bytes — JSON keeps the response easy to consume without multipart.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
sellerNifstringRequired

Seller NIF/CIF (Spanish tax ID), e.g., “B12345678”.

invoiceSeriesstringRequired

Invoice series prefix that is concatenated with invoiceNumber to form the AEAT numserie parameter. Use whatever series your numbering scheme prescribes; characters are URL-encoded by the QR builder.

invoiceNumberstringRequired

Invoice number within the series (forms the second half of numserie).

invoiceDatestringRequired

Invoice issue date in AEAT QR format DD-MM-YYYY.

totaldoubleRequired

Invoice total amount used as the importe query parameter. Negative totals are accepted for credit notes.

verifactuModebooleanOptionalDeprecated
Deprecated and ignored. The platform is VERI*FACTU-only (`TipoUsoPosibleSoloVerifactu='S'`), so the QR always points at the `ValidarQR` cotejo service. Whether that is the AEAT test or production host follows the deployment configuration (`GOV_API_ES_AEAT_URL`), not this flag. Accepted for backwards compatibility; will be removed.

Response

QR generated successfully
urlstring
AEAT verification URL embedded in the QR code.
pngstring

Base64-encoded PNG image of the QR code (no data URL prefix).

svgstring
SVG markup string for the QR code.

Errors

400
Qr Verifactu Request Bad Request Error
401
Qr Verifactu Request Unauthorized Error
403
Qr Verifactu Request Forbidden Error
500
Qr Verifactu Request Internal Server Error