Skip to main content

Introduction

Facturae is Spainโ€™s official XML invoice format for Business-to-Government (B2G) transactions. The current version is Facturae 3.2.2, and invoices are submitted to public administrations through the FACe platform. Facturae is required when invoicing any Spanish public administration body (central government, regional governments, local councils, etc.). Unlike other Spanish tax reporting systems (VERI*FACTU, SII), Facturae does not require supplier registration โ€” you simply generate the XML and submit it.

Prerequisites

To generate Facturae invoices, ensure you have:
  • An invoice with:
    • Supplier details (company name, tax ID, full address). Check the Spanish regime for specifics.
    • Line items with name, price, and applicable taxes.

Facturae Setup

To generate Facturae invoices, follow these instructions in the Invopop Console:
1

Connect the Spain app

  1. Navigate to Configuration โ†’ Apps.
  2. Locate Spain in the app discovery list.
  3. Click Connect to activate.
No additional configuration is needed.
2

Configure invoice workflow

Administrative Centers (DIR3 Codes)

When invoicing Spanish public administrations via FACe, you must include three administrative centers identified by their DIR3 codes. Each public body publishes these codes in the DIR3 directory.
The three required roles and their corresponding GOBL fields are:
Facturae RoleCodeGOBL Field
Oficina Contable (Accounting Office)01customer.identities[] with scope: "tax"
ร“rgano Gestor (Managing Body)02delivery.receiver.identities[0]
Unidad Tramitadora (Processing Unit)03ordering.buyer.identities[0]
See the FACe example below for a complete invoice with all three administrative centers.

Running

Use the following example GOBL documents to generate Facturae invoices.
A standard Facturae invoice from a Spanish supplier to a Spanish business customer.Notice:
  • the es-facturae-v3 addon is required,
  • the es-facturae-doc-type and es-facturae-invoice-class tax extensions must be set,
  • both supplier and customer must have full address details and valid Spanish tax IDs.
Facturae B2G Invoice

{
	"$schema": "https://gobl.org/draft-0/bill/invoice",
	"$regime": "ES",
	"$addons": [
		"es-facturae-v3"
	],
	"uuid": "01922b1e-e288-7ab9-82f3-0c8c8c7956bc",
	"type": "standard",
	"code": "TEST01001F",
	"issue_date": "2021-12-08",
	"currency": "EUR",
	"tax": {
		"ext": {
			"es-facturae-doc-type": "FC",
			"es-facturae-invoice-class": "OO"
		}
	},
	"supplier": {
		"name": "Hypeprop Sl",
		"alias": "Hypeprop",
		"tax_id": {
			"country": "ES",
			"code": "B23103039"
		},
		"people": [
			{
				"name": {
					"given": "Paloma",
					"surname": "Araujo"
				}
			}
		],
		"addresses": [
			{
				"num": "74",
				"street": "Campo Real",
				"locality": "Torrejรณn De La Calzada",
				"region": "Madrid",
				"code": "28023",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "rxazy27xfc@iname.com"
			}
		],
		"telephones": [
			{
				"label": "office",
				"num": "+34910730028"
			}
		]
	},
	"customer": {
		"name": "Moniward Sl",
		"tax_id": {
			"country": "ES",
			"code": "B77436020"
		},
		"addresses": [
			{
				"num": "35",
				"street": "Plaza Horno",
				"locality": "Nombela",
				"region": "Toledo",
				"code": "45083",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "bfn25xf3p@lycos.co.uk"
			}
		]
	},
	"lines": [
		{
			"i": 1,
			"quantity": "20",
			"item": {
				"name": "Operations and development - day rate",
				"price": "200.00"
			},
			"sum": "4000.00",
			"taxes": [
				{
					"cat": "VAT",
					"rate": "standard",
					"percent": "21.0%"
				}
			],
			"total": "4000.00"
		},
		{
			"i": 2,
			"quantity": "2",
			"item": {
				"name": "Additional Overtime",
				"price": "101.00"
			},
			"sum": "202.00",
			"taxes": [
				{
					"cat": "VAT",
					"rate": "standard",
					"percent": "21.0%"
				}
			],
			"total": "202.00"
		}
	],
	"payment": {
		"terms": {
			"key": "due-date",
			"due_dates": [
				{
					"date": "2021-12-30",
					"amount": "5084.42",
					"percent": "100%"
				}
			],
			"notes": "Some kind of payment term note"
		},
		"instructions": {
			"key": "credit-transfer",
			"credit_transfer": [
				{
					"iban": "ES25 0188 2570 7185 4470 4761",
					"name": "Bankrandom"
				}
			]
		}
	},
	"totals": {
		"sum": "4202.00",
		"total": "4202.00",
		"taxes": {
			"categories": [
				{
					"code": "VAT",
					"rates": [
						{
							"key": "standard",
							"base": "4202.00",
							"percent": "21.0%",
							"amount": "882.42"
						}
					],
					"amount": "882.42"
				}
			],
			"sum": "882.42"
		},
		"tax": "882.42",
		"total_with_tax": "5084.42",
		"payable": "5084.42"
	},
	"notes": [
		{
			"key": "general",
			"text": "Thank you for your custom!"
		}
	]
}
A corrective invoice (credit note) referencing a previous Facturae invoice.Notice:
  • the type is set to credit-note,
  • a preceding entry references the original invoice with the es-facturae-correction code,
  • the es-facturae-invoice-class is set to OR (rectificativa).
Facturae Credit Note
{
	"$schema": "https://gobl.org/draft-0/bill/invoice",
	"$regime": "ES",
	"$addons": [
		"es-facturae-v3"
	],
	"uuid": "01922b1e-e283-7860-96aa-c57af9ffe67b",
	"type": "credit-note",
	"code": "TEST01001R",
	"issue_date": "2021-12-08",
	"currency": "EUR",
	"preceding": [
		{
			"type": "standard",
			"issue_date": "2021-12-08",
			"code": "TEST01001F",
			"ext": {
				"es-facturae-correction": "01"
			}
		}
	],
	"tax": {
		"ext": {
			"es-facturae-doc-type": "FC",
			"es-facturae-invoice-class": "OR"
		}
	},
	"supplier": {
		"name": "Hypeprop Sl",
		"alias": "Hypeprop",
		"tax_id": {
			"country": "ES",
			"code": "B23103039"
		},
		"people": [
			{
				"name": {
					"given": "Paloma",
					"surname": "Araujo"
				}
			}
		],
		"addresses": [
			{
				"num": "74",
				"street": "Campo Real",
				"locality": "Torrejรณn De La Calzada",
				"region": "Madrid",
				"code": "28023",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "rxazy27xfc@iname.com"
			}
		],
		"telephones": [
			{
				"label": "office",
				"num": "+34910730028"
			}
		]
	},
	"customer": {
		"name": "Moniward Sl",
		"tax_id": {
			"country": "ES",
			"code": "B77436020"
		},
		"addresses": [
			{
				"num": "35",
				"street": "Plaza Horno",
				"locality": "Nombela",
				"region": "Toledo",
				"code": "45083",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "bfn25xf3p@lycos.co.uk"
			}
		]
	},
	"lines": [
		{
			"i": 1,
			"quantity": "20",
			"item": {
				"name": "Operations and development - day rate",
				"price": "200.00"
			},
			"sum": "4000.00",
			"taxes": [
				{
					"cat": "VAT",
					"rate": "standard",
					"percent": "21.0%"
				}
			],
			"total": "4000.00"
		},
		{
			"i": 2,
			"quantity": "2",
			"item": {
				"name": "Additional Overtime",
				"price": "101.00"
			},
			"sum": "202.00",
			"taxes": [
				{
					"cat": "VAT",
					"rate": "standard",
					"percent": "21.0%"
				}
			],
			"total": "202.00"
		}
	],
	"totals": {
		"sum": "4202.00",
		"total": "4202.00",
		"taxes": {
			"categories": [
				{
					"code": "VAT",
					"rates": [
						{
							"key": "standard",
							"base": "4202.00",
							"percent": "21.0%",
							"amount": "882.42"
						}
					],
					"amount": "882.42"
				}
			],
			"sum": "882.42"
		},
		"tax": "882.42",
		"total_with_tax": "5084.42",
		"payable": "5084.42"
	},
	"notes": [
		{
			"key": "general",
			"text": "Thank you for your custom!"
		}
	]
}
An invoice addressed to a public administration via the FACe platform, including the three required DIR3 administrative centers.Notice:
  • the customer includes an identity with scope: "tax" for the Oficina Contable (DIR3 code 01),
  • delivery.receiver includes the ร“rgano Gestor identity (DIR3 code 02),
  • ordering.buyer includes the Unidad Tramitadora identity (DIR3 code 03),
  • each public body publishes their DIR3 codes โ€” look them up in the DIR3 directory.
Facturae FACe Invoice (B2G with Admin Centers)
{
	"$schema": "https://gobl.org/draft-0/bill/invoice",
	"$regime": "ES",
	"$addons": [
		"es-facturae-v3"
	],
	"type": "standard",
	"code": "TEST01002F",
	"issue_date": "2021-12-08",
	"currency": "EUR",
	"tax": {
		"ext": {
			"es-facturae-doc-type": "FC",
			"es-facturae-invoice-class": "OO"
		}
	},
	"supplier": {
		"name": "Hypeprop Sl",
		"alias": "Hypeprop",
		"tax_id": {
			"country": "ES",
			"code": "B23103039"
		},
		"people": [
			{
				"name": {
					"given": "Paloma",
					"surname": "Araujo"
				}
			}
		],
		"addresses": [
			{
				"num": "74",
				"street": "Campo Real",
				"locality": "Torrejรณn De La Calzada",
				"region": "Madrid",
				"code": "28023",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "rxazy27xfc@iname.com"
			}
		],
		"telephones": [
			{
				"label": "office",
				"num": "+34910730028"
			}
		]
	},
	"customer": {
		"name": "Ayuntamiento de Madrid",
		"tax_id": {
			"country": "ES",
			"code": "P2807900B"
		},
		"identities": [
			{
				"scope": "tax",
				"code": "L01280796"
			}
		],
		"addresses": [
			{
				"num": "4",
				"street": "Plaza de la Villa",
				"locality": "Madrid",
				"region": "Madrid",
				"code": "28005",
				"country": "ES"
			}
		],
		"emails": [
			{
				"addr": "facturacion@madrid.es"
			}
		]
	},
	"delivery": {
		"receiver": {
			"name": "Concejalรญa de Hacienda",
			"identities": [
				{
					"code": "LA0007407"
				}
			],
			"addresses": [
				{
					"num": "3",
					"street": "Calle Alcalรก",
					"locality": "Madrid",
					"region": "Madrid",
					"code": "28014",
					"country": "ES"
				}
			]
		}
	},
	"ordering": {
		"buyer": {
			"name": "Departamento de Compras",
			"identities": [
				{
					"code": "LA0007408"
				}
			],
			"addresses": [
				{
					"num": "10",
					"street": "Gran Vรญa",
					"locality": "Madrid",
					"region": "Madrid",
					"code": "28013",
					"country": "ES"
				}
			]
		}
	},
	"lines": [
		{
			"quantity": "20",
			"item": {
				"name": "Services rendered",
				"price": "200.00"
			},
			"taxes": [
				{
					"cat": "VAT",
					"rate": "standard"
				}
			]
		}
	],
	"payment": {
		"terms": {
			"key": "due-date",
			"due_dates": [
				{
					"date": "2021-12-30",
					"amount": "4840.00",
					"percent": "100%"
				}
			]
		},
		"instructions": {
			"key": "credit-transfer",
			"credit_transfer": [
				{
					"iban": "ES25 0188 2570 7185 4470 4761",
					"name": "Bankrandom"
				}
			]
		}
	}
}
In your invoice data, make sure to include the es-facturae-v3 addon and set the regime to ES.
Once you have saved in Invopop, select Run workflow and select โ€œFacturae Generate Invoiceโ€ from the sidebar.

Spain FAQ

Find answers to frequently asked questions about invoicing in Spain โ†’

Participate in our community

Ask and answer questions about invoicing in Spain โ†’