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

# List Invoices

> 
        Retrieve a paginated list of invoices with comprehensive filtering, sorting, and download capabilities.

        This endpoint provides powerful invoice listing with:
        - Advanced filtering by date ranges, status, clients, and entities
        - Full-text search across multiple fields
        - Flexible sorting options including custom calculated fields
        - Async CSV export functionality via email
        - Optimized queries with prefetched relationships

        **Filtering Options:**
        - Date-based filtering (invoice_date, due_date ranges)
        - Status-based filtering (payment status, sent status, aging buckets)
        - Entity and client-based filtering (supports multiple selections)
        - Contract and currency filtering
        - Full-text search across invoice numbers, addresses, messages, and client names

        **Sorting Capabilities:**
        - Standard field sorting (invoice_date, total_amount, due_date, etc.)
        - Custom calculated field sorting (amount_due, client_name, contract_name)
        - Ascending/descending order with null handling

        **Performance Features:**
        - Efficient database queries with proper indexing
        - Prefetched related objects (lines, payments, clients, entities)
        - Pagination support for large datasets
        - Optimized for high-volume invoice management

        **Export Functionality:**
        - Async CSV generation and email delivery
        - Filtered export based on current query parameters
        - Background processing to handle large datasets
        



## OpenAPI

````yaml https://api.meetcampfire.com/api/schema?format=json get /coa/api/v1/invoice/
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/:
    get:
      tags:
        - Accounts Receivable
      summary: List Invoices
      description: |2-

                Retrieve a paginated list of invoices with comprehensive filtering, sorting, and download capabilities.

                This endpoint provides powerful invoice listing with:
                - Advanced filtering by date ranges, status, clients, and entities
                - Full-text search across multiple fields
                - Flexible sorting options including custom calculated fields
                - Async CSV export functionality via email
                - Optimized queries with prefetched relationships

                **Filtering Options:**
                - Date-based filtering (invoice_date, due_date ranges)
                - Status-based filtering (payment status, sent status, aging buckets)
                - Entity and client-based filtering (supports multiple selections)
                - Contract and currency filtering
                - Full-text search across invoice numbers, addresses, messages, and client names

                **Sorting Capabilities:**
                - Standard field sorting (invoice_date, total_amount, due_date, etc.)
                - Custom calculated field sorting (amount_due, client_name, contract_name)
                - Ascending/descending order with null handling

                **Performance Features:**
                - Efficient database queries with proper indexing
                - Prefetched related objects (lines, payments, clients, entities)
                - Pagination support for large datasets
                - Optimized for high-volume invoice management

                **Export Functionality:**
                - Async CSV generation and email delivery
                - Filtered export based on current query parameters
                - Background processing to handle large datasets
                
      operationId: coa_api_v1_invoice_list
      parameters:
        - in: query
          name: client
          schema:
            type: integer
          description: Filter by client ID. Can be specified multiple times
          explode: true
          style: form
        - in: query
          name: contract
          schema:
            type: integer
          description: Filter by contract ID
        - in: query
          name: currency
          schema:
            type: string
          description: Filter by currency code (e.g., USD, EUR)
        - in: query
          name: download
          schema:
            type: boolean
            default: false
          description: >-
            If true, triggers async CSV download workflow and sends result via
            email
        - in: query
          name: end_date
          schema:
            type: string
          description: >-
            Filter invoices with invoice_date on or before this date
            (YYYY-MM-DD)
        - in: query
          name: entity
          schema:
            type: integer
          description: Filter by entity ID. Can be specified multiple times
          explode: true
          style: form
        - in: query
          name: invoice_number
          schema:
            type: string
          description: Filter by exact invoice number
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: line_tag_group_id
          schema:
            type: integer
          description: >-
            Filter invoices with at least one line item assigned a tag from this
            tag group ID
        - in: query
          name: line_tag_id
          schema:
            type: integer
          description: Filter invoices with at least one line item assigned this tag ID
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: paid_date_from
          schema:
            type: string
          description: Filter invoices with paid_date on or after this date (YYYY-MM-DD)
        - in: query
          name: paid_date_to
          schema:
            type: string
          description: Filter invoices with paid_date on or before this date (YYYY-MM-DD)
        - in: query
          name: q
          schema:
            type: string
          description: >-
            Search query - searches shipping address, invoice number, message,
            or client name
        - in: query
          name: ref_number
          schema:
            type: string
          description: Filter by exact ref number
        - in: query
          name: sentStatus
          schema:
            type: string
            enum:
              - not_sent
              - sent
          description: Filter by sent status
        - in: query
          name: sort
          schema:
            type: string
            default: '-invoice_date'
          description: >-
            Sort order. Use field name for ascending, -field for descending.
            Special fields: client_name, amount_due. Default: -invoice_date
        - in: query
          name: start_date
          schema:
            type: string
          description: Filter invoices with invoice_date on or after this date (YYYY-MM-DD)
        - in: query
          name: status
          schema:
            type: string
            enum:
              - '1_30'
              - '31_60'
              - '61_90'
              - '91_120'
              - current
              - over_120
              - paid
              - partially_paid
              - past_due
              - sent
              - uncollectible
              - unpaid
              - voided
          description: Filter by payment status
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAccountingInvoiceListList'
          description: ''
      security:
        - knoxApiToken: []
components:
  schemas:
    PaginatedAccountingInvoiceListList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/AccountingInvoiceList'
    AccountingInvoiceList:
      type: object
      description: >-
        Lightweight serializer for the invoice list endpoint.


        Excludes heavy nested fields (emails, payments, attachments,
        payment_journal_entries)

        that are only needed on the detail view. Keeps lines for the duplicate
        invoice action.
      properties:
        id:
          type: integer
          readOnly: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/AccountingInvoiceLine'
          readOnly: true
        journal_entry_intercompany:
          type: string
          readOnly: true
        client_name:
          type: string
          readOnly: true
        client_email:
          type: string
          readOnly: true
        client_invoice_message:
          type: string
          readOnly: true
        client_use_stripe_auto_bill:
          type: boolean
          readOnly: true
        contract_custom_fields:
          type: array
          items:
            type: object
            additionalProperties:
              oneOf:
                - type: string
                - type: boolean
                - type: array
                  items: {}
          readOnly: true
        status:
          type: string
          readOnly: true
        past_due_days:
          type: integer
          nullable: true
          readOnly: true
        entity_name:
          type: string
          readOnly: true
        entity_currency:
          type: string
          readOnly: true
        entity_invoice_message:
          type: string
          readOnly: true
          nullable: true
        total_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        amount_paid:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        amount_due:
          type: number
          format: double
          readOnly: true
        contract_name:
          type: string
          readOnly: true
        invoice_number:
          type: string
        stripe_connection_name:
          type: string
          readOnly: true
        stripe_connection_entity:
          type: integer
          readOnly: true
        stripe_connection_billing_portal_enabled:
          type: boolean
          readOnly: true
        avalara_connection_name:
          type: string
          readOnly: true
        avalara_connection_company:
          type: string
          readOnly: true
        tax_rate_name:
          type: string
          readOnly: true
        tax_rate_value:
          type: number
          format: double
          maximum: 1000000
          minimum: -1000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        payment_term_name:
          type: string
          readOnly: true
        revenue_transactions:
          type: array
          items:
            type: integer
        item_date:
          type: string
          format: date
          nullable: true
        voided_journal_entry_order:
          type: integer
          nullable: true
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        is_deleted:
          type: boolean
          readOnly: true
          default: false
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        search_vector:
          type: string
          readOnly: true
          nullable: true
        search_text:
          type: string
          readOnly: true
          nullable: true
        auto_send_invoice:
          type: boolean
          nullable: true
        auto_send_invoice_at:
          type: string
          format: date
          nullable: true
        auto_sent_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        reminder_sent_dates:
          description: >-
            Dictionary tracking when reminders were sent for each day overdue
            (e.g., {'5': '2024-01-15', '10': '2024-01-20'})
        pre_due_reminder_sent_dates:
          description: >-
            Dictionary tracking when pre-due reminders were sent for each day
            before due date (e.g., {'3': '2024-01-10', '7': '2024-01-06'})
        billing_address:
          type: string
          nullable: true
        billing_addressee:
          type: string
          nullable: true
          maxLength: 255
        shipping_address:
          type: string
          nullable: true
        shipping_addressee:
          type: string
          nullable: true
          maxLength: 255
        terms:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/TermsEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        ref_number:
          type: string
          nullable: true
          title: Reference Number
          maxLength: 120
        purchase_order_number:
          type: string
          nullable: true
          maxLength: 120
        invoice_date:
          type: string
          format: date
        due_date:
          type: string
          format: date
        shipping_date:
          type: string
          format: date
          nullable: true
        paid_date:
          type: string
          format: date
          nullable: true
        uncollectible_date:
          type: string
          format: date
          nullable: true
        sent_date:
          type: string
          format: date
          readOnly: true
          nullable: true
        period_start:
          type: string
          format: date
          nullable: true
        period_end:
          type: string
          format: date
          nullable: true
        location_of_sale:
          type: string
          nullable: true
        message_on_invoice:
          type: string
          nullable: true
        ita_allocation_number:
          type: string
          nullable: true
          pattern: ^\d{9}$
          maxLength: 9
        payment_status:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/PaymentStatusCdcEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        anrok_transaction_id:
          type: string
          nullable: true
          description: ID of the transaction in Anrok (set when transaction is created)
          maxLength: 255
        warning_message:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        currency:
          type: string
          maxLength: 3
        exchange_rate:
          type: number
          format: double
          maximum: 100000000000000
          minimum: -100000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        exchange_rate_book:
          type: number
          format: double
          maximum: 100000000000000
          minimum: -100000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
        last_sent_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        integration_id:
          type: string
          nullable: true
          maxLength: 250
        integration_context:
          nullable: true
        vat_number:
          type: string
          nullable: true
          maxLength: 250
        discount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
          description: Discount amount for the invoice
        payment_term_applied_discount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          nullable: true
          description: Discount amount applied based on payment term early payment discount
        use_stripe_auto_bill:
          type: boolean
          nullable: true
        stripe_payment_link_id:
          type: string
          nullable: true
          maxLength: 500
        stripe_payment_intent_id:
          type: string
          nullable: true
          maxLength: 500
        stripe_invoice_id:
          type: string
          nullable: true
          maxLength: 500
        stripe_pdf_url:
          type: string
          nullable: true
          maxLength: 500
        stripe_payment_link:
          type: string
          nullable: true
          maxLength: 500
        source:
          type: string
          nullable: true
          maxLength: 250
        source_id:
          type: string
          nullable: true
        is_migrated:
          type: boolean
          description: >-
            True for invoices imported via opening balance migration (no
            finalization JE).
        voided_date:
          type: string
          format: date
          nullable: true
        invoice_labels:
          nullable: true
        invoice_language:
          type: string
          nullable: true
          maxLength: 10
        chat_id:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        customer:
          type: integer
          readOnly: true
        entity:
          type: integer
        client:
          type: integer
          nullable: true
        payment_term:
          type: integer
          nullable: true
        bad_debt_journal_entry:
          type: integer
          nullable: true
        journal_entry:
          type: integer
          nullable: true
        ar_account:
          type: integer
          nullable: true
          description: >-
            Accounts Receivable account for this invoice. Populated for
            single-AR and migrated invoices. NULL for multi-AR invoices (aging
            uses ChartTransactions instead).
        voided_journal_entry:
          type: integer
          nullable: true
        entity_transfer_journal_entry:
          type: integer
          nullable: true
        contract:
          type: integer
          nullable: true
        avalara_connection:
          type: integer
          nullable: true
        sphere_connection:
          type: integer
          nullable: true
        anrok_connection:
          type: integer
          nullable: true
        tax_rate:
          type: integer
          nullable: true
        stripe_connection:
          type: integer
          nullable: true
        source_file:
          type: integer
          nullable: true
      required:
        - amount_due
        - amount_paid
        - auto_sent_at
        - avalara_connection_company
        - avalara_connection_name
        - client_email
        - client_invoice_message
        - client_name
        - client_use_stripe_auto_bill
        - contract_custom_fields
        - contract_name
        - created_at
        - customer
        - deleted_at
        - due_date
        - entity
        - entity_currency
        - entity_invoice_message
        - entity_name
        - id
        - invoice_date
        - is_deleted
        - journal_entry_intercompany
        - last_modified_at
        - last_sent_at
        - lines
        - past_due_days
        - payment_term_name
        - search_text
        - search_vector
        - sent_date
        - status
        - stripe_connection_billing_portal_enabled
        - stripe_connection_entity
        - stripe_connection_name
        - tax_rate_name
        - tax_rate_value
        - total_amount
        - voided_journal_entry_order
    AccountingInvoiceLine:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        invoice:
          type: integer
          writeOnly: true
        product_name:
          type: string
          readOnly: true
        product_bundle_name:
          type: string
          readOnly: true
        stripe_product_id:
          type: string
          readOnly: true
        product_is_taxable:
          type: boolean
          readOnly: true
        anrok_item_id:
          type: string
          readOnly: true
        sphere_item_id:
          type: string
          readOnly: true
        service_date:
          type: string
          format: date
          nullable: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TransactionTag'
          readOnly: true
        department_name:
          type: string
          readOnly: true
        department_code:
          type: string
          readOnly: true
        description:
          type: string
          nullable: true
        quantity:
          type: number
          format: double
          maximum: 10000000000000000
          minimum: -10000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        rate:
          type: number
          format: double
          maximum: 10000000000000
          minimum: -10000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        currency:
          type: string
          maxLength: 3
        amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        tax:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
        tax_description:
          type: string
          nullable: true
          maxLength: 250
        entity_use_code:
          type: string
          nullable: true
          description: Avalara entity/use code for line-level tax exemptions
          maxLength: 25
        discount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          description: Discount amount in currency
        discount_percentage:
          type: number
          format: double
          maximum: 1000
          minimum: -1000
          exclusiveMaximum: true
          exclusiveMinimum: true
          description: Discount percentage (0-100)
        discount_amount:
          type: number
          format: double
          maximum: 1000000000000000000
          minimum: -1000000000000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          description: Discount amount calculated from percentage
        tag_ids:
          type: array
          items:
            type: integer
            maximum: 9223372036854776000
            minimum: -9223372036854776000
            format: int64
        tag_group_ids:
          type: array
          items:
            type: integer
            maximum: 9223372036854776000
            minimum: -9223372036854776000
            format: int64
        created_at:
          type: string
          format: date-time
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        customer:
          type: integer
          readOnly: true
        product:
          type: integer
          nullable: true
        product_bundle:
          type: integer
          nullable: true
        department:
          type: integer
          nullable: true
      required:
        - anrok_item_id
        - created_at
        - customer
        - department_code
        - department_name
        - id
        - last_modified_at
        - product_bundle_name
        - product_is_taxable
        - product_name
        - sphere_item_id
        - stripe_product_id
        - tags
    TermsEnum:
      enum:
        - custom
        - net_5
        - net_7
        - net_10
        - net_15
        - net_20
        - net_30
        - net_40
        - net_45
        - net_60
        - net_90
        - net_105
        - net_120
        - due_on_receipt
      type: string
      description: |-
        * `custom` - Custom
        * `net_5` - Net 5
        * `net_7` - Net 7
        * `net_10` - Net 10
        * `net_15` - Net 15
        * `net_20` - Net 20
        * `net_30` - Net 30
        * `net_40` - Net 40
        * `net_45` - Net 45
        * `net_60` - Net 60
        * `net_90` - Net 90
        * `net_105` - Net 105
        * `net_120` - Net 120
        * `due_on_receipt` - Due on Receipt
    BlankEnum:
      enum:
        - ''
    NullEnum:
      enum:
        - null
    PaymentStatusCdcEnum:
      enum:
        - draft
        - open
        - sent
        - partial
        - paid
        - uncollectible
        - voided
      type: string
      description: |-
        * `draft` - Draft
        * `open` - Open
        * `sent` - Sent
        * `partial` - Partially Paid
        * `paid` - Paid
        * `uncollectible` - Uncollectible
        * `voided` - Voided
    TransactionTag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        group_name:
          type: string
          readOnly: true
        parent_name:
          type: string
          readOnly: true
          nullable: true
        parent:
          type: integer
          nullable: true
        is_deleted:
          type: boolean
          readOnly: true
          default: false
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        is_active:
          type: boolean
          default: true
        name:
          type: string
          nullable: true
          maxLength: 250
        created_at:
          type: string
          format: date-time
          readOnly: true
        last_modified_at:
          type: string
          format: date-time
          readOnly: true
        customer:
          type: integer
          readOnly: true
        group:
          type: integer
          nullable: true
      required:
        - created_at
        - customer
        - deleted_at
        - group_name
        - id
        - is_deleted
        - last_modified_at
        - name
        - parent_name
  securitySchemes:
    knoxApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````