accounting-settings

Create Balance Sheet

Create a balance-sheet snapshot from structured figures (accountant) — ZET-159.

The figures-in sibling of the two existing snapshot creators — the accounting-document upload (analyzer-extracted) and POST .../balance-sheets/from-gl (Zeno-closed years) — for the established tenant whose prior years closed outside Zeno and who has no closing-balance-sheet document to upload: it takes the closing balances of fiscal_year (the year being closed, i.e. the opening target year − 1) as JSON lines, sourced from the predecessor system of record, and persists them through the same consent-aware lifecycle as the document path:

  • first sheet for the fiscal year → inserted accepted (immediately usable by POST .../opening-entries for fiscal_year + 1) — if its Σdebit and Σcredit agree within 1 ct. An unbalanced first sheet is not accepted unseen: it lands proposed with a pending balances change set, exactly like a replacement below (ZCT-808);
  • a different accepted sheet already exists → the new one lands proposed plus a pending balances change set — consent via POST .../change-sets/{set_id}/apply (find the set with GET .../change-sets); the response's status field tells you which branch you got;
  • identical content (hash over number/amount/side) already accepted/proposed → idempotent: the existing snapshot is returned unchanged (still 201; equity_roles are not restamped onto it).

currency must equal the company base currency — 422 otherwise, because an accepted off-currency sheet would hold the FY's accepted slot and permanently 422 at opening-entry generation. equity_roles codes must appear among the submitted lines (422 otherwise) and are stamped only on a snapshot this call created. Deferred failures are the generator's: an (accepted) unbalanced sheet or needs_review lines are stored as sent (parity with the document path) and refused with 422 at POST .../opening-entries — clear review flags with PUT /balance-sheets/{snapshot_id}/lines.

founding=true (ZCT-843) stores a newly founded company's founding balance sheet instead: filed under the founding year itself, outside the consent lifecycle above (status founding; a new one replaces the previous one), and refused (422) unless it is the company's first year, dated inside it, balanced and fully reviewed, with no closing sheet for the year before. generate_opening_entries for that year then opens from it, on its date.

post/companies/{company_id}/balance-sheets

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}/balance-sheets
  • Auth: none declared

Path parameters

company_idstring required

Headers

authorizationstring nullable

Cookies

access_tokenstring nullable

Request body

fiscal_yearinteger required

The fiscal year this balance sheet CLOSES. Opening-entry generation for year N reads the accepted sheet of N-1, so file the sheet under N-1 — not under the year being opened. Exception: a founding balance sheet (founding=true) is filed under the year it opens.

foundingboolean

ZCT-843: a newly founded company's founding balance sheet (Gründungsbilanz) instead of a closing sheet. Filed under the founding year itself (its first fiscal year), with as_of_date = the founding date inside that year; it must balance, and no earlier fiscal year or prior-year closing sheet may exist. Stored as its own kind (status 'founding'): it never competes with that year's closing sheet and the next year's opening never reads it. generate_opening_entries for that year then uses it and posts on its date. A new founding sheet replaces the previous one.

as_of_datestring date nullable
currencystring nullable

Must equal the company base currency (422 otherwise); omitted → the base currency.

Response

Successful Response

idstring required
company_idstring required
fiscal_yearinteger required
as_of_datestring date nullable
currencystring required
status'accepted' | 'proposed' | 'superseded' | 'founding' required

Lifecycle of a balance-sheet snapshot.

accepted is the single live snapshot per (company, fiscal_year); proposed is a consent-gated replacement awaiting the user's decision; superseded is a retired snapshot (replaced by a newer accepted one, or a discarded proposal).

founding (ZCT-843) is a different KIND of sheet, not a lifecycle stage of a closing sheet: the founding balance sheet (Gründungsbilanz) a newly founded company's FIRST fiscal year opens from, filed under that year. It is deliberately a status value: every reader of "the accepted sheet of year N" — the consent lifecycle, the one-accepted-per-year index, the next year's opening, reconciliation, staleness — filters accepted/proposed, so none of them can ever take a founding sheet for a closing one. At most one is live per company; a replacement marks it superseded.

sourcestring required
source_document_idstring nullable
totalsobject
snapshot_hashstring required
created_atstring date-time required
superseded_atstring date-time nullable
resolution_jsonobject nullable
equity_rolesobject nullable

Changes

No recorded changes to this operation across all 1 revision of this API.