> ## 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.

# Create ledger

> Create an accounting ledger for an invoicing entity.



## OpenAPI

````yaml post /v1/accounting/ledgers
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:
    post:
      tags:
        - Accounting > Ledgers
      summary: Create ledger
      description: Create an accounting ledger for an invoicing entity.
      operationId: createLedger
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                invoicing_entity_id:
                  type: string
                  description: Identifier of the invoicing entity that owns the ledger.
                name:
                  type: string
                  description: Display name of the ledger.
                code:
                  type:
                    - string
                    - 'null'
                  description: Optional accounting code of the ledger.
                description:
                  type:
                    - string
                    - 'null'
                  description: Optional description of the ledger.
                type:
                  type: string
                  enum:
                    - IFRS
                    - US_GAAP
                    - FR_GAAP
                    - UK_GAAP
                    - LOCAL_GAAP
                    - MANAGEMENT
                    - CONSOLIDATION
                    - AUDIT_ADJUSTMENT
                  description: Type of ledger.
                currency:
                  type: string
                  description: ISO 4217 currency used by the ledger.
                entry_number_pattern:
                  type: string
                  description: Entry numbering pattern containing `{number}`.
                is_primary:
                  type:
                    - boolean
                    - 'null'
                  description: Whether this is the primary ledger for the invoicing entity.
                is_inactive:
                  type:
                    - boolean
                    - 'null'
                  description: Whether the ledger is inactive.
              required:
                - invoicing_entity_id
                - name
                - code
                - description
                - type
                - currency
                - entry_number_pattern
                - is_primary
                - is_inactive
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingLedger'
      security:
        - bearer: []
components:
  schemas:
    AccountingLedger:
      type: object
      properties:
        id:
          type: string
          description: Unique ledger identifier.
        name:
          type: string
          description: Display name of the ledger.
        code:
          type:
            - string
            - 'null'
          description: Accounting code of the ledger.
        description:
          type:
            - string
            - 'null'
          description: Optional ledger description.
        type:
          type: string
          enum:
            - IFRS
            - US_GAAP
            - FR_GAAP
            - UK_GAAP
            - LOCAL_GAAP
            - MANAGEMENT
            - CONSOLIDATION
            - AUDIT_ADJUSTMENT
          description: Type of ledger.
        invoicing_entity_id:
          type: string
          description: Owning invoicing entity identifier.
        currency:
          type: string
          description: ISO 4217 ledger currency.
        entry_number_pattern:
          type: string
          description: Pattern used to number journal entries.
        next_entry_number:
          type: number
          description: Next journal-entry sequence number.
        is_primary:
          type:
            - boolean
            - 'null'
          description: Whether this is the entity's primary ledger.
        is_inactive:
          type:
            - boolean
            - 'null'
          description: Whether the ledger is inactive.
        created_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the ledger was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the ledger was last updated.
      required:
        - id
        - name
        - code
        - description
        - type
        - invoicing_entity_id
        - currency
        - entry_number_pattern
        - next_entry_number
        - is_primary
        - is_inactive
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````