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

# Search transactions

> Use this endpoint to search transactions within a reconciliation context. Supports free-text search, amount range filters, date filters, and status filters with offset-based pagination.



## OpenAPI

````yaml /en/openapi/v3-current/matcher.yaml get /v1/imports/contexts/{contextId}/transactions/search
openapi: 3.1.0
info:
  title: Matcher APIs
  description: >-
    Complete API reference for the Matcher reconciliation engine, providing
    automated transaction matching between Midaz Ledger and external systems.
  version: v2.1.1
  license:
    name: Elastic License 2.0
    url: https://www.elastic.co/licensing/elastic-license
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/imports/contexts/{contextId}/transactions/search:
    get:
      tags:
        - Ingestion
      summary: Search transactions
      description: >-
        Use this endpoint to search transactions within a reconciliation
        context. Supports free-text search, amount range filters, date filters,
        and status filters with offset-based pagination.
      operationId: searchTransactions
      parameters:
        - description: A unique identifier for tracing the request across services.
          in: header
          name: X-Request-Id
          schema:
            type: string
        - description: The unique identifier of the reconciliation context.
          in: path
          name: contextId
          required: true
          schema:
            type: string
        - description: Free-text search query
          in: query
          name: q
          schema:
            type: string
        - description: Minimum transaction amount
          in: query
          name: amount_min
          schema:
            type: string
        - description: Maximum transaction amount
          in: query
          name: amount_max
          schema:
            type: string
        - description: Start date filter (RFC 3339 format)
          in: query
          name: date_from
          schema:
            type: string
            format: date-time
        - description: End date filter (RFC 3339 format)
          in: query
          name: date_to
          schema:
            type: string
            format: date-time
        - description: Transaction reference (exact match)
          in: query
          name: reference
          schema:
            type: string
        - description: Currency code filter
          in: query
          name: currency
          schema:
            type: string
        - description: Source ID filter
          in: query
          name: source_id
          schema:
            type: string
        - description: Transaction status filter
          in: query
          name: status
          schema:
            type: string
            enum:
              - UNMATCHED
              - MATCHED
              - IGNORED
              - PENDING_REVIEW
        - description: The maximum number of items to include in the response.
          in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
        - description: The number of items to skip before returning results.
          in: query
          name: offset
          schema:
            type: integer
            minimum: 0
            default: 0
      responses:
        '200':
          description: Search results with offset pagination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchTransactionsResponse'
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The request lacks valid authentication credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    SearchTransactionsResponse:
      description: Search results for transactions with offset pagination
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TransactionResponse'
        total:
          type: integer
          format: int64
          description: Total number of matching transactions
        limit:
          type: integer
          description: Maximum items per page
          example: 20
        offset:
          type: integer
          description: Number of items skipped
          example: 0
    ErrorResponse:
      description: Standard error response returned by all API endpoints
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: HTTP status code as a string.
          example: '404'
        title:
          type: string
          description: Error type identifier.
          example: not_found
        message:
          type: string
          description: Human-readable error message with details.
          example: context not found
        error:
          type: string
          description: Deprecated. Error message for backward compatibility.
          deprecated: true
        details:
          description: Additional error context as key-value pairs
          additionalProperties: {}
          type: object
    TransactionResponse:
      description: Transaction details
      properties:
        amount:
          description: Transaction amount as string
          example: '1000.50'
          type: string
        contextId:
          description: Context ID this transaction belongs to
          example: 019c96a0-10a0-72d2-9fb0-2b7de8093182
          type: string
        createdAt:
          description: Creation timestamp in RFC3339 format
          example: '2025-01-15T10:30:00.000Z'
          type: string
        currency:
          description: Currency code
          example: BRL
          type: string
        date:
          description: Transaction date in RFC3339 format
          example: '2025-01-15T00:00:00.000Z'
          type: string
        description:
          description: Description of the transaction
          example: Wire transfer from ABC Corp
          type: string
        externalId:
          description: External identifier from the source system
          example: TXN-12345
          type: string
        extractionStatus:
          description: Extraction status
          enum:
            - PENDING
            - EXTRACTED
            - FAILED
          example: EXTRACTED
          type: string
        id:
          description: Unique identifier for the transaction
          example: 019c96a0-10ce-75fc-a273-dc799079a99c
          type: string
        jobId:
          description: Job ID that ingested this transaction
          example: 019c96a0-10ce-75fc-a273-dc799079a99c
          type: string
        sourceId:
          description: Source ID this transaction belongs to
          example: 019c96a0-108c-7a74-8e31-3789daffe1ed
          type: string
        status:
          description: Current matching status
          enum:
            - PENDING
            - MATCHED
            - UNMATCHED
          example: PENDING
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'

````