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
| Field | Type | Required | Description |
|---|
code | string | yes | Code |
name | string | yes | Name |
account_type | string | yes | Account Type |
parent_code | string, optional | -- | Parent Code |
cash_flow_category | string, optional | -- | Cash Flow Category |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
code | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
name | string, optional | -- | Name |
account_type | string, optional | -- | Account Type |
parent_code | string, optional | -- | Parent Code |
is_active | boolean, optional | -- | Is Active |
cash_flow_category | string, optional | -- | Cash Flow Category |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
as_of | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
include_inactive | query | -- | boolean | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/accounting/bank-accounts \
-H "Authorization: Bearer $TOKEN"
POST /accounting/bank-accounts
Create Bank Account
Request body
| Field | Type | Required | Description |
|---|
bank_name | string | yes | Bank Name |
account_number | string | yes | Account Number |
bank_type | string | yes | Bank Type |
currency | string | yes | Currency |
opening_balance | number | -- | Opening Balance |
account_code | string, optional | -- | Account Code |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
bank_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
bank_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
bank_name | string, optional | -- | Bank Name |
account_number | string, optional | -- | Account Number |
bank_type | string, optional | -- | Bank Type |
currency | string, optional | -- | Currency |
is_active | boolean, optional | -- | Is Active |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Status | Description | Body |
|---|
200 | Successful Response | object |
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
| Status | Description | Body |
|---|
200 | Successful Response | object |
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
| Field | Type | Required | Description |
|---|
fiscal_year_end | string | yes | Fiscal Year End |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
q | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
include_lines | query | -- | boolean | -- |
contact_id | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/accounting/general-ledger \
-H "Authorization: Bearer $TOKEN"
POST /accounting/import/batch
Batch Import Accounting
Request body
| Field | Type | Required | Description |
|---|
records | array of AccImportRecord | yes | Records |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | celerp_accounting__routes__BatchImportResult |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
q | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Field | Type | Required | Description |
|---|
ts | string | yes | Ts |
memo | string | -- | Memo |
entries | array of ManualJELine | yes | Entries |
idempotency_token | string | yes | Idempotency Token |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Field | Type | Required | Description |
|---|
je_ids | array of string | yes | Je Ids |
reason | string, optional | -- | Reason |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
entity_id | path | yes | string | -- |
Request body
ManualJEVoidPayload, optional
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
account_code | path | yes | string | -- |
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
contact_id | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/accounting/ledger/:account_code \
-H "Authorization: Bearer $TOKEN"
GET /accounting/period-lock
Get Period Lock
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
Example
curl -X GET http://localhost:8000/accounting/period-lock \
-H "Authorization: Bearer $TOKEN"
POST /accounting/period-lock
Set Period Lock
Request body
| Field | Type | Required | Description |
|---|
lock_date | string, optional | yes | Lock Date |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Field | Type | Required | Description |
|---|
bank_account_id | string | yes | Bank Account Id |
statement_date | string | yes | Statement Date |
statement_balance | number | yes | Statement Balance |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Request body
BulkConfirmPayload, optional
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
file_id | string | yes | File Id |
column_map | object, optional | -- | Column Map |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
status | string, optional | -- | Status |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
att_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
account_code | string | yes | Account Code |
memo | string | -- | Memo |
amount | number, optional | -- | Amount |
date | string, optional | -- | Date |
contact | string, optional | -- | Contact |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
je_id | string | yes | Je Id |
confidence | string | -- | Confidence |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
splits | array of object | yes | Splits |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
line_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
je_ids | array of string | yes | Je Ids |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
session_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
account_code | string | -- | Account Code |
memo | string | -- | Memo |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
bank_account_id | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/accounting/rules \
-H "Authorization: Bearer $TOKEN"
POST /accounting/rules
Create Recon Rule
Request body
| Field | Type | Required | Description |
|---|
bank_account_id | string | yes | Bank Account Id |
match_field | string | -- | Match Field |
match_pattern | string | yes | Match Pattern |
match_type | string | -- | Match Type |
target_account_code | string | yes | Target Account Code |
default_memo | string, optional | -- | Default Memo |
default_tax | string, optional | -- | Default Tax |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
rule_id | path | yes | string | -- |
Request body
| Field | Type | Required | Description |
|---|
match_field | string, optional | -- | Match Field |
match_pattern | string, optional | -- | Match Pattern |
match_type | string, optional | -- | Match Type |
target_account_code | string, optional | -- | Target Account Code |
default_memo | string, optional | -- | Default Memo |
default_tax | string, optional | -- | Default Tax |
is_active | boolean, optional | -- | Is Active |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
rule_id | path | yes | string | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X DELETE http://localhost:8000/accounting/rules/:rule_id \
-H "Authorization: Bearer $TOKEN"
POST /accounting/transfers
Create Transfer
Request body
| Field | Type | Required | Description |
|---|
from_bank_id | string | yes | From Bank Id |
to_bank_id | string | yes | To Bank Id |
amount | number | yes | Amount |
date | string | yes | Date |
description | string | -- | Description |
reference | string | -- | Reference |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
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
| Name | In | Required | Type | Description |
|---|
date_from | query | -- | string, optional | -- |
date_to | query | -- | string, optional | -- |
Responses
| Status | Description | Body |
|---|
200 | Successful Response | object |
422 | Validation Error | HTTPValidationError |
Example
curl -X GET http://localhost:8000/accounting/trial-balance \
-H "Authorization: Bearer $TOKEN"