Verifactu invoice examples with the API

Here are 26 Verifactu invoice examples, one per invoice type or case (simplified, full, corrective R1–R5, intra-EU, exports, exempt, IGIC, IPSI, credit notes, exchange, cancellation and amendment), with the JSON request to the Verifacti Verifactu API ready to copy.

Invoice types and examples

Verifactu invoice examples by invoice type or case
CaseInvoice type or keyWhen to use it
Simplified invoiceF2Receipts and small amounts, with no tax details of the recipient.
Full invoiceF1Invoice with the recipient’s tax details.
Several VAT ratesF1 · varios tipo_impositivoOne entry in lineas per VAT rate.
Intra-EU B2B goodsF1 · E5 · id_otro tipo 02Sale of goods to EU businesses or professionals with a valid VAT number in VIES.
Intra-EU B2B servicesF1 · N2 · id_otro tipo 02Services to EU businesses or professionals.
Intra-EU B2C below the thresholdF1 · S1 · id_otro tipo 03, 04 o 06Distance sales and electronic services to EU consumers below €10,000 a year.
Intra-EU B2C above the threshold (OSS)F1 · clave_regimen 17 · N2Distance sales and electronic services to EU consumers above €10,000 a year.
Export of goodsF1 · clave_regimen 02 · E2Sale of goods leaving the EU.
Services outside the EUF1 · N2Services to customers outside the EU.
VAT-exempt invoiceF1 · E1Operations exempt under the VAT Law.
Invoice with IGICF1 · impuesto 03Operations in the Canary Islands.
Invoice with IPSIF1 · impuesto 02Operations in Ceuta and Melilla.
Disbursements and withholding—Income tax withholding and disbursements: as a rule, not in the record.
Non-taxable operationF1 · N1Operations outside the scope of VAT.
Credit noteF1 con importes negativosFull refund of what was invoiced: F1 with negative amounts.
Exchange invoiceF3 · facturas_sustituidasReplace a simplified invoice with a full one.
Corrective invoicesR1 a R5Correct an invoice already issued: types R1 to R5.
↳ Corrective invoice by substitutionR1–R5 · tipo_rectificativa SReplace the original invoice, in one or two steps.
↳ Corrective invoice by differenceR1–R5 · tipo_rectificativa ICorrect only the difference, in one step.
Equivalence surchargeF1 · clave_regimen 18 · tipo_recargo_equivalenciaSales to retailers under the equivalence surcharge.
Issued by a third partyF1 · emitida_por_tercero_o_destinatario TA third party issues the invoice on the seller’s behalf.
Self-billingF1 · emitida_por_tercero_o_destinatario DThe customer issues the invoice (self-billing).
REBU (used goods)F1 · clave_regimen 03Sale of used goods, art or antiques on the margin.
Reverse chargeF1 · S2The buyer self-assesses the VAT (construction, gold, phones…).
Cancellation/verifactu/cancelCancel an invoice issued by mistake.
Amendment (subsanación)/verifactu/modify · rechazo_previoChanges with no tax effect to a record already sent.

How to use these examples

The examples start with simplified invoices, continue with full invoices, corrective invoices and exchanges, and end with cancellation and amendment.

Each case comes with the JSON request to the Verifactu API, with tabs for cURL, Python, JavaScript, Node.js, PHP, Go, Java, C# and VB6. Copy it and try it with the test API key of your free account: the issue date is already today's. The Verifactu XML example (the record the API generates) and the response will be added to each case later.

Questions about the examples

FAQ Verifactu

When and how should corrective invoices and credit notes be used?

Corrective invoices
  • Whenever you want to modify any aspect of an invoice (accepted, partially accepted, or rejected) that involves a change in fiscally relevant data (such as recipient, amount, tax rate, etc.), you must always use a corrective invoice.
  • Corrective invoices are types R1, R2, R3, R4, or R5.
  • Corrective invoices are new invoices with a different series from the original, and with their own QR.
  • These additional invoices must be delivered to the recipient.
  • When you issue a corrective invoice (including F3), you reference the original invoice. However, the AEAT does not appear to verify whether the original invoice was previously sent or anything of the sort.
You can perfectly issue a corrective invoice referencing an invoice that was never sent through the Verifactu system and it will not cause any issue with the AEAT API.
Credit note
  • The only exception is when you issue an invoice for goods that are subsequently returned in full. In that case, it is sufficient to issue a normal "negative" invoice. This is an ordinary invoice with a negative total amount that can go in the same series.
  • It would be a standard F1 invoice.
  • The fact that a negative F1 can be issued is made very clear in the AEAT examples, which can be found at the following link.
  • These additional invoices must be delivered to the recipient.
  • Credit notes do not require their own series; they can go in the same series as the original invoice.

How do I include disbursements (suplidos)?

The tax authority establishes that disbursements (suplidos) do not have to be mandatorily included in invoices sent through the Verifactu system. However, they can be voluntarily included through an additional line with 0% VAT.

How do I include IRPF (income tax) withholdings?

Invoices that include IRPF (income tax) withholding, such as payments to freelancers, must exclude the IRPF component when reported to the Tax Agency through Verifactu. This means that the total invoice amount in the hands of the final recipient will be different from the total invoice amount in Verifactu. When viewing an invoice on the AEAT website (through the QR), the AEAT itself explains that the data shown there does not include withholdings.

What is the QR code and how do I obtain it?

The QR code in the Verifactu system is an encoded URL, unique for each invoice, located on the Tax Agency website. This URL allows verifying whether the invoice has been received by the tax authority through the Verifactu system. The tax authority expects all invoices issued by taxpayers subject to the Verifactu system to include this QR. Thus, any recipient of an invoice with a QR can easily access the URL from their mobile device and verify that the invoice has been reported to the Tax Agency.
The QR is generated from the following 5 invoice fields:
  1. Issuer NIF
  2. Series
  3. Number
  4. Date
  5. Amount
When a new invoice call is made to the Verifacti API, the synchronous immediate response includes the QR in Base64 image format.
👉 Watch short video: QR code in Verifactu, what it is and how it is generated
More in Verifactu QR code.

Try the examples in the test environment

Create your free account and send any of these requests with the test API key of your test NIF.

Test environment and test NIF includedRead the documentation