Evenbead docs

Ledger

16 operations. All areas

POST/v1/accounts

Add an account to the chart of accounts

  • Operation createAccount
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • code string, required
  • name string, required
  • type "asset" | "liability" | "equity" | "income" | "expense", required
  • subtype string
  • parent_code string
  • control "ar" | "ap" Make it an AR (asset) or AP (liability) control account; fixed at creation
Responses
  • 201 Created (object)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

GET/v1/accounts

List the chart of accounts, with the default income and expense accounts for new documents

  • Operation listAccounts
  • Scope: read
  • Read
Parameters
  • include_inactive query, boolean
  • include_balances query, boolean
  • as_of query, string
Responses
  • 200 Accounts (object)
  • Errors 400, 401, 403, 429, 500 (Error: error.type, message)

POST/v1/accounts/{code}/update

Rename an account, or deactivate or reactivate it. Codes, types and the AR/AP designation never change; accounts are never deleted. Deactivation is refused (account_protected) for an AR/AP control account, a bank account's ledger account, an active sales-tax rate's payable account, an active item's account, a default account and a parent with active sub-accounts. Audited; dry_run previews.

  • Operation updateAccount
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Parameters
  • code path, string, required
Request body
  • name string
  • active boolean
  • reason string
  • dry_run boolean
Responses
  • 200 Updated (or, with dry_run, what it would be) (object)
  • Errors 400, 401, 403, 404, 409, 422, 429, 500 (Error: error.type, message)

POST/v1/accounts/defaults

Set the default income account (invoices, credit memos, sales receipts, estimates) and expense account (bills, vendor credits) new document lines start on; null clears one. Audited.

  • Operation setDefaultAccounts
  • Scope: admin
  • Write: sets a value, no Idempotency-Key needed
Request body
  • income string | null
  • expense string | null
Responses
  • 200 The defaults (object)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

GET/v1/starter-charts

Starter charts of accounts a company can begin with (each account, and the default income and expense accounts)

  • Operation listStarterCharts
  • Scope: read
  • Read
Responses
  • 200 Templates (object)
  • Errors 400, 401, 403, 429, 500 (Error: error.type, message)

POST/v1/accounts/starter-chart

Apply a starter chart to a company whose chart of accounts is still empty (otherwise chart_not_empty). Every account is audited, then the template; the defaults are set. dry_run previews.

  • Operation applyStarterChart
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • template "general" | "services" | "retail" | "empty", required Starter chart of accounts: general small business (default), services/agency, retail/product, or empty (migrations bring their own chart).
  • dry_run boolean
Responses
  • 200 Dry run: what would be created (object)
  • 201 Applied (object)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

POST/v1/periods

Create an accounting period

  • Operation createPeriod
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • start_date string, required Calendar date, YYYY-MM-DD.
  • end_date string, required Calendar date, YYYY-MM-DD.
Responses
  • 201 Created (object)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

GET/v1/periods

List periods and their lock status

  • Operation listPeriods
  • Scope: read
  • Read
Responses
  • 200 Periods (object)
  • Errors 400, 401, 403, 429, 500 (Error: error.type, message)

POST/v1/periods/{id}/status

Lock or unlock a period (reopening a hard lock needs a human and a reason)

  • Operation setPeriodStatus
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Parameters
  • id path, string, required
Request body
  • status "open" | "soft_locked" | "hard_locked", required
  • reason string
Responses
  • 200 Updated (object)
  • Errors 400, 401, 403, 404, 409, 422, 429, 500 (Error: error.type, message)

GET/v1/journal-entries/{id}

One posted journal entry. Posted entries are immutable: there is no update or delete; reverse instead.

  • Operation getJournalEntry
  • Scope: read
  • Read
Parameters
  • id path, string, required
Responses
  • 200 Entry (object)
  • Errors 400, 401, 403, 404, 429, 500 (Error: error.type, message)

POST/v1/journal-entries/propose

Propose a journal entry. Agents: auto-posts within policy, otherwise queues for approval. dry_run=true previews without writing.

  • Operation proposeJournalEntry
  • Scope: propose
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • entry_date string, required Calendar date, YYYY-MM-DD.
  • memo string
  • lines array of DraftLine, required
  • dry_run boolean
  • confidence number
  • soft_lock_override_reason string
Responses
  • 200 Dry run: the exact entry, policy verdict and affected balances; nothing written (ProposeResult)
  • 201 Posted (ProposeResult)
  • 202 Queued for approval (ProposeResult)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

POST/v1/journal-entries/{id}/reverse

Correct a posted entry by posting its exact reversal

  • Operation reverseJournalEntry
  • Scope: approve
  • Write: needs Idempotency-Key (or dry_run)
Parameters
  • id path, string, required
Request body
  • entry_date string Calendar date, YYYY-MM-DD.
  • memo string
  • soft_lock_override_reason string
Responses
  • 201 Reversal posted (object)
  • Errors 400, 401, 403, 404, 409, 422, 429, 500 (Error: error.type, message)

POST/v1/classes

Create a class (reporting dimension for journal lines)

  • Operation createClass
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • name string, required Class name (reporting dimension).
Responses
  • 201 Created (object)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

GET/v1/classes

List classes

  • Operation listClasses
  • Scope: read
  • Read
Responses
  • 200 Classes (object)
  • Errors 400, 401, 403, 429, 500 (Error: error.type, message)

POST/v1/fiscal-years/periods

Create the monthly periods of a fiscal year that do not exist yet (named by the year it ends)

  • Operation createFiscalYearPeriods
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • fiscal_year integer, required
Responses
  • 201 Periods (FiscalYearPeriods)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)

POST/v1/fiscal-years/status

Lock (or reopen) every period of a fiscal year; each change is audited (reopening a hard lock needs a person and a reason)

  • Operation setFiscalYearStatus
  • Scope: admin
  • Write: needs Idempotency-Key (or dry_run)
Request body
  • fiscal_year integer, required
  • status "open" | "soft_locked" | "hard_locked", required
  • reason string
Responses
  • 200 Periods (FiscalYearPeriods)
  • Errors 400, 401, 403, 409, 422, 429, 500 (Error: error.type, message)