ServicesAccounting Service
API
HTTP endpoints and error contracts for the accounting service.
Ops
| Path | Method | Notes |
|---|---|---|
/healthz | GET | Liveness |
/readyz | GET | Readiness (Postgres ping) |
Versioned API
| Path | Method | Notes |
|---|---|---|
/v1/accounts | POST | Create account; requires Idempotency-Key |
Raw JSON Success responses return the account body directly — not the template envelope.
Unguarded Requires Authorization: Bearer <jwt> once JWT middleware ships.
Until then, local dev may use X-Dev-Actor as a temporary stand-in (not authentication).
See docs/decisions/0013-jwt-validated-in-each-service.md.
Request body
| Field | Required | Notes |
|---|---|---|
chart_code | Yes | Which chart (e.g. us) |
code | Yes | Account code unique within chart |
name | Yes | Display name |
classification | Yes | asset, liability, equity, revenue, expense |
is_postable | Yes | Whether journal lines may reference this account |
parent_code | No | Parent account code in same chart |
why | No | Audit context propagated to the event |
Errors
Failures use RFC 9457 problem JSON (application/problem+json), unlike template's enveloped errors.
Planned
List and get endpoints (GET /v1/accounts, GET /v1/accounts/{id}) are designed in domain docs but
not implemented yet.
OpenAPI: services/accounting/openapi.yaml.