A Spanish address puts the building number on the street line and, behind it, a small code for the position inside the building: Calle Mayor, 12, 3º Izda. reads as number 12, third floor, left-hand door. That tail, together with an address that may have no number at all (s/n) and a street type that changes with the language of the region, is where Spanish addresses are most often damaged.
This article describes the Spanish address format, how CDQ represents it in the CDQ address model, how the floor and the door are delivered, how the Canary Islands, Ceuta and Melilla are handled, and which reference data CDQ maintains for Spain. It is the reference for anyone mapping Spanish business partner data into CDQ, or consuming curated Spanish addresses from CDQ.
In this article, you will understand:
- How a Spanish address is structured, and what the part after the house number means
- Which administrative levels are written on an address, and which one an SAP region field is keyed on
- How each Spanish level maps to a concept in the CDQ address model, and which SAP field it reaches
- Which output fields receive the floor and the door, and why the door can appear twice
- Why the Canary Islands, Ceuta and Melilla stay in country
ES, and how a customs free zone differs from them - Which reference data CDQ maintains for Spain, and where it is incomplete
Available in:
- CDQ Wiki: business partner metadata for Spain: browse the published Spanish metadata
A Spanish address has the ordinary European shape: a street, a number, a post code and a place. Most of it needs no special handling.
What is specific to Spain is narrower, and it is where integrations actually go wrong:
| Specific to Spain | Why it matters |
|---|---|
| The position inside the building is written on the street line | 3º Izda. is a floor and a door, and it arrives inside the street value where it corrupts every comparison on that field |
| An address can legitimately have no number | s/n (sin número) is a complete answer, and it is not a missing value |
| A road address is a point on a road | Ctra. N-II, km 23 names a road and a kilometre, and the N-II is not a house number |
| The street type follows the language of the region | Calle, Carrer, Rúa and Kalea are the same kind of thing |
| The first two digits of the post code are the province | the province is already inside the post code, and a province written on an address is often redundant |
| Municipality and province names exist in two languages | Lleida and Lérida, A Coruña and La Coruña are one place |
Spain has three levels of administrative area below the country, and below them the places an address names. Only the municipality is written on an address.
| Level | Spanish | What it is | Used to address mail | Example |
|---|---|---|---|---|
| 1 | comunidad autónoma | autonomous community, 17 of them, plus the autonomous cities Ceuta and Melilla at the same level | no | Cataluña |
| 2 | provincia | province, 50 of them, and the first two digits of the post code | no, it is encoded in the post code | Barcelona (08) |
| 3 | municipio | municipality, the unit a post code is issued for and the place on the last line | yes | Sabadell |
| below | entidad, núcleo, barrio | a settlement or neighbourhood inside a municipality | yes, where it is the better known name | Poblenou |
Ceuta and Melilla are autonomous cities rather than communities, and each is also its own postal province: post code numbers 51 and 52 follow the 50 provinces numbered 01 to 50, so the full range is 01 to 52. A province and a community can also share a name, as Madrid, Murcia and Asturias do, because those communities consist of one province.
The levels that are not written on an address are still business data. The province is the level an SAP region field is keyed on and the level reporting is cut by, and the community is the level at which regional legislation and registers apply. The province is the cheaper of the two to obtain, because it is the first two digits of the post code.
Empresa Ejemplo, S.L.
Calle Mayor, 12, 3º Izda.
28013 MADRIDThe street type comes first, then the name, a comma and the number, then the floor and the door. The post code precedes the municipality on the last line, and the province is optional.
3º Izda. is not a suffix on the house number. It is two separate facts, and the building can have more levels of its own before them:
| Written | Spanish | Means |
|---|---|---|
3º, Planta 3 | piso or planta | the floor |
Bajo, Bj. | bajo | the ground floor |
Entlo. | entresuelo | the mezzanine above the ground floor |
Pral. | principal | the first floor of an older building |
Ático | ático | the top floor |
Izda., Izq. | izquierda | the left-hand door on that floor |
Dcha., Der. | derecha | the right-hand door |
Centro | centro | the middle door |
A, B, 1ª | letra or número de puerta | the door, where there are more than two per floor |
Esc. | escalera | the staircase, in a building with several |
Portal, Bloque | portal, bloque | the entrance and the block of a development |
Local, Nave | local, nave | a commercial unit or a warehouse in an industrial area |
So Calle Mayor, 12, Esc. 2, 3º Izda. reads: number 12 on Calle Mayor, staircase 2, third floor, left-hand door.
Izquierda and Derecha describe which door you knock on. Left in the street field they turn Calle Mayor into Calle Mayor 3 Izda, which matches nothing, and two flats in one building become two different streets. They are premises and belong in premises fields.
No number. Calle Mayor, s/n means the address has no number. It is a statement, and it is kept as one rather than read as a missing house number.
A kilometre on a road. Out of town the address is a point on a road: Ctra. N-II, km 23, Autovía A-6, km 18,5. The road designation (N-II, A-6, M-40) is part of the road name and the kilometre takes the place of the number. N-II is never a house number.
An industrial estate. Polígono Industrial Las Mercedes, Nave 14 has no street. The estate is an area, and the unit inside it is a warehouse or a plot.
A post office box. Apartado de Correos 123 replaces the street, and the post code is the one of the post office.
The CDQ address model has two parallel hierarchies. Administrative areas represent the political containers, typed REGION and COUNTY. Localities represent the places themselves, typed CITY, DISTRICT, QUARTER or BLOCK. Streets are held as thoroughfares with the number in its own field, and the position inside the building as typed premises.
Spain maps as follows:
| Spanish level | CDQ concept | Type | SAP field |
|---|---|---|---|
| comunidad autónoma, ciudad autónoma | administrative area, level 1 | REGION | region |
| provincia | administrative area, level 2 | COUNTY | county |
| municipio | locality, level 1 | CITY | city |
| entidad, núcleo | locality, level 2 | DISTRICT | district |
| barrio | locality | QUARTER | district |
| polígono industrial | thoroughfare | INDUSTRIAL_ZONE | appended to district |
| street type and name | thoroughfare | STREET | street |
number, or s/n | thoroughfare number | n/a | house number, HOUSE_NUM1 |
| piso, planta | premise | LEVEL | floor |
| puerta, izquierda, derecha, letra | premise | DOOR | house number supplement, HOUSE_NUM2, and room number |
| apartamento | premise | APARTMENT | house number supplement, HOUSE_NUM2, and room number |
| bloque, edificio, nave | premise | BUILDING | building |
| apartado de correos | postal delivery point | POST_OFFICE_BOX | PO box |
| código postal | post code | REGULAR | post code |
SAP reserves a second house number field, HOUSE_NUM2, for the Iberian and Latin American convention of a supplement to the house number. Spain is one of the five countries for which CDQ fills it, with Portugal, Brazil, Mexico and Argentina. What goes in there is the door, and the floor goes to the dedicated floor field, because SAP has one and because the floor is a different fact from the door.
Three details of today's delivery are worth knowing:
- Which premises reach
HOUSE_NUM2. The premises typed room, door and apartment, in that order, joined by a comma when more than one is present. A floor is never part of it. - The door is delivered twice. The SAP room number field takes the first of room, door and apartment as well, so the same value is in the house number supplement and in the room number. A consumer that reads both fields sees one door, not two.
- The floor stays in its own field. Only a premise typed
LEVELreaches the floor field, which is why a floor that was not recognised as one stays in the street value.
So 12, 3º Izda. is delivered as:
| Output field | Value |
|---|---|
house number, HOUSE_NUM1 | 12 |
| floor | 3º |
house number supplement, HOUSE_NUM2 | Izda. |
| room number | Izda. |
12 3º Izda. answers two different questions in one field: which building on the street, and which unit inside that building. Splitting them is what makes either question answerable on its own.
Keeping them together fails in both directions at once. An exact comparison on street and number stops recognising that a partner at 12 3º Izda. and a partner at 12 4º Dcha. are in the same building, which is what site consolidation and hierarchy detection look for. A fuzzy comparison has the opposite problem: most of the characters agree, so it reads them as near identical and can treat two different flats as one partner.
| Rejected alternative | Why |
|---|---|
Treat Izda. and Dcha. as part of the street name | It is where they arrive, and it is the thing that has to be corrected. A street is a line on the ground shared by every building on it; a door is a property of one flat. |
| Put the floor in the house number supplement together with the door | The supplement is one field, and packing two facts into it recreates the problem it exists to solve. SAP has a floor field, and it takes the floor. |
Read s/n as an empty house number | An empty value says the number was lost. s/n says there is none. The two are different findings, and only the first is a defect. |
These three territories are part of Spain and are addressed as Spain. The address stays country ES, with the Canary Islands as the community ES-CN and the provinces Las Palmas (ES-GC) and Santa Cruz de Tenerife (ES-TF), and with the autonomous cities ES-CE and ES-ML as the region. Their post codes follow the national numbering: 35 and 38 for the two Canary provinces, 51 for Ceuta and 52 for Melilla.
What sets them apart is tax, not address. The Canary Islands, Ceuta and Melilla are outside the EU VAT area, and they apply their own indirect taxes instead (IGIC in the Canary Islands, IPSI in Ceuta and Melilla). That is a property of the region, so it travels with the region and with no change to the country.
The codes IC (Canary Islands) and EA (Ceuta and Melilla) exist only as exceptional reservations in ISO 3166-1, requested by the World Customs Organization, and are not officially assigned country codes. The standard treats them as input forms of ES with the matching region, and never as a country to deliver. The conversion is not yet in place: see Current limitations.
The Zona Franca de Barcelona, Vigo or Cádiz is an area inside a municipality. It is address content, an area or industrial zone name, and changes nothing about the country or the region. A partner in the Zona Franca de Barcelona is an ES address in the province of Barcelona, inside the EU VAT area. Do not confuse it with the three territories above, which are outside the VAT area as a whole.
CDQ delivers the province and the community with their ISO 3166-2 codes. An SAP system does not validate against ISO: it validates the region field against its own region key table, T005S, which is part of a customer's configuration. That key exists for tax and jurisdiction purposes, which is why it follows national tax or statistical numbering rather than ISO, and why the level it sits at differs from one country to the next.
The region key is customer-specific configuration, so this standard does not define one: a T005S is specific to a customer and to a client, and no single value would be correct everywhere. What this standard fixes is the ISO 3166-2 code. The mapping from it to the key your system expects is yours to maintain.
For Spain the key your configuration holds is conventionally the province number, the two digits that open the post code, so it sits one level below the community. The Canary Islands, Ceuta and Melilla are ordinary entries in that table under country ES, with the numbers of their provinces and cities. A Spanish address reaching SAP therefore needs the province, which CDQ delivers as administrative area level 2, and the community has no key of its own to map to. Where a community consists of one province, the two share the key.
Treat the ISO code as the value CDQ guarantees and the SAP key as a mapping you own. Confirm which level your configuration uses before deciding which CDQ field feeds it.
Calle Mayor, 12, 3º Izda., 08201 Sabadell, in the CDQ address model:
| Field | Value |
|---|---|
| Country | ES |
Administrative area 1 (REGION) | Cataluña |
| Administrative area 1 code | ES-CT |
Administrative area 2 (COUNTY) | Barcelona |
| Administrative area 2 code | ES-B |
Locality 1 (CITY) | Sabadell |
Thoroughfare (STREET) | Calle Mayor |
| Thoroughfare number | 12 |
Premise (LEVEL) | 3º |
Premise (DOOR) | Izda. |
| Post code | 08201 |
The examples below show the shape of each dataset, not its full contents. The complete published lists for Spain are on the CDQ Wiki page business partner metadata for Spain, which also covers legal forms, identifier types and the integrated data sources.
19 entries: the 17 autonomous communities, Ceuta and Melilla. Each carries its ISO 3166-2 code and names in Spanish, English, German, French, Catalan, Basque, Galician, Occitan and Chinese.
| Code | Spanish | English | Also matched as |
|---|---|---|---|
ES-AN | Andalucía | Andalusia | Andalucia |
ES-CT | Cataluña | Catalonia | Catalunya |
ES-PV | País Vasco | Basque Country | Euskal Autonomia Erkidegoa |
ES-CN | Canarias | Canary Islands | Islas Canarias |
ES-CE | Ceuta | Ceuta | Autonomous City of Ceuta |
50 entries, held as administrative area level 2 and each linked to its community. Ceuta and Melilla are not repeated here: they are the autonomous cities of the table above. The province code is the ISO code, which is a letter code and not the postal number.
| Code | Community | Name |
|---|---|---|
ES-M | ES-MD | Madrid |
ES-B | ES-CT | Barcelona |
ES-GC | ES-CN | Las Palmas |
ES-TF | ES-CN | Santa Cruz de Tenerife |
ES-SS | ES-PV | Gipuzkoa |
The 50 are spread unevenly: Castilla y León has nine, Andalusia eight, and seven communities have one.
10 entries, covering four street words, three post office box words and a door word. This is the smallest vocabulary of the countries described in this series.
| Identifies | Term | Abbreviation |
|---|---|---|
| Street | Calle | C/ |
| Street | Carrer | C/ |
| Street | Avenida | Av. |
| Street | Carretera | Ctra |
| Post office box | Apartado de Correos | Apdo. Correos |
| Post office box | Apartado postal | none |
| Door | Puerta | none |
Where a term is recognised, the expanded form is written to the thoroughfare value and the abbreviated form to the thoroughfare short name, and the short name is what the SAP street line takes.
Five digits, the first two being the province number from 01 to 52. Separators between the last three digits are tolerated by the published format.
The community and the province are standardised against reference data: whether they arrive in Spanish, English or a co-official language, the canonical name and the ISO code are written back.
Street terms are recognised in the street text and rewritten to the abbreviation, so Avenida and Av. produce the same delivered value.
Post codes are validated against the five digit format.
The municipality and the levels below it are preserved as submitted. Where an address provider is enabled, it can enrich and complete them.
These are the gaps worth knowing about before designing an integration.
| Limitation | What it means for an integration |
|---|---|
| The Spanish premises vocabulary is almost empty | Apart from Puerta, none of the words that carry the floor and the door (Planta, Piso, Bajo, Izda., Dcha., Esc.) is published as reference data. A floor and a door arriving inside the street value stay there: they are never discarded, but the floor field and the house number supplement can be empty for an address that clearly has both. This is the single most important thing to know before loading Spanish addresses. |
IC and EA are not yet converted to ES | A record supplied with the country IC or EA is not converted to ES today. Supply these addresses as ES with the province or the autonomous city, which is also what an SAP system expects. |
| The street vocabulary is short | Calle, Carrer, Avenida and Carretera are published; Plaza, Paseo, Camino, Ronda, Travesía and the Galician and Basque types Rúa and Kalea are not yet. Where a type is not published, the street is preserved exactly as submitted and no short name is produced. |
| Some province names carry the co-official name inside the value | Several Catalan, Galician and Basque provinces are published with the language tag and the Spanish name inside the name value, for example Illes Balears (ca) [Islas Baleares]. A name that arrives without those additions can fail to match the published one, so confirm that your province values resolve before relying on the SAP mapping. |
| The SAP region key cannot be held at province level | The reference data carries a default SAP key only at community level, and for one community only. Provinces have no such field, so the province number your configuration expects is yours to supply. |
| The community and the province are standardised, and not derived | One that arrives is matched against reference data and completed. One that is absent stays absent, because CDQ standardises a supplied value rather than deriving one from the post code. Since neither level is part of a Spanish postal address, absent is the normal case, and the first two digits of the post code give the province from your own side. |
s/n and kilometre addresses have no reference data of their own | They are carried as supplied. They are kept, but nothing yet checks that an address without a number is intended. |
Until the Spanish premises vocabulary is published, the position inside the building generally arrives in the street value and stays there. Before an SAP load, check the street values of your Spanish records for a trailing floor and door, and expect the floor field and the house number supplement to be empty. Where your source already holds the floor and the door in their own fields, supply them that way and they will reach the right output fields.
A Spanish address writes the street type first, the number after a comma, and then the floor and the door, which are separate facts. It can have no number at all (s/n), and out of town it is a kilometre on a road. The province is the first two digits of the post code.
Of the Spanish levels below the country, only the municipality is written on an address. The community and the province are carried because a company is registered in a province, because an SAP region field is conventionally keyed on the province number, and because reporting is cut by both.
CDQ places the community in administrative area level 1 and the province in level 2, the municipality in locality level 1. The building number goes to the house number, the floor to the floor field, and the door to the house number supplement, which is the field SAP reserves for it in Spain, and to the room number as well. The Canary Islands, Ceuta and Melilla stay in country ES and carry their special tax status through their region, while a customs free zone is only a place inside a municipality.
The 19 communities and cities and the 50 provinces are maintained as CDQ reference data, with a short street vocabulary of 10 terms. The premises vocabulary is where the current coverage is weakest, and it is the part a Spanish address depends on most.
- Business partner metadata for Spain
- Portugal Address Standard
- France Address Standard
- Germany Address Standard
We are constantly working on providing an outstanding user experience with our products. Please share your opinion about this tutorial!