Setting Up an E-Commerce Business in Spain: Structure, Tax Codes and Marketplace Compliance

Spain generated over €72 billion in e-commerce revenue in 2024, growing at 14 percent year-on-year. It is the fifth-largest online retail market in the EU — larger than the Netherlands, larger than Poland — with 38 million active online shoppers concentrated in Madrid, Barcelona, Valencia, Bilbao and Seville. For foreign founders entering the Spanish e-commerce market, getting the structure right from the first transaction matters more than almost any other business type.

SL or Autónomo: The Structure Decision

Foreign founders setting up an e-commerce business in Spain almost always incorporate a Sociedad Limitada (SL). The autónomo (self-employed) route — Spain's equivalent of sole trader registration — is suitable for very small volumes and individual operators, but it exposes the founder to unlimited personal liability, applies progressive personal income tax (IRPF) rates up to 47 percent on profits, and lacks the corporate credibility that Spanish marketplace operators, payment processors and logistics providers expect.

An SL limits liability to share capital, applies the corporate income tax (IS) rate of 25 percent — or 15 percent for qualifying new companies under Spain's 2023 Startup Act — and is the standard legal vehicle for any e-commerce operation above autónomo scale. The minimum share capital is €3,000, fully contributed at incorporation.

The SL is incorporated before a Spanish notary through a public deed (escritura pública), registered in the Registro Mercantil, and assigned a permanent NIF (Número de Identificación Fiscal) by the Agencia Tributaria. The administrador — the appointed managing director — can be a non-resident. The entire process can be completed remotely by Power of Attorney (poder notarial apostillado).

CNAE and IAE: The Activity Codes That Define Your Business

Spanish e-commerce companies must declare their economic activity under two parallel classification systems, each of which has direct consequences for tax treatment, banking and compliance.

The CNAE code (Clasificación Nacional de Actividades Económicas) for pure online retail is 4791 — Comercio al por menor por correspondencia o por Internet. Companies selling through their own website use this code. Those operating as marketplaces or mixed-channel retailers may additionally register under 4799 (other non-store retail) or a product-specific retail CNAE code depending on their category.
The IAE epígrafe — the tax authority's own activity classification — must correspond. The most common epígrafes for internet retail fall within group 659 (comercio al por menor de otros artículos) or, for specific categories, product-specific retail codes. A mismatch between the CNAE and the IAE epígrafe is one of the primary reasons Spanish banks flag e-commerce account applications during compliance review.

Both codes must be consistent across the escritura, the Modelo 036 census declaration and the banking application. For e-commerce companies with multiple product categories, declaring a primary CNAE and IAE that accurately reflects the main activity — rather than a catch-all that approximates it — is what prevents downstream compliance friction.
CNAE & IAE in Spain, what is the difference?

IVA, OSS and Cross-Border EU Sales

Spanish VAT — the Impuesto sobre el Valor Añadido (IVA) — applies at three rates for e-commerce:

  • 21% standard rate: electronics, clothing, accessories, software, most physical goods
  • 10% reduced rate: food products, certain medical devices, cultural goods
  • 4% super-reduced rate: books, newspapers, basic food staples

Registration in the IVA and filing of Modelo 303 (quarterly VAT return) and Modelo 390 (annual summary) is mandatory for all SLs from their first taxable transaction.

For e-commerce businesses selling to consumers in other EU member states, the OSS — One Stop Shop (ventanilla única) scheme eliminates the need to register for VAT in each EU country separately. Under OSS, a Spanish SL collects the local VAT rate of the customer's EU country and reports it through a single quarterly declaration via the Agencia Tributaria's AEAT portal. The EU-wide sales threshold above which OSS is mandatory is €10,000 per year in cross-border B2C turnover — a threshold that most functioning e-commerce operations exceed quickly.

For B2B sales to VAT-registered EU businesses, the reverse charge mechanism applies: the Spanish SL issues a zero-VAT invoice, and the buyer accounts for the VAT in their own country. This requires the Spanish SL to be registered in the ROI (Registro de Operadores Intracomunitarios) and to hold a valid NIF-IVA (the ES-prefixed intra-community VAT number visible in the VIES database). ROI registration is completed through box 582 of the Modelo 036 at the time of initial tax registration.
Learn more about ROI & OSS registrations in Spain

Selling on Amazon.es, Miravia and Spanish Marketplaces

Spain's dominant online marketplaces each carry specific compliance requirements for third-party sellers.

Amazon.es is the market leader, processing the majority of Spain's platform-based e-commerce. Foreign sellers registering on Amazon.es must provide their Spanish NIF (or VAT number for EU-registered sellers), their IVA registration and their bank account in a SEPA-compatible currency. Amazon requires compliance with the DAC7 Directive — Spain's transposition of the EU's platform economy reporting rule — under which Amazon reports seller transaction data to the Agencia Tributaria annually. Sellers with annual Amazon.es revenue above €2,000 or more than 30 transactions are included in DAC7 reports.

Miravia — the Spanish-language marketplace launched by Alibaba in 2022 for the Iberian market — has grown rapidly in Barcelona and Madrid and requires full Spanish NIF and IVA documentation for seller registration.

El Corte Inglés MarketplaceMediaMarktFNAC and PcComponentes (dominant in electronics, headquartered in Murcia) all operate third-party seller programmes with similar documentation requirements.

For marketplace sellers, the DAC7 framework means that platform-reported revenue reaches the Agencia Tributaria regardless of whether the seller files correctly. Consistent declarations between IVA returns and marketplace sales figures are a compliance requirement, not an optional alignment.

Packaging EPR and Product Compliance

Since January 2023, Spain has applied a mandatory extended producer responsibility (EPR) framework for packaging — the Ley de Residuos y Suelos Contaminados (Ley 7/2022). E-commerce companies placing packaged goods on the Spanish market are classified as productores and must register with an authorised EPR scheme — principally ECOEMBES for lightweight and cardboard packaging or ECOVIDRIO for glass — and pay contributions based on packaging volumes placed on the market.
Non-compliance is a reportable deficiency under Spain's environmental law and can affect marketplace selling licences and wholesale supplier relationships. For foreign e-commerce operators entering Spain, EPR registration should be confirmed before the first shipment.

Fulfilment and Logistics: Spain's Infrastructure

Spain's logistics infrastructure is organised around a central hub model. Zaragoza — geographically equidistant from Madrid, Barcelona, Valencia and Bilbao — is Spain's primary inland logistics hub, home to Amazon's largest Spanish fulfilment centre and the main DHL and SEUR distribution facilities for national last-mile delivery.

Madrid and Barcelona carry the largest individual order volumes and the densest last-mile networks. Valencia is the primary import gateway for Asian goods, particularly relevant for e-commerce importers sourcing from China. Bilbao handles northern Spain's retail and industrial distribution.

The main domestic operadores logísticos used by Spanish e-commerce companies are Correos Express (postal operator with broad rural coverage), SEUR (the largest private carrier, integrated with DPD), MRW (national carrier with strong SME pricing), GLS SpainNacex and DHL Express for international shipments. For fulfilment-as-a-service, both Amazon FBA Spain and third-party operators in Zaragoza and Madrid offer complete pick-pack-ship models that do not require a physical warehouse in Spain.

Banking and Payment Processing

For an e-commerce SL, the corporate bank account must accept card payments (typically via Stripe Spain, Adyen, PayPal Business or REDSYS-integrated Spanish payment gateways) and process SEPA transfers for supplier payments.

Stripe Spain is the most common payment processor for foreign-founded e-commerce companies. It integrates with Modelo 303 data through accounting platforms and accepts Spanish NIF documentation directly. For marketplace businesses, Amazon Pay and Bizum (Spain's bank-to-bank instant payment network, dominant in mobile commerce) are increasingly expected by Spanish consumers.

The corporate account application requires the SL's escritura, Modelo 036 confirmation, NIF and the administrador's documentation. For a clearly structured e-commerce SL with a coherent product category and operational business model, account opening at Spanish banks typically completes within two to four weeks.

Not sure where to start?
Let's work it out together.

A 20-minute call. We'll look at your situation — your business, your clients, your country — and tell you honestly which structure makes sense and what it will take.

⏱ 20 minutes · No commitment · Straight answers
Spain · Canary Islands · company formation for non-residents