Skip to main content

List Batches

GET 

/api/ledger/batches

Paginated ledger batches listing: the grouping key (type, period, channel, currency), lifecycle status with the derived is_dirty flag, members_count and the aggregate journal entry summary.

Authorization

Any valid API token can call this endpoint — no specific scope required. Manage tokens.

Authentication: Requires Bearer token.

Filters (Spatie QueryBuilder):

  • filter[type] — exact entry type
  • filter[period_type] — daily | monthly
  • filter[status] — open | dirty | closing | posted | reopened
  • filter[currency_code] — exact currency
  • filter[channel] — exact integration_instance_id
  • filter[date_from] / filter[date_to] — m/d/Y on period_start (invalid dates silently ignored)
  • filter[dirty] — boolean; true = status dirty or reopened (the needs-rebuild indicator), false = everything else

Sorts: id, period_start, type, members_count, created_at (default: -period_start).

Pagination: per_page default 10, clamped to max 100.

entry is the batch's current aggregate journal entry summary (null when not yet built). channel is null for batches not scoped to a channel.

Advanced filters (filter_groups): base64-encoded JSON tree of AND/OR groups via GroupedFilterSupport (same stack as the entries index). Filterable columns: batch_type, batch_status, batch_period_type, currency (text operators); id, members_count (numeric operators); period_start, period_end (date operators); created_at (datetime operators). Unregistered columns are rejected with HTTP 400.

Search: filter[search] matches the batch type and the aggregate journal entry's reference. Sorts: id, period_start, type, members_count, currency_code, status, created_at, channel (channel name via subquery) — prefix with - for DESC; default -period_start.

Provider sync (entry object): each batch's entry includes provider_status — the accounting provider's own status for the synced document (e.g. AUTHORISED, POSTED, PAID; null when never synced) — and provider_link, the linked provider document (provider, label, link_route, remote_url; null when never synced).

Request

Responses

OK

Response Headers
    Content-Type