REST API

Accounting API

Manage the chart of accounts and journal entries.

Generated from the Celerp 2.4.0 OpenAPI schema, 16 September 2026.

POST /accounting/accounts

Create Account

Request body

FieldTypeRequiredDescription
codestringyesCode
namestringyesName
account_typestringyesAccount Type
parent_codestring, optional--Parent Code
cash_flow_categorystring, optional--Cash Flow Category

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/accounts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

PATCH /accounting/accounts/{code}

Patch Account

Parameters

NameInRequiredTypeDescription
codepathyesstring--

Request body

FieldTypeRequiredDescription
namestring, optional--Name
account_typestring, optional--Account Type
parent_codestring, optional--Parent Code
is_activeboolean, optional--Is Active
cash_flow_categorystring, optional--Cash Flow Category

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/accounting/accounts/:code \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/balance-sheet

Balance Sheet

Balance sheet as of a given date (default: all posted entries to date).

Parameters

NameInRequiredTypeDescription
as_ofquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/balance-sheet \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/bank-accounts

List the company's bank and card accounts

Parameters

NameInRequiredTypeDescription
include_inactivequery--boolean--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/bank-accounts \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/bank-accounts

Create Bank Account

Request body

FieldTypeRequiredDescription
bank_namestringyesBank Name
account_numberstringyesAccount Number
bank_typestringyesBank Type
currencystringyesCurrency
opening_balancenumber--Opening Balance
account_codestring, optional--Account Code

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/bank-accounts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/bank-accounts/{bank_id}

Get Bank Account

Parameters

NameInRequiredTypeDescription
bank_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/bank-accounts/:bank_id \
  -H "Authorization: Bearer $TOKEN"

PATCH /accounting/bank-accounts/{bank_id}

Patch Bank Account

Parameters

NameInRequiredTypeDescription
bank_idpathyesstring--

Request body

FieldTypeRequiredDescription
bank_namestring, optional--Bank Name
account_numberstring, optional--Account Number
bank_typestring, optional--Bank Type
currencystring, optional--Currency
is_activeboolean, optional--Is Active

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/accounting/bank-accounts/:bank_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/cash-flow

Cash Flow

Cash flow statement, direct and indirect, over the same posted entries. Direct reads every entry that moved cash and sorts the movement by what it moved against. Indirect starts from the period's profit and adjusts for the movement in every other non-cash account. The two agree by construction rather than by tolerance: a balanced entry set means the change in cash is exactly the negative of the change in everything else, which is what the indirect side computes. There is no exchange-rate reconciling item because every posting is stored in base currency at its own date, so a cash balance is never restated after the fact. Cash comes from the ledger. A bank account holding an opening balance that no journal entry carries is listed in `unbacked_bank_openings`, so the gap between that account and the books is reported rather than closed behind the reader's back with a figure the ledger does not support.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/cash-flow \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/chart

Get Chart

Return all accounts sorted by code.

Responses

StatusDescriptionBody
200Successful Responseobject

Example

curl -X GET http://localhost:8000/accounting/chart \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/chart/seed

Seed Chart Endpoint

Seed the default chart of accounts for this company. Only adds missing accounts.

Responses

StatusDescriptionBody
200Successful Responseobject

Example

curl -X POST http://localhost:8000/accounting/chart/seed \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/close-year

Close Fiscal Year

Close a fiscal year: zero revenue + expense accounts, transfer net income to Retained Earnings.

Request body

FieldTypeRequiredDescription
fiscal_year_endstringyesFiscal Year End

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/close-year \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/extended-journal

Extended Journal

The journal with the item behind each posting named, where it can be. The same entries, the same lines and the same totals as the classical journal: nothing is posted, stored or recomputed here. A sale posted as one revenue line becomes a row per item sold, a purchase already posted line by line gains the item on each, and an entry whose figures do not tie to its document is shown as it stands. Every entry carries an `items_status` of `expanded`, `no_items`, `no_document` or `untied` (see `_expand_item_lines`), so a reader can tell "no item here" from "the item detail was not trustworthy" from "the document is gone". The search is the classical journal's, applied to the same entries before any item detail is derived, so a search can never give the two books different entry sets.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--
qquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/extended-journal \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/general-ledger

General Ledger

General ledger summary: opening balance, period debits/credits, and closing balance per account. Balances are signed by the account's normal side, matching the per-account ledger's running balance. Detail rows live at /ledger/{code}. contact_id narrows every account to one party, the same filter and the same party resolution the account ledger drills down with, so the report and the drilldown always show the same figure. Lines with no resolvable party are reported under the empty string, so the per-party views plus that one add back up to the unfiltered report.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--
include_linesquery--boolean--
contact_idquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/general-ledger \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/import/batch

Batch Import Accounting

Request body

FieldTypeRequiredDescription
recordsarray of AccImportRecordyesRecords

Responses

StatusDescriptionBody
200Successful Responsecelerp_accounting__routes__BatchImportResult
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/import/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/journal

Journal

Journal: every entry with its lines, source-doc link, and FX info. Voided entries stay visible flagged status="void" - a journal is a record, and hiding voids would misstate it - but they are excluded from the period totals. `q` is the one search box: comma-separated terms that OR together, each tried against an account code, free text, or a figure. A narrowed answer says so in `filtered` and its totals are the totals of what it returned.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--
qquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/journal \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/journal-entries

Create Manual Journal Entry

Post a manual journal entry. Validates accounts and balance; the period lock is enforced by the event engine on the entry's date.

Request body

FieldTypeRequiredDescription
tsstringyesTs
memostring--Memo
entriesarray of ManualJELineyesEntries
idempotency_tokenstringyesIdempotency Token

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/journal-entries \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/journal-entries/bulk-void

Bulk Void Journal Entries

Void several manual journal entries, reporting each one's outcome. Every entry is voided by the same code the single-entry route uses, one at a time, and each one commits on its own. A refusal is recorded against the entry it belongs to and the rest of the selection carries on: refusing four valid voids because the fifth sits in a locked period would leave the reader to re-tick the four and try again, having been told nothing about which was which.

Request body

FieldTypeRequiredDescription
je_idsarray of stringyesJe Ids
reasonstring, optional--Reason

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/journal-entries/bulk-void \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/journal-entries/{entity_id}/void

Void Manual Journal Entry

Void a manual journal entry. The voided entry stays on the record - accounting requires the full trail, so entries are never deleted.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

ManualJEVoidPayload, optional

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/journal-entries/:entity_id/void \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/ledger/{account_code}

Account Ledger

Account ledger: posted JE lines for one account, with opening balance, running balance, closing balance and source doc links. contact_id narrows the account to one party, which is what turns a control account into that party's subledger: 1120 filtered to a customer is that customer's receivable, and every such line sums back to the control account. Lines with no resolvable party are reported under the empty string so a filtered view can never quietly exclude them from the account's total.

Parameters

NameInRequiredTypeDescription
account_codepathyesstring--
date_fromquery--string, optional--
date_toquery--string, optional--
contact_idquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/ledger/:account_code \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/period-lock

Get Period Lock

Responses

StatusDescriptionBody
200Successful Responseobject

Example

curl -X GET http://localhost:8000/accounting/period-lock \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/period-lock

Set Period Lock

Request body

FieldTypeRequiredDescription
lock_datestring, optionalyesLock Date

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/period-lock \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/pnl

Profit And Loss

Profit and Loss statement for the period. Revenue accounts (4xxx) = credit-normal -> positive net credit = revenue. COGS accounts (5xxx) = debit-normal -> positive net debit = cost. Expense accounts (6xxx) = debit-normal -> positive net debit = expense.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/pnl \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/start

Start reconciling a bank or card statement

Request body

FieldTypeRequiredDescription
bank_account_idstringyesBank Account Id
statement_datestringyesStatement Date
statement_balancenumberyesStatement Balance

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/start \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/reconciliation/{session_id}

Get Reconciliation

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/reconciliation/:session_id \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/auto-match

Match statement lines to book entries automatically

Run the auto-matching algorithm against all unmatched statement lines.

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/auto-match \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/bulk-confirm

Confirm every suggested match

Confirm all 'suggested' matches (make them fully matched).

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Request body

BulkConfirmPayload, optional

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/bulk-confirm \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/reconciliation/{session_id}/complete

Complete the reconciliation once the difference is zero

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/complete \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/import-csv

Import Recon Csv

Upload and parse a bank statement CSV, store lines.

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/import-csv \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/import-file

Import an uploaded statement file (csv or xlsx) into the reconciliation

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Request body

FieldTypeRequiredDescription
file_idstringyesFile Id
column_mapobject, optional--Column Map

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/import-file \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

PATCH /accounting/reconciliation/{session_id}/lines/{line_id}

Set a statement line's status, for example skip a line that needs no entry

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Request body

FieldTypeRequiredDescription
statusstring, optional--Status

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/reconciliation/{session_id}/lines/{line_id}/attach

Attach To Line

Attach a document to a statement line (stores file, returns attachment id).

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/attach \
  -H "Authorization: Bearer $TOKEN"

DELETE /accounting/reconciliation/{session_id}/lines/{line_id}/attach/{att_id}

Remove Line Attachment

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--
att_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/attach/:att_id \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/lines/{line_id}/create

Post a journal entry for a statement line with no book entry

Create a journal entry from a bank statement line and auto-match it.

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Request body

FieldTypeRequiredDescription
account_codestringyesAccount Code
memostring--Memo
amountnumber, optional--Amount
datestring, optional--Date
contactstring, optional--Contact

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/reconciliation/{session_id}/lines/{line_id}/match

Match a statement line to a book entry

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Request body

FieldTypeRequiredDescription
je_idstringyesJe Id
confidencestring--Confidence

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/match \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/reconciliation/{session_id}/lines/{line_id}/split

Split Stmt Line

Split a bank line into multiple JE lines across different accounts.

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Request body

FieldTypeRequiredDescription
splitsarray of objectyesSplits

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/split \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /accounting/reconciliation/{session_id}/lines/{line_id}/unmatch

Undo the match on a statement line

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--
line_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/lines/:line_id/unmatch \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/match

Match Reconciliation

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Request body

FieldTypeRequiredDescription
je_idsarray of stringyesJe Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/match \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/reconciliation/{session_id}/statement-lines

Get Statement Lines

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/reconciliation/:session_id/statement-lines \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/reconciliation/{session_id}/workbench

Statement lines still to resolve, unreconciled book entries, and the remaining difference

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/reconciliation/:session_id/workbench \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/reconciliation/{session_id}/write-off

Write off a remaining difference within tolerance

Create a small adjustment JE to zero out the remaining difference.

Parameters

NameInRequiredTypeDescription
session_idpathyesstring--

Request body

FieldTypeRequiredDescription
account_codestring--Account Code
memostring--Memo

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/reconciliation/:session_id/write-off \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/rules

Get Recon Rules

Parameters

NameInRequiredTypeDescription
bank_account_idquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/rules \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/rules

Create Recon Rule

Request body

FieldTypeRequiredDescription
bank_account_idstringyesBank Account Id
match_fieldstring--Match Field
match_patternstringyesMatch Pattern
match_typestring--Match Type
target_account_codestringyesTarget Account Code
default_memostring, optional--Default Memo
default_taxstring, optional--Default Tax

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/rules \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

PATCH /accounting/rules/{rule_id}

Patch Recon Rule

Parameters

NameInRequiredTypeDescription
rule_idpathyesstring--

Request body

FieldTypeRequiredDescription
match_fieldstring, optional--Match Field
match_patternstring, optional--Match Pattern
match_typestring, optional--Match Type
target_account_codestring, optional--Target Account Code
default_memostring, optional--Default Memo
default_taxstring, optional--Default Tax
is_activeboolean, optional--Is Active

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/accounting/rules/:rule_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

DELETE /accounting/rules/{rule_id}

Delete Recon Rule

Parameters

NameInRequiredTypeDescription
rule_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X DELETE http://localhost:8000/accounting/rules/:rule_id \
  -H "Authorization: Bearer $TOKEN"

GET /accounting/soa/{contact_id}

Statement Of Account

Statement of account for one contact: opening balance, dated rows with a running balance, closing balance. The statement is the receivable and payable control accounts filtered to one party, so every customer's statement plus the unattributed bucket sums back to the control account and the balance sheet, by construction rather than by coincidence. Reading the ledger is also what puts a manual adjustment, write-off or opening conversion on the party's statement: anything posted to a control account for them shows up, whether a document caused it or a person typed it. Amounts are the posted figures, which are stored in base currency at each entry's own date, so a mixed-currency party reads on one statement with no rate applied here. Only posted entries count; drafts and voids never post. The sign convention is the party's net position, debits positive: what a customer owes reads positive, what the company owes a supplier reads negative, and a party that is both nets to one figure.

Parameters

NameInRequiredTypeDescription
contact_idpathyesstring--
date_fromquery--string, optional--
date_toquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/soa/:contact_id \
  -H "Authorization: Bearer $TOKEN"

POST /accounting/transfers

Create Transfer

Request body

FieldTypeRequiredDescription
from_bank_idstringyesFrom Bank Id
to_bank_idstringyesTo Bank Id
amountnumberyesAmount
datestringyesDate
descriptionstring--Description
referencestring--Reference

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/accounting/transfers \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /accounting/trial-balance

Trial Balance

Trial balance: one row per account with debit/credit totals. Reads posted journal_entry projections. Each journal entry stores entries: [{account, debit?, credit?}] in its state.

Parameters

NameInRequiredTypeDescription
date_fromquery--string, optional--
date_toquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/accounting/trial-balance \
  -H "Authorization: Bearer $TOKEN"