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

# Get invoices

> Get a list of invoices

<Note>
  **SystemUser permission:** `InvoiceService:getInvoices, JobService:create`
</Note>


## OpenAPI

````yaml get /invoices
openapi: 3.0.3
info:
  title: Enso API
  description: >-
    REST API for Enso's billing & metering platform. This reference covers
    endpoints accessible to the SystemUser role — the role used by API
    integrations.
  version: 1.0.0
  license:
    name: Proprietary
servers:
  - url: https://api.getenso.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Apps
    description: Third-party app integrations and credentials
  - name: Attributes
    description: Custom attribute definitions on catalog/customer entities
  - name: Auth
    description: Exchange API credentials for an access token
  - name: Billing
    description: Plans and plan items — what your contracts apply
  - name: Catalog
    description: SKUs and SKU groups — the product taxonomy that plans price against
  - name: Chatbot
    description: Conversational endpoints
  - name: Collections
    description: ''
  - name: Contracts
    description: Contracts that bind a customer to one or more billing plans
  - name: Customers
    description: Manage customer records — the parties Enso bills
  - name: Email templates
    description: Manage email templates
  - name: Entities
    description: Entities (legal entity, contracting organisation) used in billing
  - name: Events
    description: Raw event ingestion — the input to the metering pipeline
  - name: FSM (object lifecycle)
    description: >-
      Drive lifecycle transitions on Invoice/Contract/etc. — used for raise,
      send, mark-paid, etc.
  - name: FX Rates
    description: Currency conversion rates
  - name: Geography
    description: Country/state lookups — reference data for addresses
  - name: Invoices
    description: Invoice CRUD, items, sync, PDF generation, document upload
  - name: Jobs
    description: >-
      Background job orchestration — used by long-running operations like bulk
      sync
  - name: Masters
    description: ''
  - name: Meters
    description: Usage meters — the per-aggregation tally that feeds invoices
  - name: Objects
    description: Generic object schema and query — exposes the data model dynamically
  - name: Organisation
    description: ''
  - name: Organisation attributes
    description: Organisation-level custom attributes
  - name: Organisation settings
    description: Organisation-wide configuration values
  - name: Revenue
    description: Recognised revenue records derived from invoices
  - name: Usage
    description: Usage records — what got billed against each meter for a billing period
  - name: Users
    description: User account read access
paths:
  /invoices:
    get:
      tags:
        - Invoices
      summary: Get invoices
      description: Get a list of invoices
      operationId: getInvoices
      parameters:
        - name: page
          in: query
          description: Page number for pagination
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: limit
          in: query
          description: Number of invoices per page
          required: false
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 50
        - name: filters
          in: query
          description: >-
            Filters to apply for querying invoices. Pass as a **URL-encoded JSON
            string**. Supports operators like `like`, `eq`, `ne`, `gt`, `lt`,
            etc.


            **The filters parameter must be stringified and URL-encoded.**


            **Example usage in code:**


            ```js

            filters: encodeURIComponent(JSON.stringify({ status: { like: 'draf%'
            } }))

            ```


            **Example usage in query string:**


            `filters=%7B%22status%22%3A%7B%22like%22%3A%22draf%25%22%7D%7D`


            **Supported operators:**

            - `like`: pattern matching (e.g., `{ "status": { "like": "draf%" }
            }`)

            - `eq`: equals (e.g., `{ "status": { "eq": "draft" } }`)

            - `ne`: not equals

            - `gt`: greater than

            - `lt`: less than

            - `in`: in array (e.g., `{ "status": { "in": ["draft", "sent"] } }`)


            **More examples:**

            - Filter by status starting with 'draf':
              - Raw: `{ "status": { "like": "draf%" } }`
              - Encoded: `%7B%22status%22%3A%7B%22like%22%3A%22draf%25%22%7D%7D`
            - Filter by status equals 'paid':
              - Raw: `{ "status": { "eq": "paid" } }`
              - Encoded: `%7B%22status%22%3A%7B%22eq%22%3A%22paid%22%7D%7D`
            - Filter by createdAt greater than a date:
              - Raw: `{ "createdAt": { "gt": "2024-01-01" } }`
              - Encoded: `%7B%22createdAt%22%3A%7B%22gt%22%3A%222024-01-01%22%7D%7D`
          required: false
          schema:
            type: string
        - name: search
          in: query
          schema:
            type: string
          description: Search/filter string
      responses:
        '200':
          description: List of invoices
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message
                  status:
                    type: string
                    description: Status of the response
                  data:
                    type: object
                    properties:
                      rows:
                        type: array
                        items:
                          $ref: '#/components/schemas/Invoice'
                        description: List of invoices
                      count:
                        type: integer
                        description: Total number of invoices
        '400':
          description: Bad request — validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Unauthorized — token missing or invalid
        '403':
          description: Forbidden — insufficient permissions
components:
  schemas:
    Invoice:
      type: object
      properties:
        id:
          type: string
          example: inv_123
        contractPlanId:
          type: string
          example: cp_123
        customerIdentifier:
          type: string
          description: >-
            Customer identifier used when creating the invoice without a
            contract plan ID.
          example: customer_001
        invoiceData:
          $ref: '#/components/schemas/InvoiceData'
        invoiceItems:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceItem'
        status:
          type: string
          example: draft
        comments:
          type: string
          example: Reason for cancellation
        dateOfPayment:
          type: string
          format: date-time
          example: '2025-06-04T12:00:00Z'
    ErrorEnvelope:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Forbidden
        errors:
          type: array
          items:
            type: object
    InvoiceData:
      $ref: '#/components/schemas/invoiceData'
    InvoiceItem:
      $ref: '#/components/schemas/invoiceItem'
    invoiceData:
      type: object
      properties:
        date:
          type: string
          format: date
          example: '2023-10-01'
        fromDate:
          type: string
          format: date
          example: '2023-10-01'
        toDate:
          type: string
          format: date
          example: '2023-10-31'
    invoiceItem:
      type: object
      properties:
        title:
          type: string
          example: Item Title
        description:
          type: string
          example: Item description
        quantity:
          type: number
          example: 1
        price:
          type: number
          example: 100
        fromDate:
          type: string
          format: date
          example: '2023-10-01'
        toDate:
          type: string
          format: date
          example: '2023-10-31'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer token obtained from POST /auth/system-login using your client
        credentials.

````