---
title: "Opening Journal Render"
method: POST
path: "/companies/{company_id}/opening-entries/{proposal_id}/render"
tags: ["accounting-settings"]
---

# Opening Journal Render

`POST /companies/{company_id}/opening-entries/{proposal_id}/render`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/companies/{company_id}/opening-entries/{proposal_id}/render`
- Auth: none declared

Render the edited opening-entry document to a file + write a render-audit row.

Accountant/owner (ZCT-257). Its `preview`/`render` siblings in ``journal_export`` are
deliberately member-level because they persist nothing; this one does not qualify —
it writes an :class:`OpeningEntryRenderAudit` row carrying caller-supplied content
(``was_edited``, the rendered sha256, the actor). A route that stores what the caller
sent is a create, and under the ruling a member creates nothing.

``pid`` not owned by ``{cid}`` → 404. Reloads the target-FY chart, runs the fixed
render pipeline + validation (posting dates constrained to ``target_fiscal_year`` →
422 on a cross-FY/unbalanced/out-of-chart document), renders ``format`` → file bytes,
and writes one :class:`OpeningEntryRenderAudit` row (``company_id`` from the loaded
proposal, ``was_edited`` = whether the request diverges from the stored proposal,
``rendered_sha256`` of the bytes, ``generated_by`` = current user). The legacy
``GET .../file`` stays read-only and unaudited.

## Path parameters

- `company_id` string, required
- `proposal_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- JournalRenderRequest: The narrow inbound render contract (plan §5.1). ``format`` is a renderer id (``csv``/``generic_json``/``bexio_json``/``abacus_xml``).
  - `entries` RenderEntry[]
    - `entry_id` string, required
    - `lines` RenderLine[]
      - `line_id` string, required
      - `side` string, required
      - `account` string, required
      - `amount` string, required
      - `currency` string, required
      - `vat_code` string, nullable
      - `vat_amount` string, nullable
      - `text` string, nullable
      - `line_header_overrides` object
    - `header_field_overrides` object
    - `posting_date` string, nullable
    - `document_date` string, nullable
    - `reference` string, nullable
    - `description` string, nullable
  - `format` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zeno-works/apis/zeno-api.md) · [All operations](https://skmtc.dev/zeno-works/apis/zeno-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zeno-works/apis/zeno-api/revisions/1eb93dde146c?raw)
