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

# Get Trial Balance



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json get /ca/api/get_trial_balance
openapi: 3.0.3
info:
  title: Campfire Developer APIs
  version: 1.0.0
  description: >
    ## Introduction

    Campfire's developer APIs offer granular access to Campfire's core
    accounting,

    revenue recognition, and financial data features.


    These APIs are designed to be used by developers to build custom
    integrations,

    automate workflows, and perform any other programmatic operations.
servers:
  - url: https://api.meetcampfire.com
    description: Production server
security: []
tags:
  - name: Cash Management
    description: Operations related to accounts, transactions, and other bank-related data.
  - name: Core Accounting
    description: >-
      Operations related to core accounting data, such as the chart of accounts,
      entity management, and the general ledger.
  - name: Revenue Recognition
    description: >-
      Operations related to revenue recognition, contract management, and
      contract data aggregation.
  - name: Accounts Receivable
    description: Operations related to invoicing and the AR subledger
  - name: Accounts Payable
    description: Operations related to billing and the AP subledger.
  - name: Financial Statements
    description: Operations related to financial statement generation and data aggregation.
  - name: Settings
    description: Operations related to system and accounting settings configuration.
paths:
  /ca/api/get_trial_balance:
    get:
      tags:
        - Financial Statements
      summary: Get Trial Balance
      operationId: ca_api_get_trial_balance_retrieve
      parameters:
        - in: query
          name: department
          schema:
            type: integer
          description: >-
            Filter by department ID. Can be specified multiple times for
            multiple departments
          explode: true
          style: form
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: >-
            Latest date (inclusive) for which to retrieve data. Defaults to end
            of current month
        - in: query
          name: entity
          schema:
            type: integer
          description: >-
            Entity ID(s) to scope the report. Can be repeated
            (?entity=1&entity=2) or JSON array
          explode: true
          style: form
        - in: query
          name: entity_rollup
          schema:
            type: boolean
            default: false
          description: If true, includes all data of children entities in consolidation
        - in: query
          name: group_by
          schema:
            type: string
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: >-
            Earliest date (inclusive) for which to retrieve data. Defaults to
            six months ago
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrialBalanceResponse'
              examples:
                Example:
                  value:
                    trial_balance:
                      accounts:
                        - id: 2550
                          name: Accounts Payable
                          number: '210000'
                          balances:
                            '2023-08-31':
                              debits: 0
                              credits: 123
                            '2023-09-30':
                              debits: 0
                              credits: 123
                        - id: 2551
                          name: Credit Cards
                          number: '220000'
                          balances:
                            '2023-08-31':
                              debits: 1700.14
                              credits: 0
                            '2023-09-30':
                              debits: 1700.14
                              credits: 0
                    start_date: '2023-10-01'
                    end_date: '2023-11-30'
                ExportExample:
                  value: >-
                    GET
                    /api/trial-balance/?export=xlsx&start_date=2023-01-01&end_date=2023-12-31
                  summary: Export Example
                  description: Export trial balance to Excel format
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    TrialBalanceResponse:
      type: object
      properties:
        trial_balance:
          $ref: '#/components/schemas/TrialBalanceData'
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        breakdown:
          type: object
          additionalProperties: {}
      required:
        - end_date
        - start_date
        - trial_balance
    TrialBalanceData:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/TrialBalanceAccount'
      required:
        - accounts
    TrialBalanceAccount:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        number:
          type: string
        account_type:
          type: string
        balances:
          $ref: '#/components/schemas/TrialBalanceAccountBalance'
        departments:
          type: object
          additionalProperties: {}
        department:
          type: string
        entities:
          type: object
          additionalProperties: {}
        parent:
          type: string
      required:
        - id
        - name
        - number
    TrialBalanceAccountBalance:
      type: object
      properties:
        debits:
          type: number
          format: double
          maximum: 10000000000000
          minimum: -10000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        credits:
          type: number
          format: double
          maximum: 10000000000000
          minimum: -10000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
      required:
        - credits
        - debits
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````