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

# Get Report Ledger API

> Retrieve the general ledger lines behind a finished Breezing account report, for one account with a running balance or all accounts.



## OpenAPI

````yaml GET /reports/{id}/ledger
openapi: 3.1.0
info:
  title: Breezing Public API
  version: 1.0.0
  description: >-
    Crypto accounting API for programmatic access and AI agents. Authenticate
    with an API key using the Authorization header: `Bearer brz_...`
servers:
  - url: https://api.breezing.io/v1
security:
  - BearerAuth: []
paths:
  /reports/{id}/ledger:
    get:
      tags:
        - Reports
      summary: General ledger lines of an account report
      description: >-
        List the journal lines behind a FINISHED account report (type=account,
        status=done), in day order, either for ONE account (accountCode: the
        trial-balance drill-down with a running balance from the stored opening
        balance) or for every used account at once (no accountCode: lines
        stamped with the account they land on, plus each account's
        opening/period/closing figures so a client can run the balances itself).


        Nothing is stored: lines are re-derived through the same journal engine
        and the same window the report used, transactions and approved received
        invoices alike, so the listing reconciles to the trial balance by
        construction. Page with `cursor` until `complete` is true. 400 for
        non-account or unfinished reports, 404 for an unknown report or an
        account the report has no row for. A journal mapping missing since the
        report ran surfaces as an authored 400.
      parameters:
        - schema:
            type: string
            description: Report ID
            example: '3'
          required: true
          description: Report ID
          name: id
          in: path
        - schema:
            type: string
            description: >-
              Organization ID. Use GET /v1/companies to discover available
              org/company pairs.
            example: '1'
          required: true
          description: >-
            Organization ID. Use GET /v1/companies to discover available
            org/company pairs.
          name: orgId
          in: query
        - schema:
            type: string
            description: >-
              Company ID. Use GET /v1/companies to discover available companies
              and their access levels.
            example: '1'
          required: true
          description: >-
            Company ID. Use GET /v1/companies to discover available companies
            and their access levels.
          name: companyId
          in: query
        - schema:
            type: string
            maxLength: 200
            description: >-
              Chart account code to drill into (one of the report's
              trial-balance codes). Omit for every used account.
          required: false
          description: >-
            Chart account code to drill into (one of the report's trial-balance
            codes). Omit for every used account.
          name: accountCode
          in: query
        - schema:
            type: string
            maxLength: 2000
            description: >-
              nextCursor from the previous page, passed back exactly as
              returned: any other value is a 400.
          required: false
          description: >-
            nextCursor from the previous page, passed back exactly as returned:
            any other value is a 400.
          name: cursor
          in: query
        - schema:
            type: string
            description: >-
              Target number of lines per page (1-1000, default about 200). The
              server scans in bounded pages, so a page may return fewer lines
              with a nextCursor.
          required: false
          description: >-
            Target number of lines per page (1-1000, default about 200). The
            server scans in bounded pages, so a page may return fewer lines with
            a nextCursor.
          name: limit
          in: query
      responses:
        '200':
          description: Ledger page
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      mode:
                        type: string
                        enum:
                          - account
                          - all
                        description: >-
                          "account" when accountCode was given (running balance
                          per line), "all" otherwise (lines stamped with
                          accountCode, no running balance).
                      report:
                        type: object
                        properties:
                          id:
                            type: number
                          name:
                            type: string
                            nullable: true
                          dateFrom:
                            type: string
                          dateTo:
                            type: string
                          currency:
                            type: string
                            nullable: true
                        required:
                          - id
                          - name
                          - dateFrom
                          - dateTo
                          - currency
                      account:
                        $ref: '#/components/schemas/LedgerAccount'
                      accounts:
                        type: array
                        nullable: true
                        items:
                          $ref: '#/components/schemas/LedgerAccount'
                        description: >-
                          All-accounts mode: every report row with a nonzero
                          balance or movement, in code order.
                      lines:
                        type: array
                        items:
                          $ref: '#/components/schemas/LedgerLine'
                      nextCursor:
                        type: string
                        nullable: true
                        description: >-
                          Opaque cursor for the next page; null once the listing
                          is complete.
                      complete:
                        type: boolean
                      scanned:
                        type: integer
                        description: Rows scanned so far (a whale-company progress hint).
                      totals:
                        type: object
                        properties:
                          debit:
                            type: string
                          credit:
                            type: string
                          balance:
                            type: string
                        required:
                          - debit
                          - credit
                          - balance
                        description: >-
                          The listing's own sums so far. Single-account mode:
                          once complete they equal the account's period
                          debit/credit; a difference means settings or the chart
                          changed since the report ran.
                    required:
                      - mode
                      - report
                      - account
                      - accounts
                      - lines
                      - nextCursor
                      - complete
                      - scanned
                      - totals
                required:
                  - success
                  - data
        '400':
          description: Not an account report, not finished, bad cursor or blank accountCode
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            API key has no access to this company, has read-only access where
            write was required, or the company subscription is inactive
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Report or account not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
      security:
        - BearerAuth: []
components:
  schemas:
    LedgerAccount:
      type: object
      nullable: true
      properties:
        code:
          type: string
        name:
          type: string
        openingBalance:
          type: string
          description: Signed, debit-positive, from the report row.
        periodDebit:
          type: string
        periodCredit:
          type: string
        closingBalance:
          type: string
      required:
        - code
        - name
        - openingBalance
        - periodDebit
        - periodCredit
        - closingBalance
      description: 'Single-account mode: the account being listed.'
    LedgerLine:
      type: object
      properties:
        key:
          type: string
        date:
          type: string
          description: Journal day, yyyy-MM-dd (UTC).
        source:
          type: string
          enum:
            - transaction
            - invoice
            - invoicePayment
            - invoiceDifference
            - openingBalance
            - manualJournal
          description: >-
            transaction = a transaction journal line; invoice = a received
            invoice accrual line; invoicePayment = its AP clearing transfer
            (clearing mode); invoiceDifference = the gain or loss between the
            invoice and what its payments were worth (direct mode);
            openingBalance = a Take-on Journal line; manualJournal = a posted
            Manual Journal line.
        label:
          type: string
          description: >-
            The engine's line description: Amount, Fair Value, Cost Basis, Fee,
            Net Gain/Loss, Slippage, FX Gain/Loss (the value difference of a
            trade between two fiat currencies), VAT (the VAT line of a
            transaction whose tax rate carries a VAT account), or the row's
            accounting description.
        description:
          type: string
          description: >-
            Counterparty of the transaction, the invoice vendor, or the line
            description of a manual journal line.
        contactName:
          type: string
          nullable: true
          description: >-
            The contact a manual journal line is about, as it read when the
            journal was saved. null or absent on every other source and on a
            journal line without a contact.
        detail:
          type: string
          description: Token amount ("0.5 ETH") or the invoice number.
        reference:
          type: string
          description: Transaction hash or invoice number.
        note:
          type: string
          nullable: true
        debit:
          type: string
        credit:
          type: string
        tax:
          type: string
        taxRate:
          type: string
          nullable: true
        taxRateName:
          type: string
          nullable: true
        trxId:
          type: number
          nullable: true
        invoiceId:
          type: number
          nullable: true
        walletId:
          type: number
          nullable: true
        walletName:
          type: string
          nullable: true
        runningBalance:
          type: string
          description: >-
            Single-account mode only: debit-positive running balance from the
            account's opening balance.
        accountCode:
          type: string
          description: >-
            All-accounts mode only: the account the line lands on (the report
            row's code).
      required:
        - key
        - date
        - source
        - label
        - description
        - detail
        - reference
        - note
        - debit
        - credit
        - tax
        - taxRate
        - taxRateName
        - trxId
        - invoiceId
        - walletId
        - walletName

````

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