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

# Preview invoice report

> Execute invoice report preview from query params.

:param request: HTTP request with report configuration
:return: Paginated response or CSV stream



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json get /coa/api/v1/invoice/report/preview
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:
  /coa/api/v1/invoice/report/preview:
    get:
      tags:
        - Accounts Receivable
      summary: Preview invoice report
      description: |-
        Execute invoice report preview from query params.

        :param request: HTTP request with report configuration
        :return: Paginated response or CSV stream
      operationId: coa_api_v1_invoice_report_preview_retrieve
      parameters:
        - in: query
          name: aggregation_fields
          schema:
            type: string
          description: 'Aggregates: sum:amount, sum:amount_paid, sum:amount_due, etc.'
        - in: query
          name: client_id
          schema:
            type: string
          description: Filter by client ID(s)
        - in: query
          name: contract_id
          schema:
            type: string
          description: Filter by contract ID(s)
        - in: query
          name: currency
          schema:
            type: string
          description: Filter by currency code
        - in: query
          name: department_id
          schema:
            type: string
          description: Filter by department ID(s)
        - in: query
          name: end_date
          schema:
            type: string
          description: End date (YYYY-MM-DD)
        - in: query
          name: entity_id
          schema:
            type: string
          description: Entity ID(s), comma-separated
        - in: query
          name: group_fields
          schema:
            type: string
          description: >-
            Row dimensions: client_id, invoice_id, invoice_date_month,
            product_id, etc.
        - in: query
          name: group_keys
          schema:
            type: string
          description: Drilldown parent keys
        - in: query
          name: include_totals
          schema:
            type: boolean
          description: Include grand totals row
        - in: query
          name: limit
          schema:
            type: integer
          description: Page size (max 10000)
        - in: query
          name: mode
          schema:
            type: string
          description: paginated | full | csv
        - in: query
          name: offset
          schema:
            type: integer
          description: Pagination offset
        - in: query
          name: payment_status
          schema:
            type: string
          description: 'Filter by status: draft,open,sent,partial,paid,uncollectible'
        - in: query
          name: pivot_fields
          schema:
            type: string
          description: 'Column dimensions: product_id, client_id, etc.'
        - in: query
          name: product_id
          schema:
            type: string
          description: Filter by product ID(s)
        - in: query
          name: shouldPivot
          schema:
            type: boolean
          description: Enable pivot columns
        - in: query
          name: start_date
          schema:
            type: string
          description: Start date (YYYY-MM-DD)
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceReportResponse'
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    InvoiceReportResponse:
      type: object
      description: Output schema for invoice report responses.
      properties:
        count:
          type: integer
          description: Total rows before pagination
        next:
          type: string
          nullable: true
          description: Next page URL (null for datatable pagination)
        previous:
          type: string
          nullable: true
          description: Previous page URL
        results:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceReportResultRow'
          description: Paginated result rows
        engine_used:
          allOf:
            - $ref: '#/components/schemas/EngineUsedEnum'
          description: |-
            Execution engine: 'postgres'

            * `postgres` - postgres
        pivot_result_fields:
          type: array
          items:
            type: string
          description: Sorted list of pivot column names
        totals_row:
          type: object
          additionalProperties: {}
          description: Grand totals across all rows
        pivot_value_mappings:
          type: object
          additionalProperties: {}
          description: 'Mapping of pivot field -> {display_name: id} for drilldown'
      required:
        - count
        - engine_used
        - next
        - previous
        - results
    InvoiceReportResultRow:
      type: object
      description: Schema for a single result row (dimensions + aggregates + drilldown).
      properties:
        filter_params:
          type: object
          additionalProperties: {}
          description: Filter parameters for drilldown navigation
        group_id:
          type: integer
          description: Row identifier for AG Grid merging
        id:
          type: integer
          description: Row identifier for AG Grid getRowId
      required:
        - filter_params
        - group_id
        - id
    EngineUsedEnum:
      enum:
        - postgres
      type: string
      description: '* `postgres` - postgres'
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````