Bulk close-and-lock accounting periods

POST /api/v1/accounting-periods/bulk-lock

Close and lock multiple accounting periods in one call. Designed for historical-data migration: any open period in the list is closed first, then transitioned to locked. Already-locked periods are skipped.

Operation ID: bulk_lock_periods_api_v1_accounting_periods_bulk_lock_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

period_ids array · string required

Period UUIDs to lock

lock_reason string

Reason recorded on each period. Defaults to 'Historical migration - bulk locked' when omitted.

Responses

201 Successful Response

locked_count integer required

Periods that ended up locked

skipped_count integer required

Periods skipped (already locked / not found)

locked_ids array · string
skipped array · object

Per-period skip info: {period_id, reason}

400 Bad Request - Invalid input

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object