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

# List journal entries

> 
        List all journal entries for a business with comprehensive filtering.

        **Features:**
        - Filter by date range (date_from, date_to)
        - Filter by account (entries affecting a specific account)
        - Filter by status (draft, approved, rejected)
        - Filter by created_by (ai, manual, system, import)
        - Filter by posted status
        - Search by description, reference, or sequence number
        - Pagination support (default: 20 per page, max: 100)

        **Response includes:**
        - Entry sequence number, date, reference, description
        - Total debit and credit amounts
        - Balance status
        - Status and creation metadata
        - Posted status and timestamp
        - Source document type and reference (invoice, bill, payment, etc.)
        



## OpenAPI

````yaml GET /v1/platform/businesses/{business_id}/general-ledger/journal-entries/
openapi: 3.0.3
info:
  title: Thredfi Accounting Platform API
  version: 1.0.0
  description: >-
    Comprehensive API for accounting, invoice management, open banking, and
    intelligence services.
servers: []
security: []
paths:
  /v1/platform/businesses/{business_id}/general-ledger/journal-entries/:
    get:
      tags:
        - General Ledger
      summary: List journal entries
      description: |2-

                List all journal entries for a business with comprehensive filtering.

                **Features:**
                - Filter by date range (date_from, date_to)
                - Filter by account (entries affecting a specific account)
                - Filter by status (draft, approved, rejected)
                - Filter by created_by (ai, manual, system, import)
                - Filter by posted status
                - Search by description, reference, or sequence number
                - Pagination support (default: 20 per page, max: 100)

                **Response includes:**
                - Entry sequence number, date, reference, description
                - Total debit and credit amounts
                - Balance status
                - Status and creation metadata
                - Posted status and timestamp
                - Source document type and reference (invoice, bill, payment, etc.)
                
      operationId: list_journal_entries
      parameters:
        - in: query
          name: account_id
          schema:
            type: string
            format: uuid
          description: Filter entries affecting a specific account
        - in: path
          name: business_id
          schema:
            type: string
            format: uuid
          description: Business UUID
          required: true
        - in: query
          name: created_by
          schema:
            type: string
          description: 'Filter by creator: ai, manual, system, import'
        - in: query
          name: date_from
          schema:
            type: string
            format: date
          description: Filter entries from this date (inclusive)
        - in: query
          name: date_to
          schema:
            type: string
            format: date
          description: Filter entries up to this date (inclusive)
        - in: query
          name: is_posted
          schema:
            type: boolean
          description: Filter by posted status
        - in: query
          name: page
          schema:
            type: integer
          description: 'Page number (default: 1)'
        - in: query
          name: page_size
          schema:
            type: integer
          description: 'Items per page (default: 20, max: 100)'
        - in: query
          name: search
          schema:
            type: string
          description: Search by description, reference, or sequence number
        - in: query
          name: status
          schema:
            type: string
          description: 'Filter by status: draft, approved, rejected'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedJournalEntryListList'
              examples:
                UKJournalEntry-CustomerInvoice:
                  value:
                    count: 123
                    page_info:
                      total_count: 123
                      current_page: 1
                      total_pages: 7
                      page_size: 20
                    results:
                      - id: je-uuid-001
                        sequence_number: JE-2024-0042
                        entry_date: '2024-03-28'
                        reference: INV-0042
                        description: Customer invoice for The Red Lion Pub Ltd
                        currency: GBP
                        total_debit: 540000
                        total_credit: 540000
                        is_balanced: true
                        created_by: system
                        created_by_display: System
                        status: approved
                        status_display: Approved
                        is_posted: true
                        posted_at: '2024-03-28T10:15:00Z'
                        bank_transaction_id: null
                        source_type: invoice
                        source_reference: INV-0042
                        created_at: '2024-03-28T10:10:00Z'
                  summary: UK Journal Entry - Customer Invoice
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Validation errors in request data
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication required - missing or invalid API key
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Permission denied - insufficient privileges
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Resource not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict - resource already exists or invalid state transition
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable entity - business logic validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - PartnerJWT: []
        - BusinessScopedJWT: []
        - BasicAuth: []
        - BearerUnscoped: []
        - BearerBusinessScoped: []
components:
  schemas:
    PaginatedJournalEntryListList:
      type: object
      required:
        - count
        - page_info
        - results
      properties:
        count:
          type: integer
          example: 123
          description: Total number of items
        page_info:
          type: object
          example:
            total_count: 123
            current_page: 1
            total_pages: 7
            page_size: 20
          required:
            - total_count
            - current_page
            - total_pages
            - page_size
          properties:
            total_count:
              type: integer
              example: 123
              description: Total number of items (same as count)
            current_page:
              type: integer
              example: 1
              description: Current page number (1-indexed)
            total_pages:
              type: integer
              example: 7
              description: Total number of pages
            page_size:
              type: integer
              example: 20
              description: Number of items per page
        results:
          type: array
          items:
            $ref: '#/components/schemas/JournalEntryList'
    ValidationErrorResponse:
      type: object
      description: Validation error response with field-specific errors
      properties:
        error_code:
          type: string
          description: Error code (e.g., 'validation_error')
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Contains field_errors and additional context
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - detail
        - error_code
        - message
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error_code:
          type: string
          description: Error code for programmatic handling
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Additional error details including field_errors and debug info
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - error_code
        - message
    JournalEntryList:
      type: object
      description: Serializer for listing journal entries with totals.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique journal entry identifier
        sequence_number:
          type: string
          readOnly: true
          description: Sequential journal entry number (e.g., 'JE-2024-0042')
        entry_date:
          type: string
          format: date
          readOnly: true
          description: Date of the journal entry (YYYY-MM-DD)
        reference:
          type: string
          readOnly: true
          description: Journal entry reference number or source document reference
        description:
          type: string
          readOnly: true
          description: Journal entry description
        currency:
          type: string
          description: Entry currency from business base currency (GBP, EUR, USD)
          readOnly: true
        total_debit:
          type: integer
          description: Total debit amount in cents (sum of all debit lines)
          readOnly: true
        total_credit:
          type: integer
          description: Total credit amount in cents (sum of all credit lines)
          readOnly: true
        is_balanced:
          type: boolean
          readOnly: true
          description: Whether debits equal credits (balanced entry required for posting)
        created_by:
          enum:
            - ai
            - manual
            - system
            - import
          type: string
          x-spec-enum-id: 6007642db49bb795
          readOnly: true
          description: |-
            Creator type: ai, manual, system, import

            * `ai` - AI System
            * `manual` - Manual Entry
            * `system` - System Generated
            * `import` - Data Import
        created_by_display:
          type: string
          description: Human-readable creator type
          readOnly: true
        status:
          enum:
            - draft
            - approved
            - rejected
          type: string
          x-spec-enum-id: 497c72e056439a37
          readOnly: true
          description: |-
            Entry status: draft, approved, rejected

            * `draft` - Draft
            * `approved` - Approved
            * `rejected` - Rejected
        status_display:
          type: string
          description: Human-readable status
          readOnly: true
        is_posted:
          type: boolean
          readOnly: true
          description: Whether entry is posted to ledger (affects account balances)
        posted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Timestamp when entry was posted to ledger (null if not posted)
        bank_transaction_id:
          type: string
          nullable: true
          description: Linked bank transaction UUID (null if not from bank feed)
          readOnly: true
        source_type:
          type: string
          nullable: true
          description: >-
            Source document type (invoice, bill, payment, bank_transaction,
            etc.)
          readOnly: true
        source_reference:
          type: string
          nullable: true
          description: Source document reference number
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when entry was created
      required:
        - bank_transaction_id
        - created_at
        - created_by
        - created_by_display
        - currency
        - description
        - entry_date
        - id
        - is_balanced
        - is_posted
        - posted_at
        - reference
        - sequence_number
        - source_reference
        - source_type
        - status
        - status_display
        - total_credit
        - total_debit
  securitySchemes:
    PartnerJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner-level JWT token (unscoped). Token payload includes `partner_id`.
        Business access is validated via partner ownership. Format: `Bearer
        <your-jwt-token>`


        **Use this for**: Multi-business operations where the business_id is
        specified in the URL and partner has access to multiple businesses.
    BusinessScopedJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT token. Token payload includes `business_id` to
        automatically scope requests. Format: `Bearer <your-jwt-token>`


        **Use this for**: Business-specific operations where the business
        context is embedded in the token.
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication for OAuth2 token endpoint. Use partner_uuid:api_key
        as username:password. Example: Authorization: Basic
        base64(partner_uuid:api_key)
    BearerUnscoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner (unscoped) JWT Bearer token. Obtain via POST
        /v1/platform/oauth2/token with Basic auth (partner_uuid:api_key). Use
        header: Authorization: Bearer {access_token}
    BearerBusinessScoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT Bearer token. Obtain via POST
        /v1/platform/{business_id}/oauth2/token/ using a partner Bearer token.
        Only valid for endpoints whose URL contains that business_id.

````