Update Generation Switch
PUT/api/ledger/settings/generation
Flip the per-tenant generation kill switch (AccountingSettings::$ledger_generation_enabled) and return the refreshed status.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Authentication: Requires Bearer token + accounting.manage_settings permission (403 without it).
Request body:
enabled(boolean, required) — whether this tenant generates accounting entries
Note: the LEDGER_GENERATION_ENABLED environment override is not writable from the API — disabling the tenant switch while the override is on leaves generation effectively running, which the response surfaces via environment_override.
schedule.next_generation_run_at— UTC datetime of the next per-minute outbox drain runschedule.next_reconcile_run_at— UTC datetime of the next daily reconciliation sweeppurchase_order_accounting_policy(string, optional) — what a purchase order puts into the books. One ofon_invoice(nothing posts until the supplier invoice is recorded — the default),commitment_entry(a non-posting commitment entry per order), orcommitted_spend_bill(a committed-spend bill when the order is submitted, which reduces as real supplier invoices arrive). Omit to leave unchanged. Replaces the former booleangenerate_purchase_order_transactions.
The response also reports the live committed-spend bills (committed_spend_bill_count, committed_spend_bill_total, tenant_currency_code) so a client can state exactly what switching away from that policy would remove.
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.