Skip to main content

List Generation Candidates

GET 

/api/ledger/generation/candidates

Preview of the source documents eligible to have ledger entries generated — the entries page "Generate" modal. A document is a candidate when it passes the same readiness gate the legacy generation used (scopeAccountingReady: drafts, unmapped lines, Amazon channel orders, … are excluded) AND it has no current (non-discarded, non-reversed) ledger entry.

Authorization

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

Authentication: Requires Bearer token.

Response fields:

  • candidates — Laravel paginator of {source_type, source_id, type_label, reference, url, date} rows. url is the application UI detail route when one exists; date is the document's accounting date (Y-m-d). Without filter[source_type] the listing walks every type in tab (label) order, each type's rows newest-first.
  • tabs — one row per source type that currently has candidates ({source_type, label, count}), label-sorted — drives the modal's tab strip
  • total — candidate count across all types for the date range
  • schedule.next_generation_run_at / schedule.next_reconcile_run_at — UTC datetimes of the next per-minute drain run and the next daily reconciliation sweep (these documents are picked up automatically; a manual run just front-runs the schedule)
  • has_frozen_history — whether the tenant has any imported (migrated) ledger history. When true, imported entries are frozen: scope runs skip them unless include_frozen is passed to Run Generation Now.
  • enabled — the effective generation switch (tenant setting OR environment override); when false a run request would be rejected

Date filtering applies to each document's own accounting date column (invoice date, fulfillment date, adjustment date, …), not created_at.

Request

Responses

OK

Response Headers
    Content-Type