---
title: "Opening Entries"
method: POST
path: "/onboarding/opening-entries"
tags: ["onboarding"]
---

# Opening Entries

`POST /onboarding/opening-entries`

## 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/onboarding/opening-entries`
- Auth: none declared

Generate year-opening entries from the in-progress balances (eligible).

For the browser wizard: the create accepts its result over a session only. An API-key
caller cannot send it to ``onboarding_create_company`` (422) — it creates without and
calls ``generate_opening_entries`` afterwards, so calling this spends LLM budget for
nothing.

Stateless. **422** when the sheet cannot be safely sent (unreviewed lines, currency
mismatch, unbalanced); **503** when the accountant is unreachable/failed. Rate-limited
per user (LLM call).

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- OpeningEntriesRequest: Inputs for stateless opening-entry generation (no company needed). The chart + accepted snapshot must already be standardized/resolved client-side (no ``needs_review`` lines), mirroring :func:`build_year_opening_request`'s refusals.
  - `company` CompanyCreate, required: ``POST /companies/`` body (admin).
    - `company_name` string, required
    - `active` boolean
    - `ingest_lookback_months` 3 | 6 | 12, nullable
    - `language` 'de' | 'en' | 'fr' | 'it', nullable
    - `industry` string, nullable
  - `settings` OnboardingSettingsIn: The accounting settings the wizard collects (defaults applied in the service).
    - `fiscal_year_start_month` integer
    - `base_currency` string
    - `opening_balance_account_number` string
    - `ar_revenue_default_account_code` string, nullable
    - `vat_liable` boolean, nullable
    - `settlement_method` 'effective' | 'net_tax_rate' | 'flat_tax_rate' | 'unknown'
    - `timing_basis` 'agreed' | 'collected' | 'unknown'
    - `filing_period_type` 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'unknown'
    - `uid` string, nullable
    - `canton` string, nullable
    - `vat_period_start` string, date, nullable
    - `vat_period_end` string, date, nullable
    - `ar_default_due_days` integer, nullable
  - `chart_accounts` OnboardingChartAccountIn[]
    - `account_number` string, required
    - `account_name` string, nullable
    - `category` 'asset' | 'liability' | 'equity' | 'income' | 'expense' | 'tax' | 'other' | 'unknown': The account-type axis of a ledger account (Swiss-KMU chart of accounts). Distinct from — but derived from — ``LineRole`` (the journal-line semantic role). ``unknown`` is the conservative default when classification can't decide; ``other`` covers genuinely ambiguous / closing (9xxx) accounts.
    - `is_profit_loss` boolean
    - `is_contra` boolean
    - `is_intentional` boolean
    - `account_number_guess` string, nullable
    - `journal_usage_count` integer
    - `prior_year_turnover_cents` integer, nullable
    - `prior_year_turnover_fiscal_year` integer, nullable
  - `vat_rates` OnboardingVatRateIn[]
    - `code` string, nullable
    - `rate_bps` integer, required
    - `name` string, nullable
    - `kind` string, nullable
    - `revenue_account_code` string, nullable
    - `valid_from` string, date, nullable
    - `valid_to` string, date, nullable
    - `active` boolean
  - `snapshot` OnboardingBalanceSnapshotIn, required: A balance-sheet snapshot (analyze output and create input). On analyze output ``resolution_json`` / ``equity_roles`` / ``source_document_ref`` are unset; the wizard fills them after the resolve-balance step and resends them.
    - `fiscal_year` integer, required
    - `as_of_date` string, date, nullable
    - `currency` string, required
    - `lines` OnboardingBalanceLineIn[]
      - `line_id` string, nullable
      - `account_number` string, required
      - `account_name` string, nullable
      - `category` 'asset' | 'liability' | 'equity' | 'income' | 'expense' | 'tax' | 'other' | 'unknown': The account-type axis of a ledger account (Swiss-KMU chart of accounts). Distinct from — but derived from — ``LineRole`` (the journal-line semantic role). ``unknown`` is the conservative default when classification can't decide; ``other`` covers genuinely ambiguous / closing (9xxx) accounts.
      - `side` 'credit' | 'debit', required
      - `amount_cents` integer, required
      - `sign_display` string, nullable
      - `needs_review` boolean
      - `is_contra` boolean
      - `comparative_amount_cents` integer, nullable
    - `totals` object
    - `resolution_json` object, nullable
    - `equity_roles` object, nullable
    - `source_document_ref` string, nullable
    - `comparative_period_label` string, nullable
    - `founding` boolean, nullable: ZET-395: the answer to 'founding balance sheet (Gründungsbilanz) or closing sheet?'. true = the company's founding balance sheet: stored as its own kind (status 'founding') under its fiscal_year, which must be the create's first year, and that year's opening is generated from it on its as_of_date. false = the year's closing sheet (the historical behaviour). Asked for when as_of_date lies inside the company's first fiscal year before its end: left unset, the sheet is held for the question under Settings -> Opening (a pending change set with summary.founding_question) instead of becoming the year's closing sheet, and opening entries are refused (422). Not needed for a sheet dated on the year-end. Unset on analyze output.
  - `fiscal_year_summary` OnboardingFiscalYearSummaryIn: A P&L summary (analyze output and create input).
    - `fiscal_year` integer, required
    - `net_result_cents` integer, nullable
    - `period_start` string, date, nullable
    - `period_end` string, date, nullable
  - `target_fiscal_year` integer, required
  - `opening_posting_date` string, date, nullable

## Response `200`

Successful Response

- InvoiageCoreSchemasOnboardingOpeningEntriesResponse: The accountant year-opening proposal + the request echo (for the create payload).
  - `status` string, required
  - `journal_entries` object[]
  - `request_json` object, required
  - `request_hash` string, required
  - `response` object, required
  - `accountant_metadata` object, nullable

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