# createAccountingPeriod

## Overview

Adds an accounting period (会計期間) to a fiscal year. The `companyId` is derived
from the fiscal year. The dates must fall within the fiscal year and must not overlap
another OPERATING period (ADJUSTMENT periods may share an end date). The period is
created NEVER_OPENED and must be opened before journal entries can post to it.
`periodType` defaults to OPERATING. Thin wrapper over the native `createAccountingPeriod`.

## Modules Commands Used

- [financial-accounting] createAccountingPeriod

## Exception Handling

| Error Code | Description |
| --- | --- |
| FINANCIAL_ACCOUNTING_FISCAL_YEAR_NOT_FOUND | The fiscal year does not exist |
| FINANCIAL_ACCOUNTING_NAME_REQUIRED | The period name is empty |
| FINANCIAL_ACCOUNTING_INVALID_DATE_RANGE | The dates are outside the fiscal year or the end date is not after the start date |
| FINANCIAL_ACCOUNTING_DUPLICATE_PERIOD_DATES | Another period already covers these exact dates |
| FINANCIAL_ACCOUNTING_OVERLAPPING_PERIOD | The dates overlap an existing operating period |
