Accounting periods

Closing and reopening periods.

Paths are relative to https://evenbooks.org/api/v1. How keys, errors, paging and versions work is in the guide; the whole reference is also an OpenAPI 3.1 document.

Administrator key marks endpoints that need a key with the admin role, Write access those a read-only key can’t call, and Idempotent those that accept an idempotency key.

List accounting periods

get/periods

Every period that was closed, by start date; status is open once it has been reopened.

Response 200

array of PeriodDto

Errors 400 · 401 · 403 · 404 · 409 · 429

Close an accounting period

post/periods
Administrator keyWrite access

Administrators only. Locks the date range: nothing dated inside it can be posted, changed or reversed (409 period_locked) until the period is reopened. Drafts dated inside it stay drafts.

Request body

ClosePeriodInput

Response 200

PeriodDto (fields under Schemas)

Errors 400 · 401 · 403 · 404 · 409 · 429

Close a reopened accounting period

post/periods/{id}/close
Administrator keyWrite access

Administrators only. Locks the period’s dates again after a reopen. Needs version from the last read (409 version_conflict otherwise).

Parameters

  • idstring (uuid)path · required

Request body

PostPeriodsIdCloseBody

  • versionintegerrequired
  • reasonstring

    up to 500 characters

Response 200

PeriodDto (fields under Schemas)

Errors 400 · 401 · 403 · 404 · 409 · 429

Reopen an accounting period

post/periods/{id}/reopen
Administrator keyWrite access

Administrators only. Allows posting and changes dated inside the period again, until it is closed with POST /periods/{id}/close. The reason is kept in History. Needs version from the last read (409 version_conflict otherwise).

Parameters

  • idstring (uuid)path · required

Request body

ReopenPeriodInput

  • versionintegerrequired
  • reasonstringrequired

    1–500 characters

Response 200

PeriodDto (fields under Schemas)

Errors 400 · 401 · 403 · 404 · 409 · 429

Schemas

The types these endpoints take or return, by name. Type names above link here.

PeriodDto

  • idstring
  • startDatestring · PlainDateString
  • endDatestring · PlainDateString
  • statusstring

    One of: open closed

  • closedAtstring or null
  • closedBystring or null
  • reopenedAtstring or null
  • reopenedBystring or null
  • reasonstring or null
  • versioninteger

PlainDateString

string

pattern ^\d{4}-\d{2}-\d{2}$