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

# Get accounting unit

> Returns the full record for a single accounting unit.

To get an accounting unit ID, use [List accounting units](/ruz/api-reference/identifier-lists/list-accounting-units).

<Tip>Learn more about [Data access](/ruz/getting-started/data-access) pattern used across the RÚZ API.</Tip>

***

## Common patterns

<AccordionGroup>
  <Accordion title="Handle deleted and non-public records">
    You can get three types of records, indicated by the `stav` value:

    | Type       | Field value   |
    | ---------- | ------------- |
    | Normal     | —             |
    | Deleted    | `"ZMAZANÉ"`   |
    | Non-public | `"Neverejná"` |

    ```js Handling deleted and non-public records theme={null}
    // 1. Fetch the accounting unit by ID
    const unit = await fetchUnit(id);

    // 2. Handle deleted record
    if (unit.stav === 'ZMAZANÉ') {
      // Do something
    } 

    // 3. Handle non-public record
    else if (unit.stav === 'Neverejná') {
      // Do something
    } 

    // 4. Handle normal record
    else {
      // Do something
    }
    ```
  </Accordion>

  <Accordion title="Follow links to financial statements and annual reports">
    * Use `idUctovnychZavierok` to fetch the entity's statements.
    * Use `idVyrocnychSprav` to fetch the entity's annual reports.

    ```js Fetch statements and annual reports from unit IDs theme={null}
    // 1. Fetch the accounting unit
    const unit = await fetchUnit(336953);

    // 2. Fetch the financial statements
    const statements = await Promise.all(
      (unit.idUctovnychZavierok ?? []).map(id => fetchStatement(id))
    );

    // 2. Fetch the annual reports
    const annualReports = await Promise.all(
      (unit.idVyrocnychSprav ?? []).map(id => fetchAnnualReport(id))
    );
    ```
  </Accordion>

  <Accordion title="Check if a unit is still active">
    You can use the `datumZrusenia` field to check if a unit is still active. It is absent when the unit is still active and `null` fields are omitted from the response entirely.

    ```js Check whether the unit is still active theme={null}
    // 1. Fetch the accounting unit
    const unit = await fetchUnit(336953);

    // 2. Check if the unit is still active
    const isActive = unit.datumZrusenia == null;
    ```
  </Accordion>

  <Accordion title="Resolve a classification code">
    Codes like `pravnaForma`, `skNace`, and `druhVlastnictva` are returned as raw codes. Resolve them against the codelist endpoints.

    ```js Resolve a classification code theme={null}
    // 1. Fetch the accounting unit
    const unit = await fetchUnit(336953);

    // 2. Fetch the legal forms
    const legalForms = await fetchLegalForms();

    // 3. Resolve the legal form
    const label = legalForms.find(f => f.kod === unit.pravnaForma)?.nazov?.sk;

    // 4. Log the legal form
    console.log(label);
    ```
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml ruz/openapi.json GET /api/uctovna-jednotka
openapi: 3.1.0
info:
  title: RÚZ API
  description: >-
    Public REST API for Slovakia's Register of Financial Statements (Register
    účtovných závierok). Exposes accounting units, financial statements,
    financial reports, and annual reports in JSON. Data is updated throughout
    the day as records are published.
  version: 2.5.0
  license:
    name: Creative Commons Zero (CC0)
    url: https://creativecommons.org/publicdomain/zero/1.0/
servers:
  - url: https://www.registeruz.sk/cruz-public
    description: Production
security: []
paths:
  /api/uctovna-jednotka:
    get:
      summary: Get accounting unit
      description: >-
        Returns the full record for a single accounting unit, including links to
        its financial statements and annual reports.


        See [Data models](/apis/ruz/data-models) for how accounting units relate
        to statements and reports.
      operationId: getAccountingUnit
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Accounting unit returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingUnit'
        '404':
          description: No accounting unit found with the given `id`.
components:
  parameters:
    id:
      name: id
      in: query
      required: true
      description: Entity identifier — obtained from an identifier list endpoint.
      schema:
        type: integer
  schemas:
    AccountingUnit:
      type: object
      description: >-
        An accounting unit (účtovná jednotka) — the root entity in RÚZ. Links to
        financial statements via `idUctovnychZavierok` and annual reports via
        `idVyrocnychSprav`.
      properties:
        id:
          type: integer
          description: Unique identifier.
        ico:
          type: string
          description: IČO — company registration number (8 characters).
        dic:
          type: string
          description: DIČ — tax identification number (10 characters).
        sid:
          type: string
          description: SID — statistical identifier (max 5 characters).
        nazovUJ:
          type: string
          description: Registered name.
        ulica:
          type: string
          description: Street address.
        mesto:
          type: string
          description: City.
        psc:
          type: string
          description: Postal code.
        datumZalozenia:
          type: string
          description: Date established (`YYYY-MM-DD`).
        datumZrusenia:
          type: string
          description: Date dissolved (`YYYY-MM-DD`). Absent if still active.
        pravnaForma:
          type: string
          description: >-
            Legal form code. Resolve with [List legal
            forms](/api-reference/list-legal-forms).
        skNace:
          type: string
          description: >-
            SK NACE economic activity code. Resolve with [List SK NACE
            codes](/api-reference/list-sk-nace-codes).
        velkostOrganizacie:
          type: string
          description: >-
            Organisation size code. Resolve with [List organisation
            sizes](/api-reference/list-organisation-sizes).
        druhVlastnictva:
          type: string
          description: >-
            Ownership type code. Resolve with [List ownership
            types](/api-reference/list-ownership-types).
        kraj:
          type: string
          description: >-
            Region code. Resolve with [List
            regions](/api-reference/list-regions).
        okres:
          type: string
          description: >-
            District code. Resolve with [List
            districts](/api-reference/list-districts).
        sidlo:
          type: string
          description: >-
            Municipality code. Resolve with [List
            municipalities](/api-reference/list-municipalities).
        konsolidovana:
          type: boolean
          description: Whether this unit has a consolidated financial statement.
        idUctovnychZavierok:
          type: array
          items:
            type: integer
          description: IDs of linked financial statements.
        idVyrocnychSprav:
          type: array
          items:
            type: integer
          description: IDs of linked annual reports.
        zdrojDat:
          type: string
          description: Data source code.
        datumPoslednejUpravy:
          type: string
          description: Date last modified (`YYYY-MM-DD`). Used for `zmenene-od` filtering.
        stav:
          type: string
          description: >-
            Present only for deleted or non-public records. `ZMAZANÉ` for
            deleted, `Neverejná` for non-public.

````