Bulk-create monthly + FY accounting periods for a range of fiscal years
accounting:writeBackfills missing monthly + fiscal-year accounting periods for the
entity across a fiscal-year range. Reuses the canonical
seedAccountingPeriodsForFY helper (the same code the monthly cron +
entity-seed call). Idempotent: re-running inserts zero rows for years
already covered.
Why this endpoint exists. The monthly cron create_monthly_accounting_periods
only creates current + next FY; entity-seed only creates the current FY.
Neither covers historical periods needed when migrating data from years
past (e.g. WSS Versa migration loads JEs for 2020..cutover_year, which
all need period_id resolved correctly via resolvePeriodForDate).
Without this, historical JEs land with period_id = NULL and
period-grouped reports under-count.
Returns per-year inserted counts so the caller can verify the desired range is fully covered.
Safety cap: range cannot span more than 30 fiscal years per call.
Added 2026-05-28 (MIGRATION-MAPPING-NATIVE wave 5a).
Authorizations
API key issued per entity via Settings > Developers > API Keys.
Each key carries scopes (e.g. orders:read, products:write).
Bearer token format: Authorization: Bearer ark_live_ent_Test keys use ark_test_ent_. Both are issued per entity
via Settings > Developers > API Keys.

