
A Spanish supermarket chain likes your products. Your company makes them in Italy, or in Portugal, France or Germany, and after the first commercial meetings the chain’s supplier department sends you a technical document: its EDI guide. Orders will arrive by EDI. A despatch advice must reach the chain at the time the guide sets. Every pallet carries a label with a specific code. Invoices go by EDI too. Until all of it works, the chain may not register you as a supplier.
The guide is written for a reader who already knows what a GLN, a DESADV or an SSCC is. It also leaves out the questions a supplier from another country asks first. Are the codes your company already prints on its packs valid in Spain? Who carries the messages across the border? Which invoice does the chain receive, when your own country already has rules of its own for invoices to foreign customers? And do Spain’s new rules on electronic invoices between businesses apply to you?
This piece answers those questions from the official texts: GS1’s standards, the EANCOM message definitions, the guidance of AECOC, Spain’s invoicing regulation and Italy’s rules on invoices to foreign customers. Then it sets out what your ERP has to produce, in what order you prepare it and how the chain’s tests go. The examples are an Italian manufacturer, because Italy’s invoicing rules are the ones quoted here; where another country would change the answer, the piece says so. It is not tax advice.
What EDI is, and what the chain’s guide adds
EDI, electronic data interchange, is the exchange of business documents between two companies’ systems as structured messages in an agreed format. An order leaves the chain’s system and arrives in yours as data, not as a PDF or an email that someone reads and types again. The same goes for the despatch advice and the invoice that travel the other way.
EANCOM, the standard most used in Spain
AECOC, the association that represents GS1 in Spain, names two GS1 formats for these messages, GS1 EANCOM and GS1 XML, and adds that in Spain the standard most used is GS1 EANCOM. EANCOM is based on UN/EDIFACT, the United Nations syntax for electronic data interchange. GS1 publishes it as EANCOM 2002, syntax 4, and its manual, in the 2016 edition, lists each message, its purpose and its segments.
The guide is the chain’s own selection
EANCOM describes many messages, and each message has many optional parts. The chain’s guide says which messages it uses, in which version, which segments and fields it requires, which codes it expects in them and when each message must arrive. Two chains can ask different things of the same message. The guide is therefore the real specification of the connection: the standard says what a message can carry, and the guide says what this customer will accept.
A foreign supplier reads the guide with one extra question in mind: which of its requirements assume a Spanish supplier. Three of them concern the codes, the invoice and the time the goods spend on the road, and each has its own section below.
The codes: from GS1 in your own country
Every EDI message replaces names and addresses with codes. Your company, the chain, its warehouse and its stores are each a code; so is every item and every pallet. The chain’s guide will ask for yours, and the first question is where they come from.
One company prefix, valid in Spain
These codes are normally built from a GS1 company prefix: a unique string of four to twelve digits, issued to your company by a GS1 member organisation. A GS1 office can also license single codes, which are not a company prefix. GS1’s General Specifications state that every key built from it is globally unique, and GS1 adds that its prefixes do not identify the country of origin of a product, because companies make products anywhere in the world. In Italy, GS1 Italy describes itself as the only body authorised by GS1 to issue company prefixes there, and answers yes to the question of whether its codes are also valid abroad.
So an Italian manufacturer does not need a Spanish prefix to sell to a Spanish chain. If your packs already carry barcodes issued from your company’s own prefix, those codes are the ones the chain will read. If they do not, GS1 directs a company to its local office to register and receive its prefix. AECOC’s page on electronic invoicing tells its reader that AECOC will provide the code needed for EDI; a supplier based outside Spain gets the same kind of code from GS1 where it is based, and GS1 Spain itself notes that a GLN is valid for any sector and any country in the world.
The GLN: who, and where
The Global Location Number identifies a party or a location in a business process. In GS1’s words, a GLN identifying a party answers the question “who”, and may be a legal entity or a function; one identifying a location answers “where”, and the location may be physical or digital. Your company has a GLN, and the chain’s order will carry several of its own: the buyer, the warehouse the goods go to, perhaps the store. Your system has to recognise each one.
The GTIN: each item, and each case
The Global Trade Item Number identifies a trade item. GS1’s rule is that every item different from another in any respect gets its own GTIN, and that each packaging level that is traded gets a separate one. For example, a single jar and a case of twelve jars are two GTINs, and if the chain orders by the case, the case’s GTIN is the one in the order line. The GTIN of a branded item is allocated by the brand owner, which is your company for your own brands.
Products sold by weight
One exception matters for a foreign supplier. GS1 Italy warns that the coding of products sold at variable weight is a national solution, and that the codes it assigns for them cannot be used for products exported and sold abroad. If you sell cheese, meat or other goods priced by weight, GS1 Italy’s advice is to adopt the national solution of the country you export to and to contact the GS1 organisation there, in Spain AECOC. Ask the chain how it wants those items identified before you print anything.
The SSCC: each pallet
The Serial Shipping Container Code identifies a logistic unit: a pallet, a mixed load, any unit made up for transport or storage that has to be managed through the supply chain. GS1’s specifications make it the only key that may identify a logistic unit. Its logistic label guideline states, as a normative rule, that the SSCC is the single mandatory element of every logistic label, and recommends that the company that builds the unit assigns the SSCC from its own company prefix. When your warehouse builds a pallet for the chain, your company gives it its SSCC.
The messages, in the order they travel
EANCOM names each message with a six-letter code. A guide for a supplier of a Spanish chain will select some of these. The order below is the order in which they travel: the catalogue once, before the first order, then the rest for each delivery.
The price catalogue, PRICAT
Before the first order, a guide may ask for the price and sales catalogue, to set in the chain’s system the items, with their GTINs, that every later message will refer to.
The order, ORDERS
The chain’s system sends the purchase order: which items, by GTIN, in what quantity, to which delivery point, by GLN, and by when. Your system receives it and, once the connection works, creates the sales order without anyone typing it.
The order response, ORDRSP
If the guide asks for it, your system answers the order: accepted as it is, accepted with changes, or refused, line by line. A change of quantity or date travels here, before the goods do.
The despatch advice, DESADV
EANCOM describes the despatch advice as the message that tells the consignee the detailed contents of a consignment. It lets the consignee know what was sent and when, prepare for the receipt of the goods and check the delivery against the order. It lists every pallet by its SSCC and, for each, the items and quantities on it. The guide says when it must arrive.
The receiving advice, RECADV
The chain’s system reports what it actually received. EANCOM notes that this information lets the supplier prepare the invoice for the customer. If the chain’s guide asks the invoice to match the receipt, this is the message it matches against.
The invoice, INVOIC
Your system sends the invoice as a message, with the references the guide asks for, such as the order number, the despatch advice or the receipt. The section on the invoice below explains why a foreign supplier has two files to think about, not one.
Days on the road: the despatch advice and the pallet label
A supplier in Italy or Germany ships across borders, and its goods can spend days in transit. That changes how two of the guide’s requirements are met.
When the despatch advice leaves
The despatch advice describes what left your warehouse, so it can only be built when the pallets are complete and loaded. The guide says by when the chain must have it. With days of transit, a message sent when the truck leaves reaches the chain well before the goods, which is what EANCOM describes it for: preparing the receipt. What matters is that it leaves from your system when the goods leave, with the data of the pallets actually loaded, not the data of the order.
What each pallet carries
At the chain’s warehouse, someone scans the SSCC on the pallet label and the chain’s system looks it up in the despatch advice it already holds. If the SSCC is in the message, the system knows what the pallet contains and can compare it with the order. If the SSCC is not in any despatch advice it holds, the chain cannot make that check from the message, and its guide says what happens to such a delivery.
The label
GS1’s logistic label guideline separates its normative rules from its recommendations. The SSCC is the only element every label must carry. The other content, such as the GTIN of the items, the quantity, the batch or a best-before date, is optional, but when it is printed it follows normative rules, and so do parts of the layout, such as the minimum height of the text; the chain’s guide may make more of it compulsory. A pallet label that a Spanish chain will accept is a GS1 logistic label printed to the rules of that guide, and your warehouse prints it when the pallet is complete, from the same data that goes into the despatch advice.
When a pallet is rebuilt on the way
If your forwarder splits or rebuilds pallets in a hub on the way to Spain, the units that arrive are not the units you described. Agree with the forwarder that the pallets travel as built, or agree with the chain how a rebuilt load is described. The despatch advice can only describe what will actually reach the dock.
One sale, two files
This is the part of a Spanish chain’s requirements that a guide written for Spanish suppliers does not explain. For a supplier in Italy, one sale to the chain produces two files with two different destinations: the invoice, and the data the Italian rules ask for.
On the Italian side: the data to the SdI
Since 1 July 2022, Italian companies send the data of their transactions with parties not established in Italy through the Sistema di Interscambio, the SdI, the exchange system of the Italian tax authority. The FatturaPA specifications, version 1.4, give the recipient code to use for a customer who is not resident, established or identified in Italy: seven Xs, XXXXXXX, when the invoice goes to the SdI to transmit the data of those invoices. The Agenzia delle Entrate’s Circular 26/E of 2022 is explicit about what happens next: with that code, the SdI does not deliver the file to the customer, and the file is not an electronic invoice. The chain receives the invoice another way.
The same circular describes a second route, an electronic invoice sent through the SdI to a code the foreign customer supplies. A chain that has asked you for EDI reads the INVOIC message, not a file from the SdI.
The invoice the chain reads: the INVOIC
The invoice the chain reads, matches and pays is the one that arrives by EDI. Italy’s VAT decree accepts EDI as one of the ways to guarantee the authenticity of origin and the integrity of an electronic invoice, and makes the use of an electronic invoice depend on the customer’s acceptance (Article 21, paragraphs 1 and 3, of Presidential Decree 633/1972). Spain’s invoicing regulation says the same for the invoices it governs: EDI is accepted when the agreement on the exchange provides for procedures that guarantee origin and integrity, and an electronic invoice needs the recipient’s consent, except where it is mandatory (Articles 9.2 and 10.1 of Royal Decree 1619/2012). The chain’s EDI agreement and its guide are where those procedures are written, and a chain that asks you for EDI invoices is giving its acceptance.
Keep the two identical
The two files describe one sale. They must carry the same invoice number, the same date and the same amounts, and the tax treatment your adviser has set for that kind of sale: for goods shipped from Italy to a business in Spain, an intra-EU supply invoiced without Italian VAT when its conditions are met, with the Spanish VAT accounted for by the chain as the buyer. The only safe way to keep them identical is to produce both from the one invoice record in your ERP, each in its format, and never to type either one.
Does Spain’s mandatory e-invoice reach you?
Spain is introducing a mandatory electronic invoice between businesses, under Law 18/2022 and Royal Decree 238/2026. According to the AEAT’s calendar, it applies from 6 October 2027 to businesses whose volume of operations exceeded 8 million euros the year before, and from 6 October 2028 to everyone else. A foreign supplier reading about it asks whether it applies to its own invoices.
What the texts say
Article 3.1 of Royal Decree 238/2026 says that businesses and professionals who, under Royal Decree 1619/2012, are required to issue and deliver an invoice 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 in Spain. The duty therefore follows the Spanish invoicing regulation. Article 2.3 of that regulation says when its rules govern an invoice: when the supply is made in the Spanish VAT territory, unless the supplier is not established there, the customer is liable for the tax and the customer does not issue the invoice itself; and, for a supplier established in Spain, in some cases where the supply is made outside it.
What that leaves to your adviser
Read together, the two articles tie the Spanish duty to cases that article 2.3 lists, and a supplier with no establishment in Spain falls into them only in some situations. Goods shipped from your plant in Italy are one situation; goods sold from a warehouse you hold in Spain, or through a Spanish establishment, are another. Which one your sales are, and so whether the Spanish duty reaches your invoices to the chain, is a question for your tax adviser before anything is designed.
If it does
The invoice then has to follow Royal Decree 238/2026. Its article 7.1 requires a structured message on the European semantic model EN 16931, in one of four syntaxes: CII, UBL, the EDIFACT invoice message or Facturae. Its article 7.3 requires every electronic invoice sent through a private exchange platform to carry an advanced electronic signature, by the issuer or by an authorised delegate. And the new article 10.2 of Royal Decree 1619/2012 says that, where the electronic invoice is mandatory, its origin and integrity are guaranteed by the procedures of Royal Decree 238/2026. An EDI invoice may still be the vehicle; the rules around it change.
Read every guide with its date
AECOC’s page on electronic invoicing, last modified in June 2026, still says that a digital signature has not been mandatory since Royal Decree 1619/2012. That is still the rule today. Once the mandatory e-invoice applies to a business, from October 2027 or 2028, article 7.3 of Royal Decree 238/2026 requires a signature on its invoices sent through a private platform; for other invoices the old rule stays. When a guide, a provider or a page states a rule on Spanish e-invoices, check whether it was written before or after Royal Decree 238/2026, of March 2026.
Who carries the messages across the border
Your ERP produces and reads the messages; something has to carry them between your company and the chain. There are two main routes, and the chain’s guide says which ones it accepts.
An EDI service provider
An EDI service provider, or value-added network, carries messages between trading partners; GS1’s AS2 guide names it as the alternative to a direct connection. Ask the chain which providers it exchanges messages with, and ask your provider whether it reaches the chain. Whether the provider or your own system translates between your ERP’s files and EANCOM is part of the same conversation.
A direct AS2 connection
AS2 is a standard for moving data securely and reliably over the internet. GS1’s guide for newcomers describes it as a direct point-to-point exchange between trading partners, as opposed to going through an intermediate network or service provider. It asks more of your own technical team, and with AS2 the translation into EANCOM is your system’s job.
Whichever route
The route changes how messages travel, not what they say. The mapping between your ERP and the messages, and the chain’s tests, are the same work either way.
From your ERP to the messages
The heart of the work is the mapping: which field of your ERP goes to which field of each message, and back. It is done once per chain, from its guide.
The master data, before the messages
Every message refers to master data your ERP must already hold: the GTIN of each item and of each case, the chain as a customer with its GLNs (buyer, warehouses, stores), the units of measure the chain uses, the number of items per case and cases per pallet. If a GTIN is missing on an item, the order line that refers to it cannot be read. A missing GTIN or GLN stops a message before any of the mapping is tested.
The order that comes in
Each line of the order arrives with the chain’s GTIN, quantity and delivery point. Your system finds the item by its GTIN and the delivery address by its GLN, and creates the sales order. A line it cannot match is set aside for a person, with the reason, rather than guessed.
The despatch advice that goes out
The despatch advice needs data an ERP does not hold at the moment of the order: which pallets were built, with which SSCC, carrying what. That data is created in the warehouse when the goods are packed. Either the warehouse records it in the ERP as each pallet is completed, or a warehouse system does and hands it on. Without that step there is no despatch advice to send.
The invoice that goes out
The invoice takes the lines of the delivery, the prices agreed with the chain and the references the guide asks for. In the same step, your system produces the file your own country’s rules require, from the same record.
The messages that come back
The order response, the receiving advice and any acknowledgement the guide asks for return to your system, and each one is linked to the order or delivery it refers to. A receiving advice that reports less than you sent becomes a difference for someone to settle with the chain before the invoice goes out, or a credit note after.
The chain’s tests
The chain’s guide or a separate test plan says which tests come before real documents.
Message by message
The chain’s technical staff send a test order, your system receives it, and they check what your system sends back: the order response, then a despatch advice, then an invoice. Each one is validated against the guide, and errors come back with the field that failed. Plan for more than one round.
The label, with a scanner
The chain may ask for printed labels to be sent or brought for a test scan, so that its warehouse can read the SSCC and the other data under its own conditions. Print them from the same system that will print the real ones.
The first real orders
When every test has passed, the first real orders follow the same path. Watch them closely: they are the first time real warehouse data, real transit times and real receipts meet the connection.
Where to start this week
You can prepare much of this before the first meeting with the chain’s technical staff.
Ask for the guide and the test plan
Ask the chain for its EDI guide, its test plan, the name of its technical contact and the routes it accepts for the messages. Ask which version of each message it uses.
Check your company prefix and your GTINs
Find out whether your company already holds a GS1 company prefix, or single codes, and from which office. Check that every item you will sell to the chain, and each of its cases, carries a GTIN in your ERP, not only on the packaging.
Look at how a pallet is built today
Walk through your warehouse with the guide’s label page in hand. Where is a pallet completed? Who could print its label and record its SSCC at that moment?
Ask your adviser two questions
Which rules your invoices to the chain follow, Italian or Spanish, given where the goods ship from. And whether the Spanish mandatory e-invoice will reach them, and from when.
Ask your ERP vendor what it can read and write
Ask whether your ERP can import an order from a file and export a despatch advice and an invoice, and in which formats. The answer decides how much of the mapping lives in the ERP and how much in the connection.
How we do it
This is the work of our EDI with large customers solution. First we read the EDI guide your customer gave you: which documents it asks for, in which format and in which order. We work alongside an EDI network operator, which carries the messages between your system and your customer’s. We write which field of your ERP goes to which field of each document: the order that comes in, the despatch advice and the invoice that go out. Then we run your customer’s tests with their technical staff, one by one, and, once they are all passed, the real documents begin.
You receive the flows up and running, taken through your customer’s tests. Your customer’s orders come into the ERP without anyone typing them again, and despatch advices and invoices leave it in the format your customer accepts. The commercial terms are agreed between you and the chain, and which tax rules apply is still decided by your adviser. 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 which chain you are talking to and what its guide asks, and we will tell you what we would look at first.
The official texts we cite
- GS1, EANCOM® 2002 S4, Part I, edition 2016: the list of messages and the descriptions of the despatch advice and the receiving advice.
- GS1, General Specifications, Release 26.0, January 2026: sections 1.2.3 and 1.2.3.3 (the company prefix), 2.1.7 (the GTIN), 2.2 (the SSCC), 2.4 (the GLN) and 4.2.3.1 (the brand owner allocates the GTIN).
- GS1, GS1 Company Prefix and Get barcodes.
- GS1, GS1 Logistic Label Guideline, Release 1.3, July 2019: sections 1.3.2 and 3.2, rules 3-1 and 3-2, and the normative rules 4-22, 4-24, 6-1 and 6-6.
- GS1, Newcomers to AS2 Implementation Guide, Issue 1, 2008, section 1.1.
- GS1 Italy, Il codice a barre in cinque passi, Vendere all’estero and Codici a barre EAN per vendere i tuoi prodotti.
- AECOC, Estándares GS1 and Necesito factura electrónica.
- GS1 Spain, EDI GS1.
- Italian Presidential Decree 633/1972, the VAT decree, Article 21, paragraphs 1 and 3.
- Spanish Royal Decree 1619/2012, the invoicing regulation, consolidated text: articles 2.3, 8 bis, 9.2 and 10, as worded by Royal Decree 238/2026.
- Spanish Law 18/2022, Article 12 (the new wording of Article 2 bis of Law 56/2007).
- Spanish Royal Decree 238/2026, consolidated text: articles 3, 4 and 7, and the fourth final provision.
- The AEAT’s pages on who is bound by the electronic invoice and on its implementation calendar.
- Italian Legislative Decree 127/2015, Article 1, paragraph 3-bis (Agenzia delle Entrate).
- FatturaPA technical specifications, version 1.4, valid from 1 April 2025: the CodiceDestinatario element.
- Circular 26/E of the Agenzia delle Entrate, 13 July 2022, section 3.
What we do about it: EDI with large customers