FinchContext
Run with

Build the Modelo 349 EC Sales List into AEAT XML

Skill: Convert intra-EU transaction records into the Modelo 349 presentation XML

Region: Spain (España) Category: VAT — IVA (Modelo 349, declaración recapitulativa de operaciones intracomunitarias) Does: Takes a period's intra-EU supplies and acquisitions of goods and services and produces the AEAT Modelo 349 presentation XML — one Declarado row per counterparty and operation key (clave de operación) carrying the VIES NIF-IVA and the importe, plus rectificaciones — the EC Sales List that reconciles with the Modelo 303 intracom boxes. Standard: AEAT Modelo 349 — declaración recapitulativa (Orden EHA/769/2010 y modificaciones; presentación telemática XML por Servicio Web / formulario)

This XML is the telematic presentation body of the Modelo 349 recapitulative statement, not a standalone document deposited anywhere. The AI builds and totals the rows; the taxpayer must validate each counterparty's NIF-IVA against VIES, confirm the period and clave, and submit through the AEAT Sede Electrónica with an electronic certificate. Element names and the period regime depend on the active design — verify against the current diseño de registro del Modelo 349 before sending.


When this applies


Filing procedure

  1. Read the source. Accept a VAT ledger export, the SII intra-EU aggregates, an invoice CSV/JSON, or pasted totals. Identify each intra-EU operation: counterparty country + NIF-IVA, the operation type, the period amount, and whether it is a correction.
  2. Extract fields. For each counterparty + clave combination capture: counterparty name, NIF comunitario (country prefix + number), clave de operación, and the period importe. For rectificaciones also capture the original period (ejercicio + periodo) and the original declared amount. Missing or unverifiable NIF-IVA → ask, do not guess.
  3. Normalize. Aggregate all invoices for the same counterparty + same clave into a single row (one Declarado per counterparty/clave). Amounts in EUR, integer or 2-decimal per the design (dot decimal, no thousands separator). NIF-IVA uppercased, country prefix kept (e.g. FR, DE).
  4. Classify the clave. Map each operation to its clave de operación (E, A, T, S, I, M, H…) using the code table.
  5. Build the rows. Emit one RegistroDeclarado per counterparty/clave; emit RegistroRectificacion rows for corrections to prior periods.
  6. Total and reconcile. Sum the importes into the resumen; reconcile entregas (E) with Modelo 303 box for entregas intracomunitarias and adquisiciones (A) with the intracom acquisition boxes. Validate against the checklist.

Source → Modelo 349 field map

From the source → Target element / field
Declarant NIF Declarante/NIFDeclarante
Declarant name Declarante/NombreRazon
Exercise (year) Declarante/Ejercicio
Period (01–12 / 1T–4T / 0A) Declarante/Periodo
Counterparty country prefix + VAT number Declarado/NIFOperadorIntracomunitario
Counterparty name Declarado/NombreRazon
Operation key Declarado/ClaveOperacion
Period amount (base) Declarado/BaseImponible
Triangular operation flag Declarado/OperacionIntracomTriangular
— for a correction: original year Rectificacion/EjercicioRectificado
— original period Rectificacion/PeriodoRectificado
— corrected (new) amount Rectificacion/BaseImponible
— previously declared amount Rectificacion/BaseImponibleAnterior
Total counterparties declared Resumen/NumeroOperadores
Total of all importes Resumen/ImporteOperaciones

Every required output field appears above. Repeat Declarado once per counterparty/clave and Rectificacion once per corrected prior-period row.


Document structure

Modelo349
├── Declarante                         (header — once per declaration)
│   ├── NIFDeclarante
│   ├── NombreRazon
│   ├── Ejercicio                      (yyyy)
│   ├── Periodo                        (01–12 | 1T–4T | 0A annual)
│   └── Telefono / PersonaContacto     (optional)
├── Declarados                         (current-period operations)
│   └── Declarado                      (one per counterparty + clave, repeatable)
│       ├── NIFOperadorIntracomunitario  (country prefix + VIES number)
│       ├── NombreRazon
│       ├── ClaveOperacion             (E, A, T, S, I, M, H…)
│       └── BaseImponible
├── Rectificaciones                    (corrections to prior periods, optional)
│   └── Rectificacion                  (repeatable)
│       ├── NIFOperadorIntracomunitario
│       ├── NombreRazon
│       ├── ClaveOperacion
│       ├── EjercicioRectificado
│       ├── PeriodoRectificado
│       ├── BaseImponible              (new amount)
│       └── BaseImponibleAnterior      (previously declared)
└── Resumen
    ├── NumeroOperadores               (count of Declarado rows)
    └── ImporteOperaciones             (Σ BaseImponible)

A row may also carry OperacionIntracomTriangular to flag a triangular operation. Distance-sale keys M/H are legacy and largely superseded by the OSS (Modelo 369) for B2C.


Code tables

Clave de operación

Code Meaning
E Entregas intracomunitarias de bienes (intra-EU supplies of goods)
A Adquisiciones intracomunitarias de bienes (intra-EU acquisitions of goods)
T Entregas en otro Estado miembro subsiguientes a adquisiciones intracom exentas en operación triangular
S Prestaciones intracomunitarias de servicios (services supplied)
I Adquisiciones intracomunitarias de servicios (services received)
M Entregas de bienes posteriores a importaciones exentas (representante fiscal — legacy distance/import)
H Entregas de bienes posteriores a importaciones exentas efectuadas por el representante fiscal
R Transferencias de bienes en el marco de acuerdos de ventas en consigna (call-off stock — envío)
D Devoluciones de bienes desde acuerdos de ventas en consigna
C Sustituciones del destinatario en acuerdos de ventas en consigna

Periodo

Code Meaning
0112 Monthly period (default obligation)
1T4T Quarterly period (intra-EU goods ≤ €50,000 in the quarter and previous four)
0A Annual (legacy, limited cases)

NIF comunitario (country prefix examples)

Prefix Member State
ES España
FR France
DE Germany
IT Italy
PT Portugal
NL Netherlands

Each NIFOperadorIntracomunitario is the country prefix immediately followed by the national VAT number, validated against VIES.


Calculation rules


Worked example (end-to-end)

Input — March 2026 intra-EU operations (pasted)

Declarante: Comercial Ejemplo SL   NIF: B12345678
Ejercicio 2026, periodo 03 (mensual)

Operaciones del periodo:
  - Venta de mercaderías a MAISON DUPONT (FR, NIF FR40123456789): 2 facturas, 12.000,00 € + 8.000,00 €  → entrega intracom de bienes
  - Compra de componentes a BAUTEILE GMBH (DE, NIF DE811234567): 1 factura 5.000,00 €  → adquisición intracom de bienes
  - Servicios de consultoría prestados a ROSSI SRL (IT, NIF IT12345670017): 3.000,00 €  → prestación intracom de servicios

Rectificación de febrero 2026:
  - MAISON DUPONT (FR40123456789), clave E: declarado 10.000,00 €, importe correcto 9.000,00 €

After extraction + normalization (intermediate)

Declarado rows (aggregated by counterparty + clave):
  FR40123456789  MAISON DUPONT   clave E   12000.00 + 8000.00 = 20000.00
  DE811234567    BAUTEILE GMBH   clave A   5000.00
  IT12345670017  ROSSI SRL       clave S   3000.00

Rectificacion rows:
  FR40123456789  MAISON DUPONT   clave E   ejercicio 2026 periodo 02
                 BaseImponible 9000.00 / BaseImponibleAnterior 10000.00

Resumen: NumeroOperadores = 3 ; ImporteOperaciones = 20000.00 + 5000.00 + 3000.00 = 28000.00

Output — Modelo 349 presentation XML

<?xml version="1.0" encoding="UTF-8"?>
<Modelo349>
  <Declarante>
    <NIFDeclarante>B12345678</NIFDeclarante>
    <NombreRazon>Comercial Ejemplo SL</NombreRazon>
    <Ejercicio>2026</Ejercicio>
    <Periodo>03</Periodo>
  </Declarante>
  <Declarados>
    <Declarado>
      <NIFOperadorIntracomunitario>FR40123456789</NIFOperadorIntracomunitario>
      <NombreRazon>MAISON DUPONT</NombreRazon>
      <ClaveOperacion>E</ClaveOperacion>
      <BaseImponible>20000.00</BaseImponible>
    </Declarado>
    <Declarado>
      <NIFOperadorIntracomunitario>DE811234567</NIFOperadorIntracomunitario>
      <NombreRazon>BAUTEILE GMBH</NombreRazon>
      <ClaveOperacion>A</ClaveOperacion>
      <BaseImponible>5000.00</BaseImponible>
    </Declarado>
    <Declarado>
      <NIFOperadorIntracomunitario>IT12345670017</NIFOperadorIntracomunitario>
      <NombreRazon>ROSSI SRL</NombreRazon>
      <ClaveOperacion>S</ClaveOperacion>
      <BaseImponible>3000.00</BaseImponible>
    </Declarado>
  </Declarados>
  <Rectificaciones>
    <Rectificacion>
      <NIFOperadorIntracomunitario>FR40123456789</NIFOperadorIntracomunitario>
      <NombreRazon>MAISON DUPONT</NombreRazon>
      <ClaveOperacion>E</ClaveOperacion>
      <EjercicioRectificado>2026</EjercicioRectificado>
      <PeriodoRectificado>02</PeriodoRectificado>
      <BaseImponible>9000.00</BaseImponible>
      <BaseImponibleAnterior>10000.00</BaseImponibleAnterior>
    </Rectificacion>
  </Rectificaciones>
  <Resumen>
    <NumeroOperadores>3</NumeroOperadores>
    <ImporteOperaciones>28000.00</ImporteOperaciones>
  </Resumen>
</Modelo349>

Normalisations shown: the two MAISON DUPONT invoices aggregated into one E row (12000.00 + 8000.00 = 20000.00); amounts 12.000,00 €12000.00 (dot decimal, 2dp); NIF-IVA kept with country prefix (FR40123456789); operation types mapped to claves (E, A, S); the February correction emitted as a Rectificacion carrying the new total 9000.00 and the prior 10000.00; resumen recomputed (NumeroOperadores = 3, ImporteOperaciones = 28000.00). Clave E total (20000.00) reconciles with the Modelo 303 entregas intracomunitarias box; clave A (5000.00) with the adquisiciones intracom box.


Validation checklist


Last updated: 2026-06-13 — verify the current Modelo 349 diseño de registro, clave de operación list, and period thresholds against the AEAT specification before use.