VeriFactu API call and request examples

This section shows numerous examples of calls and requests to the Verifactu API. We start with the issuance of simplified invoices, in which the recipient is not identified, as they are the simplest.

Next, we discuss standard invoices in detail — that is, those in which the recipient is identified. We show examples where the recipient is a Spanish citizen or company registered with the AEAT. We also include examples where the recipient is a company from a member state identified by a VIES VAT number.

Then, we move on to discuss the different types of corrective invoices, including several examples of corrective invoices by difference and by substitution, as well as exchange invoices, which convert a simplified invoice into a standard one.

Finally, examples of invoice cancellation and rectification are shown.

Simplified invoice

The simplified invoice is allowed in certain cases, for example, when the amounts are small. This type of invoice entails lower information requirements than a standard invoice; for instance, it is not mandatory to include fiscal information about the recipient. In the eyes of the tax administration, "tickets" for small amounts are simplified invoices.

This type of invoice is generated by making a call to the endpoint /verifactu/create using the field tipo_factura equal to F2.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F2",
  "descripcion": "Simplified invoice",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    },
    {
      "base_imponible": "100",
      "tipo_impositivo": "10",
      "cuota_repercutida": "10"
    }
  ],
  "importe_total": "352"
}

Our API will validate that the amount is less than €3,000 and will reject the invoice if it is not.

Standard invoice

The standard invoice entails greater information obligations than the simplified invoice, as it is mandatory to specify the fiscal data of the recipient. This type of invoice is generated using the field tipo_factura equal to F1.

When the recipient is a Spanish citizen or company, we can identify them using the fields nif and nombre. The field nif must be a valid DNI, NIE or CIF. The field nombre corresponds to the full name for individuals and the company name for businesses. Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Standard invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

When the recipient is a company, it is sufficient for the NIF to be correct. However, when the recipient is an individual, the name must also match the one shown on the DNI or NIE.

Our API performs this validation automatically and rejects the invoice if it does not pass. This prevents generating an invoicing record that the AEAT will reject. In the NIF management API we have a specific endpoint to query the AEAT census.

Invoice with multiple VAT rates

In some cases, invoices may contain multiple VAT rates. In this case, the field lineas must contain an array with the corresponding tax rates.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Invoice with multiple VAT rates",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    },
    {
      "base_imponible": "100",
      "tipo_impositivo": "10",
      "cuota_repercutida": "10"
    }
  ],
  "importe_total": "352"
}

B2B Intra-Community: Sale of goods

In the case of the sale of products to EU companies or freelancers, when both parties are registered in the ROI (VIES), the invoice does not include VAT. Although for practical purposes the recipient self-assesses the tax in their country (a mechanism that acts there as a "reverse charge"), for the Spanish Tax Agency and VeriFactu this is not classified with the reverse charge tag (S2). On a technical and legal level in Spain, it is declared and must explicitly appear on the invoice as an exempt delivery under Article 25 of the VAT Law. This means that the operation must be marked as exempt using the operacion_exenta field with the value E5.

Since it is a foreign recipient, the id_otro field must be used to identify them, indicating that the document type is 02 (Intra-community VAT-VIES) and the corresponding country code. Our API validates by default that said VAT-VIES is correctly registered in the census.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "B2B Intra-Community - Sale of goods",
  "id_otro": {
    "codigo_pais": "BE",
    "id_type": "02",
    "id": "BE0404621642"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "operacion_exenta": "E5"
    }
  ],
  "importe_total": "200"
}

B2B Intra-Community: Provision of services

In the case of providing services to EU companies or professionals, the general localization rule (Article 69 of the VAT Law) establishes that the service is considered performed at the recipient's headquarters. Therefore, for the Spanish Tax Agency, this operation is not subject to Spanish VAT.

As with goods, although the client self-assesses the tax in their country, for VeriFactu this is not classified as a reverse charge (S2) nor as an exempt operation. At a technical level, this means that the operation must be marked as not subject using the calificacion_operacion field with the value N2 (Not subject due to localization rules).

To identify the foreign recipient, the id_otro field is also used, indicating that the document type is 02 (Intra-community VAT-VIES) along with its country code. Our API validates by default that said VAT-VIES is correctly registered in the census.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "B2B Intra-Community: Provision of services",
  "id_otro": {
    "codigo_pais": "BE",
    "id_type": "02",
    "id": "BE0404621642"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "calificacion_operacion": "N2"
    }
  ],
  "importe_total": "200"
}

B2C Intra-Community: Below the threshold

When goods or services are sold to a final consumer (individual) residing in another European Union country and the global volume of these sales does not exceed the €10,000 annual threshold, the operation is taxed at the source. This means that the invoice must include Spanish VAT, exactly as if the client were in Spain.

For VeriFactu purposes, this is classified as a conventional subject and non-exempt operation. In the JSON, it must be reflected using thecalificacion_operacion field with the default value S1 (Subject and non-exempt - without reverse charge). Unlike B2B cases, here it is mandatory to send the tax base along with the tipo_impositivo (e.g., 21) and its corresponding cuota_repercutida.

Since it is a private client, they will not have an intra-community VAT-VIES number. To identify them on the invoice, theid_otro field is used, indicating that the document type is 03 (Passport number), or you can also use 04 (ID in country of residence) or 06 (Other supporting document), accompanied by their country code.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "B2C Intra-Community: Below the threshold",
  "id_otro": {
    "codigo_pais": "DE",
    "id_type": "03",
    "id": "F8624KW3J6"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

B2C Intra-Community: Above the threshold

When the volume of sales to private individuals in other EU countries exceeds €10,000 per year, regulations require applying the VAT of the buyer's country of residence (destination country). To simplify the declaration of these foreign VATs without having to register for tax in each country, the One-Stop Shop (OSS) special scheme is used.

Being subject to foreign VAT, for the Spanish Tax Agency this is a non-subject operation. In VeriFactu, this requires reporting the clave_regimen with the value 17 (OSS Scheme); on the other hand,calificacion_operacion must be used with the value N2 (Not subject due to localization rules). Since the VAT breakdown block in VeriFactu is designed for Spanish VAT, the tipo_impositivo andcuota_repercutida fields must not be sent in these lines.

Since it is a private client, they will not have an intra-community VAT-VIES number. To identify them on the invoice, theid_otro field is used, indicating that the document type is 03 (Passport number), or you can also use 04 (ID in country of residence) or 06 (Other supporting document), accompanied by their country code.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "B2C Intra-Community: OSS",
  "id_otro": {
    "codigo_pais": "DE",
    "id_type": "03",
    "id": "F8624KW3J6"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "clave_regimen": "17",
      "calificacion_operacion": "N2"
    }
  ],
  "importe_total": "200"
}

Extracommunity: Export of goods

The export of goods involves the sale of physical products that leave the European Union's VAT application territory. In these cases, the operation is subject to but exempt from Spanish VAT, regardless of whether the recipient is a company, a professional, or a final consumer.

To correctly reflect this exemption in VeriFactu, the JSON requires a specific configuration. First, theclave_regimen must be used with the value 02 (Export). Second, the line must be explicitly marked as exempt using the operacion_exenta field with the value E2 (Exempt under Article 21 of the VAT Law). Since there is an exemption cause, the API will not accept sending the tax rate or passed-on quota fields.

The identification of the extra-community client is always done through the id_otro block. Depending on the document provided by the client, document types such as 03 (Passport) , 04 (ID in country of residence) or 06 (Other supporting document) will be used, always accompanied by their ISO country code.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Extracommunity: Export of goods",
  "id_otro": {
    "codigo_pais": "US",
    "id_type": "03",
    "id": "M76543210"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "clave_regimen": "02",
      "operacion_exenta": "E2"
    }
  ],
  "importe_total": "200"
}

Extracommunity: Provision of services

The provision of services to clients located outside the European Union is governed by VAT localization rules. As a general rule, the service is considered to be provided at the recipient's headquarters. Therefore, the operation is not subject to Spanish VAT, regardless of whether the client is a company (B2B) or a final consumer (B2C).

At the VeriFactu integration level, since the operation is not subject to the national tax, the JSON must reflect this situation using the calificacion_operacion field with the value N2 (Not subject due to localization rules). Being a non-subject operation, the tipo_impositivo and cuota_repercutida fields must not be included in the invoice line.

To identify the extra-community client on the invoice, the id_otro block must be used. Document types such as 03 (Passport), 04 (ID in the country of residence), or 06 (Other supporting document) will be used, always indicating the corresponding country code.

Below is an example of such an invoice.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Extracommunity: Provision of services",
  "id_otro": {
    "codigo_pais": "US",
    "id_type": "03",
    "id": "M76543210"
  },
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "calificacion_operacion": "N2"
    }
  ],
  "importe_total": "200"
}

VAT-exempt invoice

A VAT-exempt invoice is one in which this tax is not applied because the law permits it in certain cases, such as medical, educational, social, or insurance services, or residential rentals. In these invoices, no VAT is added to the price, but a note must be included indicating the exemption according to the corresponding article of the VAT Act (BOE-A-1992-28740).

To issue a VAT-exempt invoice using our API, you must use the field operacion_exenta to indicate the VAT exemption. An example is as follows:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Exempt operation",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "operacion_exenta": "E1"
    }
  ],
  "importe_total": "200"
}

The possible values of operacion_exenta can be found in our documentation, here.

Invoice with IGIC

The IGIC is the tax that levies the consumption of goods and services in the Canary Islands, similar to VAT on the mainland. It applies to all business and professional activities carried out in the Canary Islands. Tax rates vary depending on the type of good or service, with a general rate of 7% and reduced rates for essential products such as food, medicine, or transportation. The law governing the IGIC is Law 4/2012, of June 25, on Administrative and Fiscal Measures of the Canary Islands (BOE-A-2012-9282).

To issue an invoice with IGIC using our API, you must indicate it using the field impuesto equal to 03. An example is as follows:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Operation with IGIC",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "impuesto": "03",
      "base_imponible": "200",
      "tipo_impositivo": "7",
      "cuota_repercutida": "14"
    }
  ],
  "importe_total": "214"
}

In addition to marking the tax, we have indicated the tax rate equal to 7%, which is the general rate. However, other values can be used depending on the specific case.

The possible values of impuesto can be found in our documentation, here.

Invoice with IPSI

The IPSI is the tax that levies the consumption of goods and services in the autonomous cities of Ceuta and Melilla, similar to VAT on the mainland. It applies to all business and professional activities carried out in these cities. Tax rates vary depending on the type of good or service, with rates ranging from 0.5% to 10%. The law governing the IPSI is Law 8/1991, of March 25 (BOE-A-1991-7645).

To issue an invoice with IPSI using our API, you must indicate it using the field impuesto equal to 02. An example is as follows:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Operation with IPSI",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "impuesto": "02",
      "base_imponible": "200",
      "tipo_impositivo": "4",
      "cuota_repercutida": "8"
    }
  ],
  "importe_total": "208"
}

In addition to marking the tax, we have indicated the tax rate equal to 5%, but other values can be used depending on the specific case.

The possible values of impuesto can be found in our documentation, here.

Disbursements and withholding

An invoice with personal income tax (IRPF) withholding is one in which a percentage reduction is applied to the taxable base, as established by tax regulations. This withholding is deducted directly from the amount to be collected and must be paid by the client to the tax authorities on behalf of the self-employed worker.

A common question is how to indicate IRPF withholding on an invoice in the Verifactu system. The AEAT's answer is clear: the withholding should not be indicated at all.

Disbursed expenses represent a specific category of expenses in the area of invoicing and accounting. These are expenses that a professional or company pays on behalf of their client and subsequently claims back. In the same way, disbursements should not be indicated in the invoicing record in the Verifactu system.

This can be read in the AEAT's frequently asked questions, here.

Non-taxable transaction

A non-taxable invoice is one in which VAT is not applied because the transaction is not within the scope of VAT according to the VAT Act (BOE-A-1992-28740). This means that, by its nature, the transaction does not constitute a taxable event for the tax. For example, when a tenant pays for a rented dwelling or when a vehicle is sold between private individuals.

It is important to note that a non-taxable transaction is not the same as a VAT-exempt transaction. While in an exempt transaction the tax applies but the law allows not charging it in certain cases, in a non-taxable transaction the tax does not apply from the outset.

To issue a non-taxable invoice using our API, you must use the field calificacion_operacion to indicate the reason why the transaction is not subject to VAT. An example is as follows:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Non-subject operation",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "calificacion_operacion": "N1"
    }
  ],
  "importe_total": "200"
}

The possible values of calificacion_operacion can be found in our documentation, here.

Credit note

A credit note is an invoice that is normally used to adjust the balance of a previous invoice. It is used to reflect situations such as product returns or the application of discounts after the issuance of the initial invoice. In summary, a credit note serves to adjust the balance of a previous invoice, generally reducing the amount owed. Within the Verifactu system, a credit note is represented by an invoicing record with the field importe_total in negative.
/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Credit note",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "-200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-42"
    }
  ],
  "importe_total": "-242"
}
In the following examples, cases in which a credit note can be used are shown.

Exchange invoice

A common operation consists of converting a simplified invoice into a standard invoice, which is known as an exchange invoice.

Suppose we have sent an invoicing record corresponding to a simplified invoice, that is, one with tipo_factura equal to F2 in which the recipient is not identified.

/verifactu/create
{
  "serie": "SIMPLE",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F2",
  "descripcion": "Operation description",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

If, after issuing this invoice, we need to identify the recipient, we have two options within the Verifactu system, which we show below.

OPTION 1. Credit note + full invoice

The first option requires sending two additional invoicing records, one corresponding to a credit note (negative total amount) and another to issue the standard invoice.

/verifactu/create
{
  "serie": "SIMPLE",
  "numero": "2",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F2",
  "descripcion": "Credit note",
  "lineas": [
    {
      "base_imponible": "-200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-42"
    }
  ],
  "importe_total": "-242"
}

Next, a standard invoice is issued with tipo_factura equal to F1.

/verifactu/create
{
  "serie": "EJEMPLO",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Operation description: standard invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

Although this procedure requires sending two additional invoicing records, it has the advantage of being very easy to work with since it is easy to see that the sum total of the three invoicing records adds up to what it should.

OPTION 2. Substitutive invoice (F3)

An alternative way to perform the same operation is to do it in a single step by creating an invoicing record with tipo_factura equal to F3 (substitutive of simplified invoice). Below is an example of the JSON that should be sent.

As you can see, the series and number of the substitutive invoice are different from the original simplified invoice. Using the field facturas_sustituidas, the invoices being substituted are indicated. In general, this field is an array type since it can reference multiple invoices.

/verifactu/create
{
  "serie": "SUSTITUTIVA",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F3",
  "descripcion": "Operation description",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "facturas_sustituidas": [
    {
      "serie": "SIMPLE",
      "numero": "1",
      "fecha_expedicion": "19-12-2024"
    }
  ],
  "importe_total": "242"
}

Corrective invoices

Corrective invoices are essential documents for correcting errors or modifying data on previous invoices. In the Verifactu API, the creation of a corrective invoice requires indicating the type of corrective invoice through the field tipo_factura. There are five options, each based on specific articles of the VAT Act (Law 37/1992) and its regulations.

R1 – Corrective Invoice (Error based on law and Art. 80 One, Two and Six LIVA)

When there has been an error based on law or any of the causes of Art. 80.One, Two and Six LIVA (return of goods, discounts or price alterations after the transaction, resolution of transactions, provisional consideration amount), a corrective invoice must be issued with a specific series whose information will be recorded with the invoice type R1.

In the case of returns of goods or packaging carried out in connection with a subsequent supply to the same recipient and tax rate, it will not be necessary to issue a corrective invoice; instead, the amount of the returned goods or packaging will be subtracted from the amount of that subsequent transaction, and the result may be positive or negative.

The transaction date should be the date on which the delivery was made or the service was provided, as indicated on the original invoice. In the case of correcting multiple invoices with a single corrective invoice, the most recent date should be indicated.

R2: Corrective Invoice (Art. 80.Three, insolvency proceedings)

When there has been a modification of the VAT taxable base because the client is in insolvency proceedings (Art. 80.Three LIVA), a corrective invoice must be issued with a specific series whose information will be recorded with the invoice type R2.

Additionally, the type of corrective invoice must be identified with the keys "S – by substitution" or "I – by difference" depending on how the business owner wishes to carry out the correction.

The transaction date should be the date on which the delivery was made or the service was provided, as indicated on the original invoice. In the case of correcting multiple invoices with a single corrective invoice, the most recent date should be indicated.

The identification of the corrected invoices is optional. If they are identified, the number and date of issuance must be reported.

R3: Corrective Invoice (Art. 80.Four, bad debt)

When there has been a modification of the VAT taxable base due to non-collection from the client (Art. 80.Four LIVA), a corrective invoice must be issued with a specific series whose information will be recorded with the invoice type R3.

Additionally, the type of corrective invoice must be identified with the keys "S – by substitution" or "I – by difference" depending on how the business owner wishes to carry out the correction.

The transaction date should be the date on which the delivery was made or the service was provided, as indicated on the original invoice. In the case of correcting multiple invoices with a single corrective invoice, the most recent date should be indicated.

The identification of the corrected invoices is optional. If they are identified, the number and date of issuance must be reported.

R4: Corrective Invoice (Other)

Invoice type R4 should be used in these situations:

R5: Corrective Invoice for simplified invoices

The correction of a simplified invoice will be recorded with the key R5 regardless of the reason for the correction.

Corrective invoices by substitution

As with the exchange invoice, we have the option to perform the correction in two different ways: in two steps, or in one step.

It might seem more convenient to perform the correction in a single step since you save one invoicing record. However, the advantage of performing the correction in two steps is that the sum of the importe_total field of all invoicing records gives the final total balance. With the one-step correction, it is necessary to take into account the values of the fields base_rectificada and cuota_rectificada to obtain the total balance, which can complicate the implementation. In any case, both methods are possible and equally valid for the AEAT.

Below we show several examples of corrective invoices by substitution. In all of them we will provide the JSON corresponding to the correction using both methods described above: the two-step correction and the one-step correction.

EXAMPLE 1: Change of the taxable base

Suppose a standard invoice is issued with a taxable base of €1,000 and a tax rate of 21%, with a transaction date of 01-04-2025 and an issuance date of 07-04-2025. That is, using the Verifactu API, the invoice is registered with the following JSON:

/verifactu/create
{
  "serie": "A",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "F1",
  "descripcion": "Original invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "210"
    }
  ],
  "importe_total": "1210"
}

After issuing this invoice, a correction is desired consisting of a decrease of the taxable base of 200 euros. Below we show the JSONs needed to perform the substitution using both options: two-step correction and one-step correction.

Change of the taxable base – Two-step correction

Using the two-step correction option, two additional invoicing records are issued to perform the correction. In the first, a negative invoice is issued with a taxable base of -€1,000:

/verifactu/create
{
  "serie": "A",
  "numero": "2",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Negative invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "-1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-210"
    }
  ],
  "importe_total": "-1210"
}

In the second invoicing record, a corrective invoice is issued with a taxable base of €800. Note that the fields base_rectificada and cuota_rectificada are zero.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "S",
  "descripcion": "Correction by substitution in two steps",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "800",
      "tipo_impositivo": "21",
      "cuota_repercutida": "168"
    }
  ],
  "importe_total": "968",
  "importe_rectificativa": {
    "base_rectificada": "0",
    "cuota_rectificada": "0"
  },
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

As can be seen, the sum of the three invoicing records is 1210 + (-1210) + 968 = 968, which corresponds to the desired total amount. This is the advantage of performing the correction in two steps — its interpretation is very clear.

Change of the taxable base – One-step correction

Suppose that, instead of issuing a negative invoice followed by the corrective invoice, we wanted to perform the correction with a single invoicing record. This can be done simply by issuing a corrective invoice with a taxable base of €800 and with the fields base_rectificada and cuota_rectificada equal to the value of the invoice being corrected.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "2",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "S",
  "descripcion": "Correction by substitution in one step",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "800",
      "tipo_impositivo": "21",
      "cuota_repercutida": "168"
    }
  ],
  "importe_total": "968",
  "importe_rectificativa": {
    "base_rectificada": "1000",
    "cuota_rectificada": "210"
  },
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

In this case, as can be seen, it is necessary to take into account the fields base_rectificada and cuota_rectificada to calculate the final balance of the operation.

EXAMPLE 2: Decrease of the taxable base due to non-payment

Suppose a standard invoice is issued with a taxable base of €1,000 and a tax rate of 21%, with a transaction date of 01-04-2025 and an issuance date of 07-04-2025. That is, using the Verifactu API, the invoice is registered with the following JSON:

/verifactu/create
{
  "serie": "A",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "F1",
  "descripcion": "Original invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "210"
    }
  ],
  "importe_total": "1210"
}

After issuing this invoice, it will be subject to correction due to non-payment, eliminating the entirety of the output tax. Below we show the JSONs needed to perform the substitution using both options: two-step correction and one-step correction.

Decrease of the taxable base due to non-payment – Two-step correction

Using the two-step correction option, two additional invoicing records are issued to perform the correction. In the first, a negative invoice is issued with a taxable base of -€1,000 and a tax rate of 21%:

/verifactu/create
{
  "serie": "A",
  "numero": "2",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Negative invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "-1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-210"
    }
  ],
  "importe_total": "-1210"
}

In the second invoicing record, a corrective invoice is issued with a taxable base of €1,000. Note that the fields base_rectificada and cuota_rectificada are zero.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "3",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "S",
  "descripcion": "Correction by substitution in two steps",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "0",
      "cuota_repercutida": "0"
    }
  ],
  "importe_total": "1000",
  "importe_rectificativa": {
    "base_rectificada": "0",
    "cuota_rectificada": "0"
  },
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

Decrease of the taxable base due to non-payment – One-step correction

Suppose that, instead of issuing a negative invoice followed by the corrective invoice, we wanted to perform the correction with a single invoicing record. This can be done simply by issuing a corrective invoice with a taxable base of €1,000, output tax equal to zero and with the fields base_rectificada and cuota_rectificada equal to the value of the invoice being corrected.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "4",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "S",
  "descripcion": "Correction by substitution in one step",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "0",
      "cuota_repercutida": "0"
    }
  ],
  "importe_total": "1000",
  "importe_rectificativa": {
    "base_rectificada": "1000",
    "cuota_rectificada": "210"
  },
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

Corrective invoices by difference

A corrective invoice by difference corrects errors in an original invoice by adjusting the amount through addition or subtraction. It can be positive (if undercharged) or negative (if overcharged). It is mainly used for errors in VAT or in the taxable base. Depending on the type of error (due to non-payment or not), one may opt for a corrective invoice by difference or by substitution, following different procedures.

Unlike corrective invoices by substitution, corrective invoices by difference are always done in a single step and the amount of the correction must be reported directly.

Below we show several examples of corrective invoices by difference.

EXAMPLE 1: Change of the taxable base

Suppose a standard invoice is issued with a taxable base of €1,000 and a tax rate of 21%, with a transaction date of 01-04-2025 and an issuance date of 07-04-2025. That is, using the Verifactu API, the invoice is registered with the following JSON:

/verifactu/create
{
  "serie": "A",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "F1",
  "descripcion": "Original invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "210"
    }
  ],
  "importe_total": "1210"
}

After issuing this invoice, a correction is desired consisting of a decrease of the taxable base of €500. The modification by difference would involve issuing a single additional invoice with a taxable base of -€500.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "5",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "I",
  "descripcion": "Operation description: correction by differences",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "-500",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-105"
    }
  ],
  "importe_total": "-605",
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

EXAMPLE 2: Decrease of the taxable base due to non-payment

Suppose a standard invoice is issued with a taxable base of €1,000 and a tax rate of 21%, with a transaction date of 01-04-2025 and an issuance date of 07-04-2025. That is, using the Verifactu API, the invoice is registered with the following JSON:

/verifactu/create
{
  "serie": "A",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "fecha_operacion": "01-04-2025",
  "tipo_factura": "F1",
  "descripcion": "Original invoice",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "21",
      "cuota_repercutida": "210"
    }
  ],
  "importe_total": "1210"
}

After issuing this invoice, a correction is desired due to non-payment, eliminating the entirety of the output tax. The modification by difference would involve issuing a single additional invoice with a taxable base of €0 and output tax of -€210.

/verifactu/create
{
  "serie": "RECTIFICATIVA",
  "numero": "6",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "Rx",
  "tipo_rectificativa": "I",
  "descripcion": "Operation description: correction by differences for non-payment",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "0",
      "tipo_impositivo": "21",
      "cuota_repercutida": "-210"
    }
  ],
  "importe_total": "-210",
  "facturas_rectificadas": [
    {
      "serie": "A",
      "numero": "1",
      "fecha_expedicion": "07-04-2025"
    }
  ]
}

Invoice with equivalence surcharge

The equivalence surcharge is a special VAT regime for retailers who sell products without transformation. It consists of paying an additional surcharge to suppliers, depending on the VAT rate of the product.

This surcharge must be included in the invoice, which serves as proof that the transaction has been carried out in accordance with the law. To do this, the retailer must inform the supplier that they are taxed under this regime. In the Verifactu API, this is done by setting the field clave_regimen=18 on the line, as shown in our documentation.

The applicable surcharges are reported in the field tipo_recargo_equivalencia of each line and are:

An example JSON is:

/verifactu/create
{
  "serie": "RECARGO",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Operation description",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42",
      "clave_regimen": "18",
      "tipo_recargo_equivalencia": "5.2",
      "cuota_recargo_equivalencia": "10.4"
    }
  ],
  "importe_total": "252.4"
}

Invoice issued by third parties

An invoice issued by third parties is an invoice that, although the services or products are provided by a company or professional, the document is issued by an authorized third party. The company remains legally responsible, and its data must appear on the invoice.

To issue an invoice issued by third parties using our API, you must use the field emitida_por_tercero_o_destinatario with a value equal to T along with the third party's name and NIF.

Suppose a company with NIF B12345678 provides a service to a client with NIF A15022510 but it is NIF B86561412 that issues the invoice. In that case, the correct JSON would be:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Invoice issued by third parties",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "especial": {
    "emitida_por_tercero_o_destinatario": "T",
    "nombre_tercero": "Nombre tercero",
    "nif_tercero": "B86561412"
  },
  "importe_total": "242"
}

The NIF of the company that provides the services does not appear in the JSON because this is already determined by the API key used to make the request.

Invoice issued by the recipient

This is an invoice that is not generated by the supplier, but by the client themselves (the recipient of the service or product). Although the client issues it, the legal responsibility remains with the supplier, whose data must appear on the invoice.

To issue an invoice issued by the recipient using our API, you must use the field emitida_por_tercero_o_destinatario with a value equal to D. For example, you can use this JSON:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Invoice issued by recipient",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "especial": {
    "emitida_por_tercero_o_destinatario": "D"
  },
  "importe_total": "242"
}

Invoice under the special regime for used goods (REBU)

The REBU is the voluntary VAT regime applicable to companies and self-employed individuals who trade in used goods, art objects, or antiques. Its main advantage lies in reducing the tax burden, as it allows the tax to be settled based solely on the resale margin rather than the final product price.

Let us see how to issue a REBU invoice using our API through an example. Suppose a used good is sold with a sale price of €3,000 and an acquisition cost of €2,000. The profit margin would then be €1,000. If the applicable tax rate is 21%, the taxable base and output tax are calculated as follows:

It should be noted that the total amount to be indicated on the invoice is the total sale price, that is, €3,000 in this example. Normally, a validation is performed to ensure that the sum of the taxable bases and output taxes of all lines matches the total amount. However, in the case of REBU invoices, this validation is not applied, since the total amount is based on the sale price.

To avoid this validation, it is necessary to indicate that the invoice is issued under the special regime for used goods (REBU). To do this, in each line of the invoice detail, the field clave_regimen with a value equal to 03 must be used.

Below we show the complete JSON to register this REBU invoice using our API:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Invoice under special scheme for used goods (REBU)",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "lineas": [
    {
      "base_imponible": "826.45",
      "tipo_impositivo": "21",
      "cuota_repercutida": "173.55",
      "clave_regimen": "03"
    }
  ],
  "importe_total": "3000"
}

Invoice with reverse charge

Reverse charge is a special VAT mechanism in which the responsibility for settling the tax falls on the recipient of the transaction (the buyer) instead of the issuer (the seller). This regime applies to certain specific operations such as construction works, deliveries of gold, mobile phones, video game consoles, laptops and tablets, among other cases regulated by VAT regulations.

To create an invoice with reverse charge, the field calificacion_operacion is used with the value S2 (Subject and non-exempt operation - with reverse charge). In this type of invoice, the tax rate and tax amount must be set to 0, as it will be the recipient who must self-assess the corresponding VAT.

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "12-03-2026",
  "tipo_factura": "F1",
  "descripcion": "Invoice with reverse charge",
  "nif": "A15022510",
  "nombre": "Recipient Name",
  "lineas": [
    {
      "base_imponible": "1000",
      "tipo_impositivo": "0",
      "cuota_repercutida": "0",
      "calificacion_operacion": "S2"
    }
  ],
  "importe_total": "1000"
}

As can be seen, the total amount matches the taxable base, since VAT is not passed on in the invoice.

Invoice cancellation

A previously sent registration record that is no longer valid will be cancelled by means of a cancellation invoicing record identifying the number of the original invoice. This can be done using the endpoint /verifactu/cancel.

It is important to understand that cancellation should not be used to cancel invoices issued with errors, but rather for invoices issued by mistake. If an invoice has been issued with an error that needs to be corrected, a new corrective invoice must be issued that references the original invoice.

If an invoice has been issued by mistake, it can be cancelled using a JSON like the one shown below.

/verifactu/cancel
{
  "serie": "A",
  "numero": "1",
  "fecha_expedicion": "25-02-2025"
}

In the event that a new correct invoice needs to be issued, it must be registered with a new record using a different invoice number or issuance date.

Invoice amendment

The Verifactu API contains the endpoint /verifactu/modify which corresponds to the operation that the administration calls "amendment" of an invoicing record.

The cases in which this endpoint can be used are very limited, so it should be considered an extraordinary operation. It is very rare to find yourself in a situation where you need to (or can) perform this operation. Despite what the name might suggest, this has nothing to do with corrective invoices.

This endpoint can only be used to amend invoicing records in those cases where the amendment has no fiscal impact, which greatly limits its use.

Below we include the three examples in which this endpoint can be used, controlled by the field rechazo_previo, which make it clear that this is not something that will be done on a regular basis.

Amendment of an accepted record

Suppose we send the following invoicing record, which we will call Record A, and it has been correctly accepted by the Tax Agency:

/verifactu/create
{
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "24-02-2025",
  "tipo_factura": "F1",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "descripcion": "Descripcion inicial",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

If we now wanted to modify, for example, the amount, we would need to issue a corrective invoice, as explained in other examples. However, if we wanted to change the descripcion field of the invoice, then a new invoicing record can be sent to the endpoint /verifactu/modify setting the field rechazo_previo=N since the original invoicing record was not rejected. Therefore, the JSON for the amendment record, which we will call Record B, would be as follows:

/verifactu/modify
{
  "rechazo_previo": "N",
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "24-02-2025",
  "tipo_factura": "F1",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "descripcion": "Modified description",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

Amendment of a rejected record

Suppose now that the initial invoice from the previous paragraph (Record A) had been rejected by the AEAT because the certificate used to send it was not valid. In that case, the invoicing record would be rejected and a new amendment record would need to be generated by setting the field rechazo_previo=X.

/verifactu/modify
{
  "rechazo_previo": "X",
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "24-02-2025",
  "tipo_factura": "F1",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "descripcion": "Initial description",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

Amendment of a rejected amendment record

Suppose now that the initial invoice from the previous paragraph (Record A) had been accepted correctly and, instead, the subsequent amendment record (Record B) had been rejected. In that case, we should generate and send a new amendment record, setting the field rechazo_previo=S.

/verifactu/modify
{
  "rechazo_previo": "S",
  "serie": "Ejemplos",
  "numero": "1",
  "fecha_expedicion": "24-02-2025",
  "tipo_factura": "F1",
  "nif": "A15022510",
  "nombre": "Recipient name",
  "descripcion": "Modified description",
  "lineas": [
    {
      "base_imponible": "200",
      "tipo_impositivo": "21",
      "cuota_repercutida": "42"
    }
  ],
  "importe_total": "242"
}

As can be seen, due to the limitation that amendments must have no fiscal impact, the amendment endpoint /verifactu/modify has very few use cases.