Documentation Index
Fetch the complete documentation index at: https://mintlify.com/josemmo/Verifactu-PHP/llms.txt
Use this file to discover all available pages before exploring further.
QrGenerator (josemmo\Verifactu\Services\QrGenerator) generates the URL that must be encoded into the QR code printed on every VERI*FACTU invoice. The library only produces the URL string — rendering an actual QR image is out of scope and must be handled by a separate library such as endroid/qr-code.
By default the generator targets the production environment and operates in online (VERI*FACTU) mode.
Configuration methods
Both methods returnstatic so they can be chained.
setProduction()
Pass
true (default) to generate URLs pointing to the live AEAT portal (www2.agenciatributaria.gob.es). Pass false to generate pre-production URLs (prewww2.aeat.es).setOnlineMode()
Pass
true (default) to use the VERI*FACTU (online) verification path — ValidarQR. Pass false to use the Non-VERI*FACTU (offline) path — ValidarQRNoVerifactu.Generating URLs
fromRegistrationRecord()
RegistrationRecord.
A fully populated registration record. The method extracts
$record->invoiceId and $record->totalAmount.fromInvoiceId()
InvoiceIdentifier object and a pre-formatted amount string.
The invoice identifier containing issuer NIF, invoice number, and issue date. See InvoiceIdentifier.
The invoice total amount as a decimal string, e.g.
"121.00". Must match the value stored in the record.from()
NIF of the invoice issuer (exactly 9 characters).
Invoice series and number, e.g.
"F-2024/001".Issue date of the invoice. The time component is ignored; only the calendar date is encoded.
Invoice total amount formatted as a decimal string, e.g.
"1210.50".URL format
The generated URL follows this structure:| Component | Production | Pre-production |
|---|---|---|
| Base (online) | https://www2.agenciatributaria.gob.es | https://prewww2.aeat.es |
| Path (VERI*FACTU) | ValidarQR | ValidarQR |
| Path (Non-VERI*FACTU) | ValidarQRNoVerifactu | ValidarQRNoVerifactu |
| Parameter | Description |
|---|---|
nif | Issuer NIF |
numserie | Invoice number |
fecha | Issue date in dd-mm-yyyy format |
importe | Total invoice amount |
The
fecha parameter is always formatted as dd-mm-yyyy regardless of the locale or timezone of the DateTimeInterface object passed.