accounting-settings

Unpost Opening Entries

Unpost (delete) the seeded opening batch for a fiscal year (accountant).

Removes both planes in one transaction: the synthetic opening-seed AccountingImport for (company_id, fiscal_year) (CASCADE drops its JournalEntry / JournalLine rows only, and the freed posting accounts' usage counts are recomputed), and the year's posted opening entries in the posting GL (gl_actions_service.unpost_opening_batch).

Both legs, atomically, is the fix for ZET-220: gl_journal_entry carries no FK to accounting_import, so removing the import alone left the GL rows posted — still counted by every statement, and unreachable, because the next unpost 404s on the handle that is already gone. That also makes this endpoint the in-band repair for a year the old code already orphaned: it now answers 404 only when neither plane had anything to remove.

409 if the GL batch cannot be retired (closed period, locked entry, a reversal naming it, a sealed VAT period) — nothing is removed from either plane in that case. Company scope enforced on the path company_id (contract §8).

delete/companies/{company_id}/fiscal-years/{fiscal_year}/opening

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}/fiscal-years/{fiscal_year}/opening
  • Auth: none declared

Path parameters

company_idstring required
fiscal_yearinteger required

Headers

authorizationstring nullable

Cookies

access_tokenstring nullable

Response

Successful Response

msgstring required

Changes

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