> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filexpress.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Financial statements

> Trial balance, income statement (also by cost center), balance sheet and movements without a cost center

**Required permission:** `accounting.reports`

Reports only consider **PROCESADA** (processed) journal entries. Common parameters:

| Parameter | Description |
| - | - |
| `branch_id` | Optional. Limits the report to one branch; without it, the report consolidates the whole business. |
| `depth` | Optional (1–10). Account detail level; by default, the one configured in FileXpress. |
| `cost_center_id` | Optional, only for the trial balance and income statement. Considers only the lines of that [cost center](https://docs.filexpress.app/en/docs/api/contabilidad/centros-de-costo.md). |
| `include_children` | Optional (`true` by default). With `cost_center_id`, also includes its sub-centers. |

A `branch_id` or cost center from another company returns `404`.

## Trial balance

```http theme={null}
GET /accounting/reports/trial-balance?as_of_date=2026-10-31
```

```json theme={null}
{
  "status": true,
  "data": {
    "title": "Balanza de Comprobación",
    "as_of_date": "31/10/2026",
    "accounts": [
      { "code": "1101", "name": "Efectivo y equivalentes", "level": 3, "sum_debit": 15200.00, "sum_credit": 9800.00, "debit_balance": 5400.00, "credit_balance": 0 }
    ],
    "total_sum_debit": 152340.10,
    "total_sum_credit": 152340.10,
    "total_debit_balance": 80450.00,
    "total_credit_balance": 80450.00,
    "detail_level": 4,
    "generated_at": "31/10/2026 18:20:05"
  }
}
```

## Income statement

```http theme={null}
GET /accounting/reports/income-statement?start_date=2026-01-01&end_date=2026-10-31
```

Returns `income`, `costs` and `expenses` (accounts with `code`, `name`, `amount`, `level`) and the totals `total_income`, `total_costs`, `total_expenses`, `gross_profit`, `operating_income` and `net_income`.

## Income statement by cost center

```http theme={null}
GET /accounting/reports/income-statement-by-cost-center?start_date=2026-10-01&end_date=2026-10-31&cost_center_ids[]=uuid-A&cost_center_ids[]=uuid-B
```

| Parameter | Required | Description |
| - | - | - |
| `start_date`, `end_date` | Yes | Date range in `YYYY-MM-DD` format. |
| `cost_center_ids[]` | No | Centers that become columns; each column adds up the center and its sub-centers. |
| `parent_cost_center_id` | No | If you don't send `cost_center_ids`, the columns are the direct sub-centers of this center. |
| `branch_id`, `depth` | No | Same as in the other reports. |

Without `cost_center_ids` or `parent_cost_center_id`, the columns are the root centers. The `none` (**Sin centro**) and `total` columns are always added, and `other` (**Otros centros**) is added when there are movements from centers that are not included, so that the columns add up to the total.

```json theme={null}
{
  "status": true,
  "data": {
    "title": "Estado de resultados por centro de costo",
    "date_from": "01/10/2026",
    "date_to": "31/10/2026",
    "detail_level": 3,
    "columns": [
      { "key": "uuid-A", "id": "uuid-A", "code": "01", "name": "Ventas" },
      { "key": "none", "id": null, "code": null, "name": "Sin centro" },
      { "key": "total", "id": null, "code": null, "name": "Total" }
    ],
    "income": [
      { "code": "5", "name": "Ingresos", "level": 1, "amounts": { "uuid-A": 100.00, "none": 20.00, "total": 120.00 } }
    ],
    "costs": [],
    "expenses": [
      { "code": "6", "name": "Gastos", "level": 1, "amounts": { "uuid-A": 40.00, "none": 0, "total": 40.00 } }
    ],
    "totals": {
      "uuid-A": { "income": 100.00, "costs": 0, "expenses": 40.00, "gross_profit": 100.00, "net_income": 60.00 },
      "none": { "income": 20.00, "costs": 0, "expenses": 0, "gross_profit": 20.00, "net_income": 20.00 },
      "total": { "income": 120.00, "costs": 0, "expenses": 40.00, "gross_profit": 120.00, "net_income": 80.00 }
    }
  }
}
```

The amounts of each row are in `amounts`, indexed by the column `key`. `totals.total` matches the [Income statement](#income-statement) for the same period and branch.

## Movements without a cost center

```http theme={null}
GET /accounting/reports/movements-without-cost-center?start_date=2026-10-01&end_date=2026-10-31&status=all
```

Lists the journal entry lines on accounts that accept or require a cost center and that don't have one. Use it to fix them before closing.

| Parameter | Required | Description |
| - | - | - |
| `start_date`, `end_date` | Yes | Date range in `YYYY-MM-DD` format. |
| `status` | No | `all` (default: drafts and processed), `BORRADOR` or `PROCESADA`. |
| `branch_id` | No | Limits to one branch. |

```json theme={null}
{
  "status": true,
  "data": {
    "rows": [
      {
        "journal_entry_id": "uuid",
        "entry_code": "DIA-2026-10-0042",
        "entry_date": "2026-10-05",
        "status": "PROCESADA",
        "description": "Compra de papelería",
        "detail_id": "uuid",
        "account_code": "6102",
        "account_name": "Papelería",
        "policy": "required",
        "debit": 100.00,
        "credit": 0,
        "reference_detail": "Papelería"
      }
    ],
    "by_account": [
      { "account_code": "6102", "account_name": "Papelería", "policy": "required", "lines": 1, "debit": 100.00, "credit": 0 }
    ],
    "total_lines": 1
  }
}
```

`policy` is the account's policy: `optional` (accepts a center) or `required` (requires one). Unlike the other reports, this one includes **BORRADOR** (draft) entries unless you filter by `status`. Lines are fixed in FileXpress with [cost center reassignment](https://docs.filexpress.app/en/docs/contabilidad/centros-de-costo.md#reassign-cost-centers-in-a-journal-entry).

## Export cost center reports

The two cost center reports (and [Budget vs. actual](https://docs.filexpress.app/en/docs/api/contabilidad/presupuestos.md#budget-vs-actual-report)) accept the `format` parameter:

| `format` | Response |
| - | - |
| `json` | Default. The JSON described above. |
| `pdf` | `application/pdf` file (`estado-resultados-por-centro-YYYYMMDD.pdf` or `movimientos-sin-centro-YYYYMMDD.pdf`). The by-center statement is landscape; with more than 8 centers, the columns are split across pages of 8 centers plus the Total. |
| `excel` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` file (`.xlsx`). |

```http theme={null}
GET /accounting/reports/income-statement-by-cost-center?start_date=2026-10-01&end_date=2026-10-31&format=pdf
```

With `pdf` and `excel` the response is the file (not JSON); validation errors still respond with JSON and `422`. A value other than `json`, `pdf` or `excel` responds with `422`.

## Balance sheet

```http theme={null}
GET /accounting/reports/balance-sheet?as_of_date=2026-10-31
```

Returns `assets`, `liabilities` and `equity` (accounts with `code`, `name`, `balance`, `level`), `current_earnings` (profit for the year) and the totals `total_assets`, `total_liabilities`, `total_equity` and `total_liabilities_equity`.

> [!NOTE]
>
> Dates inside the reports (`as_of_date`, `date_from`, `date_to`, `generated_at`) are returned in `DD/MM/YYYY` format, the same as in the printed reports.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.