Build Sistema RED / SILTRA Contribution Files
Skill: Convert payroll contribution data into the Sistema RED liquidation segment files
Region: Spain (España) Category: Payroll — Seguridad Social (Sistema RED / SILTRA, Sistema de Liquidación Directa) Does: Takes a month's social-security contribution data and produces the SILTRA liquidation segment files exchanged under the Sistema de Liquidación Directa (SLD) — the fixed-width / segmented flat files keyed by CCC (Código Cuenta de Cotización) and NAF/NUSS that carry each worker's bases de cotización and conceptos, plus the structure to reconcile the request against the TGSS response (fichero de respuesta). Standard: TGSS Sistema RED — Sistema de Liquidación Directa (SLD); ficheros de bases (FAN/segmentos), SILTRA winsuite; diseños de registro de la Tesorería General de la Seguridad Social
These are fixed-width / segmented flat files transmitted to the TGSS through SILTRA, not XML or JSON. The AI lays out the segments and computes bases and cuotas; the employer must validate against the current TGSS diseños de registro and reconcile the fichero de bases/solicitud with the TGSS fichero de respuesta (DCL — Datos de Cálculo de la Liquidación / RNT-RLC) before confirming. Segment layouts and contribution tipos change every year (Orden de cotización and the annual Ley de PGE) — verify the active design before use.
When this applies
- Any employer registered in the Sistema RED who must declare and pay monthly Social Security contributions for employees under the Sistema de Liquidación Directa (the TGSS calculates the liquidation; the employer supplies bases and conceptos and receives the borrador / RLC).
- The cycle: the employer sends the fichero de bases / solicitud de borrador, the TGSS returns the fichero de respuesta with the calculated liquidation (RNT — Relación Nominal de Trabajadores, and RLC — Recibo de Liquidación de Cotizaciones), the employer confirms, and pays by direct debit or electronic payment.
- Deadline: the contribution period is the calendar month; presentation and payment run through the whole following month (liquidation must be transmitted and confirmed by the last calendar day of the month following the período de liquidación; SLD transmission of bases by around the penultimate natural day).
- Excluded: the legacy RED Directo / autónomos RETA self-employed flat-rate (different flows), and contribution regularizations handled by separate L00/L13 liquidation types.
Filing procedure
- Read the source. Accept a payroll export (CSV/JSON), HR system extract, or pasted per-employee figures. Identify the employer CCC, the contribution month, and per worker: NAF/NUSS, IPF (DNI/NIE), grupo de cotización, days worked, bases de cotización, and remuneration concepts.
- Extract fields. Per CCC capture the régimen and the liquidation type; per worker capture NAF, grupo, CNAE/ocupación for AT/EP, base de contingencias comunes (CC), base de contingencias profesionales (CP/AT-EP), horas extra bases, and conceptos retributivos (CRA — conceptos retributivos abonados). Missing NAF or base → ask, never invent.
- Normalize. Money as cents (no decimal point) or 2-decimal per the segment design; dates
ddmmaaaa; identifiers right-padded/left-zero-filled to fixed width; text fields space-padded to the field length. Each record is a fixed-length line. - Compute the bases. Cap each base within the topes mínimo/máximo for the worker's grupo; compute cuotas = base × tipo for each contingency where the file carries them; sum per CCC.
- Lay out the segments. Emit the header (registro de empresa / CCC), the per-worker tramo segments, and the trailer/totales, each as a fixed-width line per the TGSS diseño.
- Transmit and reconcile. Send via SILTRA; on receiving the fichero de respuesta (DCL/RNT-RLC), reconcile the TGSS-calculated cuotas against the bases sent and confirm. Validate against the checklist.
Source → Sistema RED segment field map
| From the source | → Segment / field |
|---|---|
| Employer CCC (régimen + province + number) | Registro empresa — CCC (11 pos) |
| Contribution régimen (0111 general…) | Registro empresa — RegimenCotizacion |
| Período de liquidación (mes/año) | Cabecera — PeriodoLiquidacion (mmaaaa) |
| Tipo de liquidación (L00 ordinaria…) | Cabecera — TipoLiquidacion |
| Worker NAF / NUSS | Registro trabajador — NAF (12 pos) |
| Worker IPF (DNI/NIE) | Registro trabajador — IPF |
| Grupo de cotización (01–11) | Registro trabajador — GrupoCotizacion |
| Días / tramo de alta | Tramo — FechaDesde/FechaHasta, DiasTramo |
| Base contingencias comunes | Tramo — BaseCC |
| Base contingencias profesionales (AT/EP) | Tramo — BaseCP |
| Base horas extraordinarias | Tramo — BaseHorasExtra |
| Conceptos retributivos abonados (CRA) | Segmento CRA — ClaveConcepto, Importe |
| Cuota empresa contingencias comunes | Trailer/DCL — CuotaEmpresaCC |
| Cuota trabajador | Trailer/DCL — CuotaTrabajador |
| Total líquido a ingresar (CCC) | Trailer — LiquidoIngresar |
Every required field appears above. The TGSS fichero de respuesta mirrors these keys (CCC + NAF + período) and adds the calculated cuotas for reconciliation.
Output structure
Fichero de bases / solicitud (SLD) — fixed-width segmented flat file
├── Registro de cabecera del envío (sender, presentador, autorización RED)
├── Registro de empresa (por CCC) (CCC, régimen, período de liquidación, tipo L00…)
│ ├── Registro de trabajador (por NAF) (NAF, IPF, grupo cotización, CNAE/ocupación)
│ │ ├── Tramo de bases (fecha desde/hasta, días, BaseCC, BaseCP, horas extra)
│ │ └── Segmento CRA (conceptos retributivos: clave + importe)
│ └── … (repite por trabajador)
├── Registro de totales del CCC (sumas de bases y cuotas, líquido a ingresar)
└── Registro de fin de envío (recuento de registros, control)
Fichero de respuesta (TGSS) — para conciliar
├── DCL — Datos de Cálculo de la Liquidación (cuotas calculadas por la TGSS por NAF)
├── RNT — Relación Nominal de Trabajadores
└── RLC — Recibo de Liquidación de Cotizaciones (líquido confirmado a ingresar)
Each line is a fixed-length record; field positions and lengths follow the TGSS diseño de registro for the SLD. The request carries bases; the response carries TGSS-calculated cuotas to be reconciled and confirmed.
Code tables
Régimen de cotización (selected)
| Code | Meaning |
|---|---|
0111 |
Régimen General |
0112 |
Sistema Especial Agrario (cuenta ajena) |
0613 |
Régimen Especial Empleados de Hogar |
0521 |
RETA — Autónomos (different flow) |
Tipo de liquidación
| Code | Meaning |
|---|---|
L00 |
Liquidación ordinaria (mensual) |
L02 |
Atrasos por convenio colectivo |
L03 |
Salarios de tramitación |
L13 |
Liquidación complementaria por bonificación/deducción |
L90 |
Liquidación de vacaciones devengadas y no disfrutadas |
Grupo de cotización
| Grupo | Categoría |
|---|---|
01 |
Ingenieros y Licenciados |
02 |
Ingenieros técnicos, peritos, ayudantes titulados |
03 |
Jefes administrativos y de taller |
04–07 |
Auxiliares, subalternos, administrativos (mensuales) |
08–11 |
Oficiales y peones (cotización por días) |
Conceptos retributivos abonados (CRA) — claves de ejemplo
| Clave | Concepto |
|---|---|
0500 |
Salario base |
0501 |
Complementos salariales |
0510 |
Horas extraordinarias |
0511 |
Pluses extrasalariales / dietas |
Calculation rules
- Base de contingencias comunes (CC) = remuneración mensual computable + prorrata de pagas extraordinarias, capped between the tope mínimo (by grupo) and tope máximo mensual fixed each year by the Orden de cotización.
- Base de contingencias profesionales (CP / AT-EP) = CC base + horas extraordinarias, subject to the same máximo.
- Cuota por contingencia = base × tipo. For 2026 the headline tipos are: contingencias comunes 28,30 % (23,60 % empresa + 4,70 % trabajador); desempleo (tipo general) 7,05 % (5,50 % + 1,55 %); FOGASA 0,20 % (empresa); formación profesional 0,70 % (0,60 % + 0,10 %); AT/EP per the tarifa de primas (CNAE/ocupación); plus the MEI (Mecanismo de Equidad Intergeneracional) on the CC base. Confirm the current year's tipos.
- Horas extra: normales cotizan al tipo general; de fuerza mayor al tipo reducido — both excluded from the CC base but included in the CP base.
- Líquido a ingresar (CCC) = Σ cuotas (empresa + trabajador) − bonificaciones/reducciones aplicables.
- Reconciliation: the cuotas in the TGSS fichero de respuesta (DCL/RLC) must match the bases sent in the fichero de bases; flag any divergence before confirming. Never confirm a liquidation whose TGSS total does not reconcile with the sent bases.
- Amounts as integer cents in the fixed-width fields unless the design specifies a decimal; zero-fill numeric fields, space-fill text fields, to the exact length.
Worked example (end-to-end)
Input — June 2026 payroll for one CCC (pasted)
Empresa: Comercial Ejemplo SL
CCC: 28/1234567/89 Régimen: 0111 (General)
Período de liquidación: 06/2026 Tipo: L00
Trabajador:
Nombre: Ana López García
NAF: 281234567890 IPF (DNI): 12345678Z
Grupo de cotización: 05 (administrativo, mensual)
Tramo: 01/06/2026 a 30/06/2026 (30 días)
Salario base: 2.000,00 € Prorrata pagas extra: 333,33 €
Sin horas extraordinarias
After extraction + normalization (intermediate)
CCC normalizado: 28123456789 (régimen 0111)
Período: 062026 Tipo liquidación: L00
NAF: 281234567890 IPF: 12345678Z Grupo: 05
Tramo: 01062026 - 30062026 Días: 30
Base contingencias comunes (CC) = 2000.00 + 333.33 = 2333.33 (dentro de topes grupo 05)
Base contingencias profesionales (CP) = 2333.33
Conceptos: 0500 salario base 2000.00 ; (prorrata pagas incluida en base)
Cuotas (a calcular/confirmar por la TGSS en el fichero de respuesta):
CC empresa = 2333.33 × 23,60 % = 550.67
CC trabajador = 2333.33 × 4,70 % = 109.67
Desempleo (5,50 % + 1,55 %) = 128.33 + 36.17
FOGASA (0,20 %) = 4.67 ; FP (0,60 % + 0,10 %) = 14.00 + 2.33
Output — fichero de bases (SLD segmented flat file)
CAB SLD PRESENTADOR B12345678 COMERCIAL EJEMPLO SL AUTRED 00001 062026
EMP 28123456789 0111 062026 L00 COMERCIAL EJEMPLO SL
TRA 281234567890 12345678Z 05 0010 LOPEZ GARCIA ANA
TRM 01062026 30062026 030 BCC 000000233333 BCP 000000233333 BHE 000000000000
CRA 281234567890 0500 000000200000
CRA 281234567890 0501 000000033333
TOT 28123456789 BCC 000000233333 CEM 000000055067 CTR 000000010967 LIQ 000000066034
FIN 062026 REGISTROS 000007 CONTROL 0000000233333
Normalisations shown: CCC 28/1234567/89 → 28123456789 (11 positions, slashes removed); período 06/2026 → 062026 (mmaaaa); dates → ddmmaaaa (01062026); amounts to integer cents zero-filled (2.333,33 € → 000000233333); base CC recomputed 2000.00 + 333.33 = 2333.33; text fields space-padded. The TOT líquido (000000066034 = 660.34) is provisional — it must be reconciled against the TGSS fichero de respuesta (DCL/RLC) before the liquidation is confirmed and paid. (Field positions are illustrative; map to the exact TGSS diseño de registro for production.)
Validation checklist
- All employer and worker data extracted; AI asked about anything missing or ambiguous (no invented NAF, IPF, or bases)
- CCC normalized to 11 positions with the correct régimen; período as
mmaaaa; tipo de liquidación valid (L00…) - Each worker carries NAF (12), IPF, grupo de cotización, and at least one tramo with BaseCC and BaseCP
- Bases capped within the year's topes mínimo/máximo for the worker's grupo
- Horas extra handled separately (excluded from CC base, included in CP base) with the correct tipo
- Conceptos retributivos (CRA) coded with valid claves; importes consistent with the bases
- Numeric fields zero-filled, text fields space-filled, to the exact fixed width per the TGSS diseño
- Cuotas/tipos consistent with the current year's Orden de cotización (incl. MEI); AT/EP per CNAE/ocupación
- Fichero de respuesta (DCL/RNT-RLC) reconciled against the bases sent before confirming; divergences flagged
- Transmitted via SILTRA and confirmed within the following month (presentation/payment deadline)
Last updated: 2026-06-13 — verify the current TGSS Sistema RED / SLD diseños de registro, contribution tipos and topes (Orden de cotización), and SILTRA file layout against the official Tesorería General de la Seguridad Social specification before use.