Skip to content
digitapulia.com

Selling into Italy and Spain: the e-invoicing rules your ERP has to meet

What Italy and Spain each require of an invoice between businesses, what changes in Spain in 2027 and 2028, and what your ERP has to do to meet both.

· 25 min read

A telephone patch panel in close-up, rows of grey terminal blocks, with blue and white wires punched into the first one.
Photo: Dennis van Zuijlekom · CC BY-SA 2.0

If your group sells in Italy and in Spain, the invoices of the two countries probably travel very differently. In Italy they leave the ERP, pass through the Sistema di Interscambio (the SdI, the exchange system run by the Italian tax authority) and reach the customer without anyone touching them. For Spain, someone may open another program, copy the details of each invoice, save it in the format the customer asked for and send it by email. When a customer sends an invoice back because of a wrong detail, the error surfaces late. And the invoices that arrive from Spanish suppliers are keyed into the group’s system by hand, field by field.

The two companies hold the same data, but each country asks for it through a different channel, in a different format, under rules that change on different dates. Until someone writes down what the ERP itself has to produce for each of those channels, copying by hand is what is left.

This piece does three things. It sets out what each country requires of an invoice between businesses today, as the official texts say it. It explains what changes in Spain, with the dates now written for the regulation on invoicing systems, known as VERI*FACTU, and for the mandatory e-invoice between businesses. And it turns both into a list of things your ERP has to be able to do, so that the invoices of both companies come out of one system and the ones you receive go into it by themselves.

A warning before we start: this is not tax advice. Which tax applies to each transaction, and whether a rule reaches one of your companies, is for your tax adviser to say. What follows is the systems side: formats, channels, dates and data.

What Italy requires: an e-invoice that goes through the SdI

In Italy the rule is in Article 1, paragraph 3, of Legislative Decree 127/2015. For supplies of goods and services between parties resident or established in Italy, and for their later corrections, only electronic invoices are issued, through the SdI and in the format the law sets. The same paragraph lets businesses use intermediaries to send their invoices to the SdI, by agreement between the parties; the responsibility stays with whoever supplies the goods or the service.

The format is the FatturaPA, an XML file described in the technical specifications published on fatturapa.gov.it. The specifications valid from 1 April 2025 are version 1.4; the XML schema they describe is version 1.2.3. Each invoice has a header, with the transmission data, the seller and the buyer, and a body, with the general data, the lines, the payments and any attachments.

Two fields explain most of what follows.

The recipient code

The CodiceDestinatario field tells the SdI where to deliver the invoice. For a business customer it has seven characters. It is either a code the SdI assigns to whoever has accredited a receiving channel and asked for one, the customer or its intermediary, or a fixed value. The specifications use 0000000 when the customer receives by certified email (PEC), whose address then goes in its own field, and also when the customer’s channel is not known.

The document type

The TipoDocumento field says what the file is: TD01 is an invoice, TD04 a credit note, TD05 a debit note, and the list goes on with the integration documents (most of them generated by an Italian buyer from a foreign supplier’s invoice) and self-billed invoices.

If your Italian company already invoices this way, with the ERP generating the XML, an intermediary sending it to the SdI and the SdI delivering it to the customer, the work left is not in Italy. It is in what happens when the invoice crosses the border.

A customer in Spain and seven Xs: the SdI receives the data but does not deliver the invoice

The same decree, in Article 1, paragraph 3-bis, deals with transactions with parties not established in Italy. Italian businesses send the Italian tax authority, the Agenzia delle Entrate, the data of their sales to and purchases from parties not established in Italy, with some exceptions the text lists. For transactions from 1 July 2022 onwards, that data goes through the SdI, in the same format as the e-invoice. There are two deadlines:

  • Sales to a customer not established in Italy: the data is sent within the deadlines for issuing the invoice.
  • Purchases from a supplier not established in Italy: the data is sent by the fifteenth day of the month after the one in which the document was received or the transaction took place.

For sales, the FatturaPA specifications set a fixed recipient code: XXXXXXX, seven Xs, for invoices issued to parties not resident, not established and not identified in Italy, sent to the SdI to transmit their data.

This is where an important detail hides. The Agenzia delle Entrate made it explicit in its Circular 26/E of 13 July 2022: when that code is used, the SdI does not deliver the file to the customer. The file reaches the Italian tax authority, which now knows about the sale, but your customer in Spain receives nothing through that route. The invoice has to reach them some other way. The same circular states the other case: if the Italian company issues the e-invoice through the SdI with a recipient code the customer has given it, and with a country code other than IT, that invoice also fulfils the duty to send the data.

Put plainly: if your Spanish customer has not given you an SdI recipient code and you use the seven Xs, one sale by the Italian company produces two outputs today. The seven-X file goes to the SdI, and the invoice the customer actually receives goes out in the format and through the channel the customer accepts. If the ERP can only produce the first, someone prepares the second by hand. This is where the double work starts.

The invoices of a subsidiary in Spain are another matter. They are Spanish invoices, and that is where the calendar is moving.

What Spain requires: the Crea y Crece law and its regulation

In Spain, the duty to e-invoice between businesses comes from Law 18/2022 of 28 September, on the creation and growth of companies, known as «Crea y Crece». Its Article 12 rewrites Article 2 bis of Law 56/2007, on measures to promote the information society. Its first paragraph now reads: all businesses and professionals must issue, send and receive electronic invoices in their commercial dealings with other businesses and professionals, and both the recipient and the issuer must provide information on the status of the invoice.

The law set no direct date. Its eighth final provision tied the effects to the implementing regulation: one year after the regulation’s approval for businesses invoicing more than eight million euros a year, two years after it for the rest; and it made the entry into force of Article 12 subject to Spain obtaining from the European Union a derogation from Articles 218 and 232 of the VAT Directive. The AEAT’s calendar, below, states the dates without that condition.

The regulation is Royal Decree 238/2026 of 25 March, which develops the mandatory e-invoicing system between businesses and professionals. It defers its own application too: its periods run from the entry into force of a ministerial order regulating the public e-invoicing solution. That order is Order HAC/1028/2026 of 2 October. According to the calendar published by the Spanish tax agency, the Agencia Tributaria (AEAT), it came into force on 6 October 2026, and the periods run from that date:

  • 6 October 2027: the duty to issue and receive e-invoices applies to businesses and professionals whose volume of operations for VAT purposes exceeded eight million euros in the previous calendar year.
  • 6 October 2028: it applies to all other businesses and professionals.

The duty to report invoice and payment statuses has a calendar of its own: 6 October 2027 for the same large businesses, 6 October 2028 for the other legal persons and entities, and 6 October 2029 for the other natural persons and entities taxed under the attribution-of-income regime.

For the twelve months after 6 October 2027, businesses over eight million euros must send a PDF with each e-invoice to make it legible, unless the recipient voluntarily and expressly agrees to receive invoices in their original format only. That PDF goes to the recipient by any means, and never to the public solution.

What a Spanish e-invoice looks like: formats, platforms and statuses

For anyone designing a system, what matters in Royal Decree 238/2026 fits into five points.

Who it applies to

Article 3 says that businesses and professionals required to issue an invoice under Spain’s invoicing regulation, Royal Decree 1619/2012, must do so electronically when the recipient is a business or professional with its seat of economic activity, a permanent establishment or, failing those, its domicile or habitual residence in Spain, as long as the transaction is addressed there. Article 4 excludes simplified invoices, unless they are qualified simplified invoices.

The format

Article 7 asks for a structured message that follows the EN 16931 semantic data model of the European Committee for Standardization, in one of four syntaxes: CII, UBL, the EDIFACT invoice message or the Facturae message. The Italian FatturaPA is not on the list. Your invoices will therefore have to reach two different formats, one for each country, whether the ERP produces both or a platform transforms them.

The routes

Article 5 describes the Spanish e-invoicing system as the set of private exchange platforms that meet the decree’s requirements, plus the public e-invoicing solution, run by the AEAT, which also acts as a repository of every invoice. A business may use a private platform, the public solution, or both. Article 6 adds a default: a business that has not expressly agreed with its suppliers to receive invoices through one or more private platforms is taken to have chosen the public solution. A business that receives through a private platform must publish its entry point in its communications with other businesses and, if it has one, on its website. Platforms and invoicing systems that do not use the public solution to issue must send it, at the moment of issue, a faithful copy of each invoice in UBL. And Law 56/2007 adds a protection for the issuer: the recipient cannot oblige it to use a particular solution, platform or provider.

The signature and the unique code

Invoices issued through private platforms must carry an advanced electronic signature, the issuer’s own or a delegated one. Every e-invoice is identified by a unique code, which must include the issuer’s tax identification number, the invoice’s number and series, and its date of issue.

The statuses

Article 12 requires every recipient to tell the AEAT’s public solution about the full payment of each invoice, with its date and the due date, within four calendar days of the payment, not counting Saturdays, Sundays and national holidays; or else about its rejection. If an invoice is not rejected and no corrective invoice follows, it is presumed accepted. When the invoice travels through the public solution, that is the only notice. When it travels through a private platform, Article 10 adds a second one: within four calendar days of each status, counted the same way, the recipient tells the issuer about the commercial acceptance or rejection of the invoice and its full payment, with their dates, and may also report partial acceptances, rejections and payments.

VERI*FACTU: not a format, but a rule for the program that issues the invoice

Royal Decree 1007/2023 of 5 December approves the regulation setting the requirements that invoicing systems must meet. It does not deal with how an invoice travels to the customer. It deals with the program that issues it.

E-invoiceRD 238/2026Invoicing systemsRD 1007/2023 · VERI*FACTUWHAT IT GOVERNSThe invoice between businesses:what it is and how it travelsThe program thatissues the invoiceWHAT IT PRODUCESAn EN 16931 message in CII,UBL, EDIFACT or FacturaeA record of each invoice,with its hash, and a QR codeWHERE IT GOESPrivate platforms or theAEAT's public solutionTo the AEAT (VERI*FACTU),or kept signed in the systemLEFT OUTRecipients not in Spain, andnon-qualified simplified invoicesWhoever is in the SII or has itstax domicile in a foral territoryWHEN6 Oct 2027, over 8 million;6 Oct 2028, everyone elseCorporate tax: before 1 Jan 2027;the rest: before 1 Jul 2027
The two Spanish rules side by side. The dates on the right are those of the text in force today: the ministry has announced a planned extension of the adaptation period.

Its main requirements are in Articles 8 to 12. The system must guarantee the integrity, preservation, accessibility, legibility, traceability and unalterability of the invoicing records. A record, once generated, cannot be altered: any correction or cancellation of the recorded data is made with at least one further record, so that the original data stays as it was. The records are chained, so that their trail can be followed from the first to the last, and each one carries its date and time. The system must automatically generate an invoicing record at the moment each invoice is issued, or immediately before, with a hash and, as a rule, an electronic signature. A system that does not send its records to the AEAT also keeps an event log.

Article 7 offers two routes: your own or a commercial system that meets those requirements, or the application that the tax administration itself provides. The AEAT offers a free invoicing application. A group that already invoices from a shared ERP needs that ERP itself to comply.

The name VERI*FACTU comes from Article 16. A system that sends the AEAT every invoicing record it generates, continuously, automatically and instantly, is a «Sistema de emisión de facturas verificables», a verifiable invoice system, or VERI*FACTU system. Such a system is presumed to meet the requirements of Article 8, does not need to sign the records electronically and only has to calculate their hash; according to the AEAT, it needs no event log either. The choice lasts at least until the end of the calendar year in which the first records were actually sent; according to the AEAT, that minimum does not apply during the testing period. The AEAT’s own application counts, for all purposes, as a VERI*FACTU system too.

According to the AEAT’s frequently asked questions, every invoice issued with a system bound by the regulation, VERI*FACTU or not, carries a QR code, which whoever receives it can scan with a phone to send certain data to the AEAT; in a structured e-invoice, the code’s content, a web address, takes the place of the image. If the invoice carries the words «VERI*FACTU», that check lets the recipient verify whether the issuer has sent the invoice to the AEAT (Article 17).

The dates

The regulation’s fourth final provision, as amended by Royal Decree-Law 15/2025 of 2 December, sets two deadlines. Companies paying Spanish corporate income tax (the Impuesto sobre Sociedades) must have adapted systems before 1 January 2027. The other parties listed in Article 3.1, among them individuals taxed on business activities, before 1 July 2027. The AEAT explains in its frequently asked questions that the period before those dates is a testing period, and that after them merely holding a non-adapted program able to issue invoices is an offence.

A deadline that may move

The AEAT’s page on these systems carries a «Comunicación del Ministerio de Hacienda de 05/10/2026» on the «previsión de ampliación del plazo de adaptación», a planned extension of the adaptation period. It is a plan, not a rule: as this piece is written, the Boletín Oficial del Estado (BOE) still says what is written above. If the extension is published, these dates may change, and so may the order of the calendar further down. Before you plan, check the current wording of the regulation’s fourth final provision in the BOE.

Who it applies to, and who it does not

Article 3.1 lists those bound by it: companies paying corporate income tax, individuals taxed on business activities, non-residents earning income through a permanent establishment, and entities under the attribution-of-income regime with business activities. The AEAT sums it up in what it calls the «regla de los 4 NO», the rule of the four NOs: the regulation reaches whoever is established in Spain, issues invoices with a computer system, is not in the Immediate Supply of Information system (SII), is not domiciled for tax purposes in the foral territories of the Basque Country or Navarre, and has no resolution exempting it. The SII is compulsory for, among others, large companies, which the AEAT describes as those with a turnover above six million euros; its register of large companies is defined by a volume of operations above 6,010,121.04 euros. Since that threshold is lower than the eight million of the 2027 e-invoice, a company that will have the e-invoice in 2027 will normally be in the SII and outside this regulation; your adviser will confirm it.

What your ERP has to do: the requirements, one by one

Read together, the rules of the two countries become a list of things the ERP itself has to do. Each one can be checked with the people who run the system today.

YourERPItalian company → customer in ItalyFatturaPASdICustomer in ItalyItalian company → customer in Spain, no codeXXXXXXXSdITax authorityInvoice by another channelCustomer in SpainSpanish subsidiary → customer in SpainInvoicing recordAEAT, or keptE-invoiceCustomer in SpainThrough a platform or the public solution.
One ERP, several outputs. The invoicing record exists only if Royal Decree 1007/2023 applies to the subsidiary, and reaches the AEAT only from a VERI*FACTU system; the e-invoice, only from the date that applies.

Know which company is issuing

Every invoice belongs to a company, with its own tax number, its own numbering series and its own rules. Royal Decree 1007/2023 expressly allows one computer system to serve several taxpayers in Spain, as long as each one’s invoicing records are kept separate and each one meets the requirements on its own. The Italian company and the Spanish one are two distinct issuers: each numbers in its own series, and the system knows at every moment on whose behalf it is invoicing.

Produce a FatturaPA for every Italian invoice

This is what the Italian company already does: the XML described by version 1.4 of the specifications, with the right document type and the customer’s recipient code, sent to the SdI directly or through an intermediary.

Produce both the seven-X file and the invoice the Spanish customer receives

For a sale by the Italian company to a customer in Spain who has given no SdI code, the ERP produces the file with XXXXXXX for the SdI within the deadline for issuing the invoice, and the invoice the customer receives, by the channel the customer accepts. The two are one sale, and the system keeps them linked.

Hand a Spanish e-invoice to a platform

For the Spanish company’s invoices to businesses in Spain, from the date that applies to it, the ERP hands the invoice data over once, in a format the chosen platform understands. Royal Decree 238/2026 requires private platforms to be able to transform the invoice message between all the formats accepted in Spain, preserving the authenticity of its origin and the integrity of its content. The platform produces the message each destination asks for. The FatturaPA can leave from the same platform, if it also works with the SdI.

Keep the invoicing records, or know why it does not have to

If the Spanish company is bound by Royal Decree 1007/2023, the system that issues its invoices generates the chained records with their hash and adds the QR code, or its content in a structured e-invoice; either it sends the records to the AEAT as a VERI*FACTU system, or it signs and stores them and keeps an event log. If the company is in the SII, that regulation does not apply to it, and the system has to meet the SII’s reporting instead. Either way, the answer is written down, company by company.

Bring the statuses back

Every invoice has a journey: issued, delivered, rejected, accepted, paid. In Spain, reporting the payment or rejection of what you receive becomes a duty. If those statuses stay in the platform’s portal, someone has to go and look for them. If they come back into the ERP, the administration team sees on one dashboard where each invoice stands, without asking anyone.

Take in the invoices you receive

Italy and Spain ask different things here. The Italian head office that buys from a Spanish supplier sends the data of that purchase to the SdI by the fifteenth of the following month. The FatturaPA specifications provide integration documents for these cases, among them TD17, for services bought from abroad; TD18, for goods bought from another EU country; and TD19, for goods bought in the cases of Article 17, paragraph 2, of the Italian VAT decree (DPR 633/1972). Which type fits each purchase is a tax decision; generating the document from the invoice received, rather than typing it again, is a systems decision. In Spain, the subsidiary will receive e-invoices from each Spanish supplier from the date that supplier has to issue them, through the public solution or the private platform agreed with it. If it wants to receive through a private platform, it publishes its entry point. And from its own date, it reports the statuses and payment of each invoice.

The design idea is the same in both countries, even though the route differs. The invoice received is read, and its data goes into the ERP, each field in its place according to the mapping table described below. If an invoice cannot be read, the dashboard flags it, and the administration team checks only that one by hand, instead of copying them all.

Three example situations in an Italian group

To see how the pieces fit, here are three possible situations in a group whose head office is in Italy. They are examples, not clients, and in each one the final word on what applies to you belongs to your tax adviser. None of them is solved with a single format or a single date, which is why the requirements above start from the ERP.

A Spanish subsidiary that pays corporate income tax

If it uses a computer system to invoice, is not in the SII, is not domiciled for tax purposes in a foral territory and has no resolution exempting it, its system must be adapted to Royal Decree 1007/2023 before 1 January 2027, under the text in force today. If it is in the SII, that regulation does not apply to it. Its invoices to business customers in Spain become electronic on 6 October 2027 if its volume of operations in the previous year exceeded eight million euros (and then it is normally in the SII), or on 6 October 2028 otherwise. Its invoices to the Italian head office go to a company with no seat or establishment in Spain, so they fall outside the scope of Article 3 of Royal Decree 238/2026; if Royal Decree 1007/2023 applies to it, they still carry an invoicing record, since according to the AEAT that regulation covers intra-EU supplies too. In Italy, the head office that receives them sends their data to the SdI by the fifteenth of the following month, as for other purchases from suppliers not established in Italy, save the exceptions paragraph 3-bis lists.

An Italian company with a permanent establishment in Spain

The AEAT answers in its frequently asked questions that invoices issued in Spain by a non-resident business are subject to Royal Decree 1007/2023 when it has a permanent establishment for the purposes of the Spanish non-resident income tax. If it is not in the SII, and since it does not pay Spanish corporate income tax, its deadline is the second one: before 1 July 2027.

An Italian company with no establishment in Spain, selling to Spanish businesses

It is not among those bound by Article 3.1 of Royal Decree 1007/2023, which, as the AEAT reads it, covers businesses established in Spain. If the customer has not given it a recipient code, the data of its invoices goes to the SdI with XXXXXXX, and the invoice reaches the customer some other way. Whether the Spanish e-invoicing duty also reaches those invoices depends on whether the company has to issue them under the Spanish invoicing regulation, and that is a question for your tax adviser before anything is designed.

The mapping table, field by field

Between the ERP and each format sits a table. It is the document the rest of the project depends on: it says which field of your system goes to which field of each format, and what happens when a piece of data exists on one side and not on the other. Once it is written and reviewed by the administration teams of both companies, the rest of the project is execution; without it, every wrong invoice is argued from scratch.

It is written by groups of data:

  • The parties: seller and buyer, with tax numbers and addresses, and where each comes from in the customer master.
  • The document: type, series, number and date, with each credit note, debit note and advance mapped one by one.
  • The lines: item, description, quantity, unit of measure, amount, and the units a standard format wants coded.
  • The taxes: the breakdown by rate with its base, and the code each format uses for each case your system already holds.
  • The payment: terms, due dates, means of payment, and the payment status Spain will ask the recipient to report.
  • The references: the customer’s order, the delivery note, the contract; in the Spanish e-invoice, those a customer has agreed with you and sent you, in a way it can prove, before the transaction.

Two of these groups deserve a word. For the parties, in the FatturaPA a buyer that is not resident and not identified for VAT in Italy is identified by the tax number its own country assigns, while in the Spanish e-invoice the issuer’s tax number is part of the invoice’s unique code; the table says which field of the customer master each identifier comes from, and what happens if a customer does not have one. For the references, Royal Decree 238/2026 lets issuer and recipient agree by contract on additional information in the invoice, and lets the recipient require its own data in the invoice only if it sent that data to the issuer, in a way it can prove, before the transaction. If a customer has agreed with you by contract to have its order number on the invoice, and sent it to you in that way before the transaction, your system has to be able to include it.

Testing before invoicing for real

An invoicing flow is tested first with test invoices, in both directions, without anything reaching a tax authority or a real customer. For each output of the table it is worth testing at least a normal invoice, a corrective invoice or credit note, an invoice with several lines and several tax rates, and an invoice with a missing detail, to see how the system reacts.

The calendar helps to order the work. For a subsidiary that pays corporate income tax and is not in the SII, the invoicing-system date comes first (see «The dates» above).

1 Jul 2022Italy: the data of transactions with parties notestablished in Italy starts going through the SdI.1 Apr 2025Italy: FatturaPA specifications, version 1.4.6 Oct 2026Order HAC/1028/2026 comes into force: thee-invoice periods start to run.1 Jan 2027Invoicing systems adapted before this date:corporate income tax, outside the SII.*1 Jul 2027Invoicing systems: everyone else bound by the rule.*6 Oct 2027E-invoice between businesses, statuses andpayments: over 8 million in volume of operations.6 Oct 2028E-invoice: everyone else. Statuses and payments:the other legal persons and entities.6 Oct 2029Statuses and payments: the other natural personsand entities under attribution of income.* On 5 Oct 2026 the ministry announced a planned extension of theadaptation period; it is not in the BOE.
The calendar, under the text in force today. The amber points are the invoicing-system deadlines, whose adaptation period the ministry plans to extend.

The second date, for that same subsidiary, is the e-invoice between businesses: normally October 2028. A subsidiary that is in the SII has no first date, and its e-invoice may arrive as early as October 2027. What is not wise is to design the first without thinking of the second. The invoicing record is a summary of the invoice, not the whole invoice; but if each invoice is born complete in the ERP, and its record comes from it, producing the Spanish e-invoice from the same data is one more step of the same flow, not a new project.

Questions to take to your ERP vendor this month

You do not need a project to start. These questions can be asked by the people you already have, and the answers turn a general worry into a list of outputs, each with its format, its channel and its date.

  • Is there a version of our ERP adapted to Royal Decree 1007/2023, and from which release?
  • Can one installation keep the invoicing records of each company separate?
  • Which of CII, UBL, EDIFACT and Facturae can it export, or which platforms does it connect to?
  • Can it produce the seven-X file and the customer’s invoice from one sale?
  • Can it generate TD17, TD18 and TD19 documents from invoices received?
  • Can invoice statuses and payment dates come back into it from a platform?

The AEAT itself recommends asking the maker of a non-adapted invoicing program whether an adapted version exists, because one often does. While you wait for the answers, write down for each company where it pays tax, whether it pays Spanish corporate income tax, whether it is in the SII, whether the Italian company has a permanent establishment in Spain, and last year’s volume of operations, and review that list with your tax adviser. Your dates come out of it. If some of your Spanish customers already ask for a particular format or entry point, note it too, and remember that the law does not let them impose a platform on you.

How we do it

This is the work of our Italy–Spain e-invoicing bridge. First we look at how your ERP invoices in Italy today, which format your customers in Spain ask for and which one your suppliers invoice you in. Then we write the mapping table: which field of your system goes to which field of each format. We connect the system to the e-invoicing platform we work with, test in both directions with test invoices and, once everything matches, move on to the real ones.

You receive the connection up and running, the mapping table, and a dashboard with the status of the invoices. The invoices of both countries leave the system you already use, and the ones you receive flow into it by themselves. It is not tax advice: which taxes apply is still decided by your adviser, as it is today. The code, the accounts and the documentation are in your name from day one.

If you want to see how it would work in your case, start with a free one-hour video call: tell us how your companies invoice today and we will tell you what we would look at first.

The official texts we cite

What we do about it: Italy–Spain e-invoicing bridge

All resources