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

# Get ledger statement

> Generate a statement for the ledger



## OpenAPI

````yaml get /v1/ledgers/{id}/statement
openapi: 3.0.0
info:
  title: Ledgers API
  version: 1.0.0
  description: API for managing accounting ledgers and entries
servers: []
security:
  - bearerAuth: []
tags:
  - name: Ledgers
    description: Ledger management operations
paths:
  /v1/ledgers/{id}/statement:
    get:
      tags:
        - Ledger Reports
      summary: Get ledger statement
      description: Generate a statement for the ledger
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Ledger UUID
        - name: from_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
          description: Statement start date
        - name: to_date
          in: query
          required: true
          schema:
            type: string
            format: date-time
          description: Statement end date
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - pdf
              - csv
            default: json
          description: Statement format
      responses:
        '200':
          description: Statement generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerStatement'
            application/pdf:
              schema:
                type: string
                format: binary
            text/csv:
              schema:
                type: string
components:
  schemas:
    LedgerStatement:
      type: object
      properties:
        statement_id:
          type: string
          format: uuid
        ledger_id:
          type: string
          format: uuid
        period:
          type: object
          properties:
            start_date:
              type: string
              format: date-time
            end_date:
              type: string
              format: date-time
        opening_balance:
          type: integer
          description: Opening balance in cents
        closing_balance:
          type: integer
          description: Closing balance in cents
        total_credits:
          type: integer
          description: Total credits in cents
        total_debits:
          type: integer
          description: Total debits in cents
        entries:
          type: array
          items:
            $ref: '#/components/schemas/LedgerEntry'
    LedgerEntry:
      type: object
      properties:
        id:
          type: string
          format: uuid
        ledger_id:
          type: string
          format: uuid
        transaction_id:
          type: string
          format: uuid
        amount:
          type: integer
          description: Amount in cents
        type:
          type: string
          enum:
            - credit
            - debit
        description:
          type: string
        balance:
          type: integer
          description: Running balance in cents
        timestamp:
          type: string
          format: date-time
        metadata:
          type: object
          nullable: true
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````