---
title: "Compute and save a Modelo 303 or 130 for a quarter (preview: true to only compute)"
method: POST
path: "/api/forms/generate"
---

# Compute and save a Modelo 303 or 130 for a quarter (preview: true to only compute)

`POST /api/forms/generate`

## Request

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

## Request body

- GenerateInput
  - `modelo` '303' | '130', required
  - `year` integer
  - `quarter` integer
  - `preview` boolean: true = compute and show boxes without saving
  - `compensationBox78` number: Modelo 303: amount to compensate from previous periods (box 78)
  - `tipoDeclaracion` 'C' | 'D': Modelo 303 Q4 negative result: C compensar, D devolución
  - `iban` string: Required with tipoDeclaracion D
  - `manualCumulativeData` object: Modelo 130 edge cases only

## 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)
