Build the SII Libro Registro de Facturas Recibidas XML (AEAT)
Skill: Convert received-invoice records into the SII Facturas Recibidas XML
Region: Spain (España)
Category: VAT — SII (Suministro Inmediato de Información)
Does: Takes a taxpayer's received (purchase) invoice records and produces the SuministroLRFacturasRecibidas XML for the AEAT SII purchase ledger (Libro Registro de Facturas Recibidas), reporting each registered invoice in near real time.
Standard: AEAT SII — SuministroLRFacturasRecibidas (esquemas SuministroLR.xsd / SuministroInformacion.xsd, v1.1)
This XML is the SOAP body submitted to the AEAT SII web service (not a stand-alone file); it is wrapped in a SOAP envelope and sent over a mutually-authenticated TLS channel with the taxpayer's certificate. The submission deadline runs from the
FechaRegContable(the accounting registration date), not the invoice date — generally within 4 business days of registration. Validate the generated XML against the current XSD before sending; code lists and schema versions drift.
When this applies
- A taxpayer enrolled in SII (large companies > €6M turnover, VAT groups, REDEME monthly-refund registrants, or voluntary registrants) must report every invoice entered in the Libro Registro de Facturas Recibidas (purchases/inputs).
- Each
RegistroLRFacturasRecibidasis one received invoice (or a summary/aggregated entry where allowed). Multiple registros may be batched in one submission. - Submitted near real time: within 4 business days of the
FechaRegContable, excluding Saturdays, Sundays, and national holidays. - Excluded here: issued-invoice ledger (
SuministroLRFacturasEmitidas), the investment-goods, intra-community-operations, and cash-collection ledgers — each has its own root and schema.
Input data required
| Input | SII element |
|---|---|
| Receiving taxpayer name and NIF (the Titular) | sii:Cabecera/sii:Titular/sii:NombreRazon, sii:NIF |
| SII schema version (1.1) | sii:Cabecera/sii:IDVersionSii |
| Communication type (new / modify) | sii:Cabecera/sii:TipoComunicacion |
| Fiscal year and period (month) | sii:PeriodoLiquidacion/sii:Ejercicio, sii:Periodo |
| Supplier (issuer) NIF | siiLR:IDFactura/sii:IDEmisorFactura/sii:NIF |
| Invoice number / series | siiLR:IDFactura/sii:NumSerieFacturaEmisor |
| Invoice issue date | siiLR:IDFactura/sii:FechaExpedicionFacturaEmisor |
| Invoice type | siiLR:FacturaRecibida/sii:TipoFactura |
| Special regime / transcendence key | sii:ClaveRegimenEspecialOTrascendencia |
| Invoice total (gross) | sii:ImporteTotal |
| Operation description | sii:DescripcionOperacion |
| VAT rate, taxable base, input VAT borne | sii:DetalleIVA/sii:TipoImpositivo, sii:BaseImponible, sii:CuotaSoportada |
| Deductible VAT | sii:CuotaDeducible |
| Accounting registration date (starts deadline) | sii:FechaRegContable |
| Supplier name and NIF (the Contraparte) | sii:Contraparte/sii:NombreRazon, sii:NIF |
If any required field is missing or ambiguous (e.g. no FechaRegContable, or CuotaDeducible not stated for a partial-deduction case), stop and ask — never default or guess.
Document structure
siiLR:SuministroLRFacturasRecibidas
├── sii:Cabecera
│ ├── sii:IDVersionSii (1.1)
│ ├── sii:Titular (the receiving taxpayer)
│ │ ├── sii:NombreRazon
│ │ └── sii:NIF
│ └── sii:TipoComunicacion (A0 alta | A1 modificación)
└── siiLR:RegistroLRFacturasRecibidas (one per invoice; repeatable)
├── sii:PeriodoLiquidacion
│ ├── sii:Ejercicio (2026)
│ └── sii:Periodo (01–12)
├── siiLR:IDFactura
│ ├── sii:IDEmisorFactura
│ │ └── sii:NIF (the SUPPLIER's NIF)
│ ├── sii:NumSerieFacturaEmisor
│ └── sii:FechaExpedicionFacturaEmisor (dd-mm-yyyy)
└── siiLR:FacturaRecibida
├── sii:TipoFactura (F1, F2, F5, R1–R5…)
├── sii:ClaveRegimenEspecialOTrascendencia (01, 02…)
├── sii:ImporteTotal (gross)
├── sii:DescripcionOperacion
├── sii:DesgloseFactura
│ └── sii:DesgloseIVA
│ └── sii:DetalleIVA (one per rate; repeatable)
│ ├── sii:TipoImpositivo
│ ├── sii:BaseImponible
│ └── sii:CuotaSoportada
├── sii:CuotaDeducible (≤ Σ CuotaSoportada)
├── sii:FechaRegContable (dd-mm-yyyy; starts the deadline)
└── sii:Contraparte (the SUPPLIER)
├── sii:NombreRazon
└── sii:NIF
Note the prefix split: structural/common elements come from SuministroInformacion.xsd (sii:), while the two ledger wrappers (SuministroLRFacturasRecibidas, RegistroLRFacturasRecibidas, IDFactura, FacturaRecibida) come from SuministroLR.xsd (siiLR:). In Facturas Recibidas the IDEmisorFactura and the Contraparte are both the supplier; the Titular is the receiving taxpayer.
Source → SII field map
| From the source | → SII element |
|---|---|
| Our (buyer) company name | sii:Cabecera/sii:Titular/sii:NombreRazon |
| Our NIF/CIF | sii:Cabecera/sii:Titular/sii:NIF |
| Reporting mode | sii:TipoComunicacion (A0 new / A1 modify) |
| Year of the settlement period | sii:PeriodoLiquidacion/sii:Ejercicio |
| Month registered | sii:PeriodoLiquidacion/sii:Periodo (01–12) |
| Supplier tax ID (on the invoice) | sii:IDEmisorFactura/sii:NIF |
| Invoice number/series printed by supplier | sii:NumSerieFacturaEmisor |
| Invoice issue date | sii:FechaExpedicionFacturaEmisor (dd-mm-yyyy) |
| Invoice type (ordinary, simplified, rectifying…) | sii:TipoFactura |
| Regime/transcendence | sii:ClaveRegimenEspecialOTrascendencia |
| Invoice gross total | sii:ImporteTotal |
| What was bought | sii:DescripcionOperacion |
| VAT rate applied | sii:DetalleIVA/sii:TipoImpositivo |
| Net amount per rate | sii:DetalleIVA/sii:BaseImponible |
| VAT borne per rate | sii:DetalleIVA/sii:CuotaSoportada |
| VAT we may deduct | sii:CuotaDeducible |
| Date entered in our books | sii:FechaRegContable (dd-mm-yyyy) |
| Supplier name | sii:Contraparte/sii:NombreRazon |
| Supplier NIF | sii:Contraparte/sii:NIF |
Every required element appears above. Foreign suppliers use sii:IDOtro (with IDType + ID) instead of sii:NIF inside IDEmisorFactura/Contraparte; ask the user if the supplier is non-Spanish.
Code tables
TipoComunicacion
| Code | Meaning |
|---|---|
A0 |
Alta — new registration of invoices |
A1 |
Modificación — modify previously sent invoices |
TipoFactura (received)
| Code | Meaning |
|---|---|
F1 |
Ordinary invoice (factura) |
F2 |
Simplified invoice / ticket (factura simplificada) |
F5 |
Import (DUA / customs assessment) |
R1 |
Rectifying invoice — error of law / Art. 80.1, 80.2, 80.6 |
R2 |
Rectifying invoice — Art. 80.3 (insolvency / concurso) |
R3 |
Rectifying invoice — Art. 80.4 (bad debts) |
R4 |
Rectifying invoice — other |
R5 |
Rectifying invoice — on simplified invoices |
ClaveRegimenEspecialOTrascendencia (received)
| Code | Meaning |
|---|---|
01 |
General regime operation |
02 |
Operations through which businesses pay compensation (REAGYP) |
03 |
Special regime — used goods, art, antiques, collectibles |
04 |
Special regime — investment gold |
05 |
Special regime — travel agencies |
06 |
Special regime — group of entities (VAT group, advanced level) |
07 |
Special cash-basis regime (criterio de caja) |
08 |
Operations subject to IPSI / IGIC |
09 |
Intra-Community acquisitions of goods and services |
12 |
Operations of leasing of business premises |
13 |
Invoice corresponding to an import (without DUA) |
14 |
First-half-year deferred reporting (transitional) |
Periodo
| Code | Meaning |
|---|---|
01–12 |
January (01) through December (12), the month of the settlement period |
Calculation rules
- Per VAT line:
sii:CuotaSoportada=sii:BaseImponible× (sii:TipoImpositivo/ 100), rounded to 2 decimals. Compute onesii:DetalleIVAper distinct rate on the invoice. - Invoice total:
sii:ImporteTotal= ΣBaseImponible+ ΣCuotaSoportada(plus any equivalence surcharge / non-VAT amounts where applicable), rounded to 2 decimals. - Deductible VAT:
sii:CuotaDeducibleis reported separately and may be less than ΣCuotaSoportada— e.g. under prorrata (partial exemption) or a partly non-deductible expense, only the deductible fraction is entered. When deduction is full,CuotaDeducible= ΣCuotaSoportada; when partial,CuotaDeducible< ΣCuotaSoportadaand the difference is the non-deductible (cost) portion. - Amounts in EUR with 2 decimals and a dot decimal separator; no thousands separators.
- Always recompute every cuota and the total from the base and rate; flag any mismatch with the figure printed on the supplier's invoice rather than silently copying it.
Worked example (end-to-end)
Taxpayer EMPRESA RECEPTORA SL (NIF B12345678) registers an ordinary received invoice from supplier PROVEEDOR EJEMPLO SA (NIF A87654321): 2026 period 03, base 1000.00 at 21% → CuotaSoportada 210.00, fully deductible (CuotaDeducible 210.00), ImporteTotal 1210.00, accounting registration date 18-03-2026.
<?xml version="1.0" encoding="UTF-8"?>
<siiLR:SuministroLRFacturasRecibidas
xmlns:sii="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroInformacion.xsd"
xmlns:siiLR="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroLR.xsd">
<sii:Cabecera>
<sii:IDVersionSii>1.1</sii:IDVersionSii>
<sii:Titular>
<sii:NombreRazon>EMPRESA RECEPTORA SL</sii:NombreRazon>
<sii:NIF>B12345678</sii:NIF>
</sii:Titular>
<sii:TipoComunicacion>A0</sii:TipoComunicacion>
</sii:Cabecera>
<siiLR:RegistroLRFacturasRecibidas>
<sii:PeriodoLiquidacion>
<sii:Ejercicio>2026</sii:Ejercicio>
<sii:Periodo>03</sii:Periodo>
</sii:PeriodoLiquidacion>
<siiLR:IDFactura>
<sii:IDEmisorFactura>
<sii:NIF>A87654321</sii:NIF>
</sii:IDEmisorFactura>
<sii:NumSerieFacturaEmisor>FRA-2026-0042</sii:NumSerieFacturaEmisor>
<sii:FechaExpedicionFacturaEmisor>15-03-2026</sii:FechaExpedicionFacturaEmisor>
</siiLR:IDFactura>
<siiLR:FacturaRecibida>
<sii:TipoFactura>F1</sii:TipoFactura>
<sii:ClaveRegimenEspecialOTrascendencia>01</sii:ClaveRegimenEspecialOTrascendencia>
<sii:ImporteTotal>1210.00</sii:ImporteTotal>
<sii:DescripcionOperacion>Material de oficina y consumibles</sii:DescripcionOperacion>
<sii:DesgloseFactura>
<sii:DesgloseIVA>
<sii:DetalleIVA>
<sii:TipoImpositivo>21</sii:TipoImpositivo>
<sii:BaseImponible>1000.00</sii:BaseImponible>
<sii:CuotaSoportada>210.00</sii:CuotaSoportada>
</sii:DetalleIVA>
</sii:DesgloseIVA>
</sii:DesgloseFactura>
<sii:CuotaDeducible>210.00</sii:CuotaDeducible>
<sii:FechaRegContable>18-03-2026</sii:FechaRegContable>
<sii:Contraparte>
<sii:NombreRazon>PROVEEDOR EJEMPLO SA</sii:NombreRazon>
<sii:NIF>A87654321</sii:NIF>
</sii:Contraparte>
</siiLR:FacturaRecibida>
</siiLR:RegistroLRFacturasRecibidas>
</siiLR:SuministroLRFacturasRecibidas>
Normalisations shown: issue date 15/03/2026 → 15-03-2026 (dd-mm-yyyy); accounting date 18/03/2026 → 18-03-2026; rate 21% → 21; amounts to 2 decimals with a dot (1.000,00 € → 1000.00). The FechaRegContable of 18-03-2026 starts the ~4-business-day submission clock. A literal ampersand in a name (e.g. GARCÍA & ASOCIADOS) must be escaped as GARCÍA & ASOCIADOS.
For a partial-deduction variant (50% prorrata), keep CuotaSoportada at 210.00 but set <sii:CuotaDeducible>105.00</sii:CuotaDeducible> — the remaining 105.00 is a non-deductible cost.
Validation checklist
- Current SII schema version reported (
sii:IDVersionSii= 1.1) and XML validated against the activeSuministroLR.xsd/SuministroInformacion.xsd - Two namespaces declared and prefixes kept consistent:
sii(SuministroInformacion) vssiiLR(SuministroLR) -
Titularis the receiving taxpayer;IDEmisorFacturaandContraparteare both the supplier -
TipoComunicacioncorrect (A0new /A1modification) -
EjercicioandPeriodo(01–12) match the settlement period - Dates in dd-mm-yyyy (
FechaExpedicionFacturaEmisor,FechaRegContable) -
TipoFactura,ClaveRegimenEspecialOTrascendenciaare valid codes for received invoices - Per-line
CuotaSoportada=BaseImponible×TipoImpositivo; recomputed, mismatches flagged -
ImporteTotal= Σ base + Σ cuota; reconciles with the printed invoice total -
CuotaDeducible≤ ΣCuotaSoportada; partial/prorrata deduction handled explicitly - Literal
&escaped as&; XML well-formed with balanced, nested tags - Submission within ~4 business days of
FechaRegContable; sent in the SOAP envelope to the AEAT SII web service
Last updated: 2026-06-12 — verify the active SII schema version (SuministroLR), code lists, and AEAT submission deadlines against the current specification before use.