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.
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.urlis the application UI detail route when one exists;dateis the document's accounting date (Y-m-d). Withoutfilter[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 striptotal— candidate count across all types for the date rangeschedule.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 unlessinclude_frozenis 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
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.