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

# Close ledger period

> Close every month of a ledger through an ended month, after posting the revenue recognition due by its end; a user token needs the accounting_close permission.



## OpenAPI

````yaml post /v1/accounting/ledgers/{id}/close
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/accounting/ledgers/{id}/close:
    post:
      tags:
        - Accounting > Ledgers
      summary: Close ledger period
      description: >-
        Close every month of a ledger through an ended month, after posting the
        revenue recognition due by its end; a user token needs the
        accounting_close permission.
      operationId: closeLedgerPeriod
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountingCloseLedgerPeriodCommand'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingLedgerCloseState'
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    AccountingCloseLedgerPeriodCommand:
      type: object
      properties:
        through_month:
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          description: >-
            Last month to close, formatted YYYY-MM: an ended month after the
            last closed month. Every earlier month is closed too.
          example: 2026-09
        reason:
          type: string
          minLength: 1
          maxLength: 500
          description: Why the months are closed, 1 to 500 characters.
      required:
        - through_month
    AccountingLedgerCloseState:
      type: object
      properties:
        ledger_id:
          type: string
          description: Ledger identifier.
        closed_through_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Last day of the last closed month (UTC), formatted YYYY-MM-DD. Null
            when no month is closed.
          example: '2026-09-30'
        closed_through_month:
          type:
            - string
            - 'null'
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          description: Last closed month, formatted YYYY-MM. Null when no month is closed.
          example: 2026-09
        latest_closable_month:
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          description: >-
            Latest month that can be closed: the month before the current UTC
            month, formatted YYYY-MM.
          example: 2026-09
      required:
        - ledger_id
        - closed_through_date
        - closed_through_month
        - latest_closable_month
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.