---
title: "Store a previously filed Modelo 303 / 130 / 349"
method: POST
path: "/api/historical"
---

# Store a previously filed Modelo 303 / 130 / 349

`POST /api/historical`

## Request

- Base URL: `https://declararfacil.com`
- URL: `https://declararfacil.com/api/historical`
- Auth: HTTP bearer

## Request body

- HistoricalModeloInput
  - `modelo` '303' | '130' | '349', required
  - `year` integer, required
  - `quarter` integer
  - `sourceType` 'UPLOADED_FORM' | 'MANUAL_ENTRY': UPLOADED_FORM when read from a filed form, MANUAL_ENTRY when typed from the user's notes
  - `casillas` object: Every box printed on the form, keyed by its printed two- or three-digit number ('01', '71', '110', '120'). Monetary amounts in EUR; rate boxes in percent. Omitted keys preserve existing values, null clears, zero is stored. 130 boxes are cumulative. Aggregate aliases must agree with the same submitted box
  - `nif` string, nullable
  - `apellidosNombre` string, nullable
  - `numeroJustificante` string, nullable: AEAT receipt number exactly as printed; does not itself mark a filing as verified
  - `sourceDocumentUrl` string, nullable
  - `filed` boolean: Explicit assertion that this source was filed with AEAT. Separate from internal verified status. Omitted means unknown.
  - `datosExtraidos` object, nullable: Original extraction retained for provenance; does not populate boxes automatically. Replay casillas explicitly to repair an earlier import.
  - `period` string: 349 only: 1T..4T or 01..12. May use quarter for quarterly forms.
  - `operacionesIntracomunitarias` object[]
    - `pais` string, required
    - `vatIdEU` string, required
    - `nombreOperador` string, required
    - `clave` string, required
    - `baseImponible` number, required
    - `rectificaciones` object[]
  - `totalOperaciones` integer, nullable
  - `importeTotalOperaciones` number, nullable
  - `rectificaciones` object[]
  - `ivaDevengado` number, nullable: Modelo 303: total IVA devengado (box 27)
  - `ivaDeducible` number, nullable: Modelo 303: total IVA deducible (box 45)
  - `ivaResultado` number, nullable: Modelo 303: result (box 71)
  - `source_file` string, nullable

## Response `200`

OK

## Other responses

- `401`: invalid_token: unknown or replaced token; start a new connection with POST /api/agent/v1/connect
- `402`: subscription_required: no active subscription; the body carries subscribe_url, steps, next_step and tell_the_user

---

[API](https://skmtc.dev/declararfacil/apis/declarar-facil-agent-api.md) · [All operations](https://skmtc.dev/declararfacil/apis/declarar-facil-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/declararfacil/apis/declarar-facil-agent-api/revisions/6d6837a48359?raw)
