> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.zenskar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate period close

> Validate prerequisites for closing an accounting period without actually closing it. Returns a comprehensive checklist of what needs to be fixed.



## OpenAPI

````yaml /openAPI/openapi-20240301.json post /accounting_new/periods/validate-close
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /accounting_new/periods/validate-close:
    post:
      tags:
        - Accounting
      summary: Validate period close
      description: >-
        Validate prerequisites for closing an accounting period without actually
        closing it. Returns a comprehensive checklist of what needs to be fixed.
      operationId: Validate-period-close
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateCloseRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateCloseResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ValidateCloseRequestSchema:
      properties:
        end_date:
          type: string
          format: date
          title: End Date
          description: End date to validate for period close
      type: object
      required:
        - end_date
      title: ValidateCloseRequestSchema
      description: |-
        Request schema for the dry-run that reports what still blocks a close,
        without actually closing.
    ValidateCloseResponseSchema:
      properties:
        can_close:
          type: boolean
          title: Can Close
          description: Whether all blocking validations passed
        period_start:
          type: string
          format: date
          title: Period Start
          description: Auto-calculated start date
        period_end:
          type: string
          format: date
          title: Period End
          description: Requested end date
        validation_checks:
          items:
            $ref: '#/components/schemas/ValidationCheckItemSchema'
          type: array
          title: Validation Checks
          description: Detailed results of each validation check
        summary:
          additionalProperties:
            type: integer
          type: object
          title: Summary
          description: Aggregate statistics (total_checks, passed, failed, total_issues)
      type: object
      required:
        - can_close
        - period_start
        - period_end
        - validation_checks
        - summary
      title: ValidateCloseResponseSchema
      description: |-
        Response schema for period close validation — the checklist of what
        passed, what failed, and whether the period can actually close.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationCheckItemSchema:
      properties:
        check_name:
          type: string
          title: Check Name
          description: Name of the validation check
        passed:
          type: boolean
          title: Passed
          description: Whether the check passed
        is_blocking:
          type: boolean
          title: Is Blocking
          description: Whether this check blocks period close if failed
          default: true
        count:
          type: integer
          title: Count
          description: Number of issues found
        message:
          type: string
          title: Message
          description: Human-readable message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: Additional details
      type: object
      required:
        - check_name
        - passed
        - count
        - message
      title: ValidationCheckItemSchema
      description: Result of a single validation check performed by a validator.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````