Skip to content

Update accounting period settings

PATCH/api/v1/accounting-periods/settings

Turn automatic period creation on or off. When on, the daily job opens the period of the month that just ended and of the current month if they are missing. auto_close_prep_enabled / auto_close_prep_day opt the business in to automatic close preparation: the daily job dry-runs Regent's close checks and files the close as a pending change; nothing closes without approval. agent_close_business_day (1-23, -1 = last; null or 0 = off) is the business day the Agent window starts the close of the month that just ended.

Operation ID: update_accounting_period_settings·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

auto_create_periodsbooleanrequired

When true, a nightly job opens the period for the month that just ended and the current month (UTC), with its checklist and blockers initialised, and emits accounting_period.created.

auto_close_prep_enabledboolean

When true, a daily job prepares the month-end close on auto_close_prep_day: it dry-runs Regent's close checks for the month that just ended, files the close as a pending change for a person to approve, and notifies the owner/admins. Nothing is closed without that approval. Omit on update to leave unchanged.

auto_close_prep_dayinteger

Day of the month (1-28, UTC) the close preparation runs. Omit on update to leave unchanged.

agent_close_business_dayinteger

Business day of the month (1-23, -1 = the last one) on which the Agent window starts closing the month that just ended: DayZero sends close.window_opened that day (Fed bank-holiday calendar, New York date). null = off. On update: omit to leave unchanged, send null or 0 to turn it off.

Responses

200Successful Response

successboolean
messagestring
codestring
dataAccountingPeriodSettings

400Bad Request - Invalid input

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

401Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

403Forbidden - Insufficient permissions

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

404Not Found - Resource does not exist

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

422Validation Error

errorstringrequired

Error category: validation_error, unauthorized, forbidden, not_found, conflict, rate_limited, server_error, or service_unavailable.

messagestringrequired

Human-readable explanation, safe to show to end users.

codestringrequired

Stable machine-readable code in CATEGORY_NNN form (e.g. NOT_FOUND_006, AUTH_010, GEN_002).

request_idstring

Correlation id for support requests. Echoes the x-request-id request header when one was supplied.

errorsobject

Field-level validation messages keyed by field name. Present on 400/422 validation failures only.