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

# Search for contracts



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api get /contract/search
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /contract/search:
    get:
      tags:
        - Contract
      summary: Search for contracts
      operationId: searchContracts
      parameters:
        - name: contractId
          in: query
          description: The ID of the contract, e.g. 829211
          required: false
          schema:
            type: string
        - name: customerId
          in: query
          description: The ID of the customer, e.g. 101020120
          required: false
          schema:
            type: string
        - name: firstname
          in: query
          description: The first name to search for, e.g. John
          required: false
          schema:
            type: string
        - name: lastname
          in: query
          description: The last name to search for, e.g. Smith
          required: false
          schema:
            type: string
        - name: fullname
          in: query
          description: The full name to search for, e.g. John Smith
          required: false
          schema:
            type: string
        - name: birthday
          in: query
          description: The birthday to search for, e.g. 1980-01-01
          required: false
          schema:
            type: string
        - name: company
          in: query
          description: The company to search for, e.g. enneo GmbH
          required: false
          schema:
            type: string
        - name: email
          in: query
          description: The email to search for, e.g. john@smith.com
          required: false
          schema:
            type: string
        - name: meterNumber
          in: query
          description: The meter number to search for, e.g. 1ESY1160669167
          required: false
          schema:
            type: string
        - name: address
          in: query
          description: >-
            The address to search for. Format is e.g. Eppendorfer Landstr. 32,
            20249 Hamburg
          required: false
          schema:
            type: string
        - name: postalCode
          in: query
          description: The postal code to search for, e.g. 20249
          required: false
          schema:
            type: string
        - name: city
          in: query
          description: The city to search for, e.g. Hamburg
          required: false
          schema:
            type: string
        - name: includeRawData
          in: query
          description: >-
            If yes, then the raw source data coming from the ERP is included in
            the response
          required: false
          example: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  description: >-
                    An array of the search results, sorted by similarity. The
                    best match is always first.
                  properties:
                    id:
                      type: integer
                    similarity:
                      type: number
                      description: >-
                        How well the contract fits to the search parameters.
                        Exact match on contractId always returns 1 (=100%)
                      format: float
                    contract:
                      $ref: '#/components/schemas/Contract'
        '400':
          description: Bad request
components:
  schemas:
    Contract:
      type: object
      description: >-
        A contract of a customer. Either electricity or gas. IDs match the
        backend system (powercloud)
      properties:
        id:
          type: integer
          example: 746839
        orderId:
          type: integer
          example: 123
        tenant:
          type: string
          description: >-
            If a customer has multiple tenants/brands, this is the tenant name.
            Currently only used for SAP
          nullable: true
          example: null
        customerId:
          type: string
          example: '123'
        signupDate:
          type: string
          format: date
          example: 1661126400
        status:
          type: string
          example: active
        statusCode:
          type: integer
          example: 5000
        statusCodeTitle:
          type: string
          example: active
        energy:
          type: string
          example: electricity
        energyTypeId:
          type: integer
          example: 1
        energySubTypeId:
          type: integer
          example: 1
        email:
          type: string
          example: johndoe@example.com
        firstname:
          type: string
          example: John
        lastname:
          type: string
          example: Doe
        deliveryAddress:
          type: string
          description: Address where the electricity/gas is being delivered to
          example: Hugo-Junkers-Str. 5, 82031 Grünwald
        iban:
          type: string
          example: DE89370400440532013000
          nullable: true
        monthlyDeposit:
          type: number
          format: integer
          example: 53
          nullable: true
        startDate:
          type: string
          format: date
          example: 1661990400
          nullable: true
        endDate:
          type: string
          example: null
          nullable: true
        consumption:
          type: integer
          example: 3477
          nullable: true
        counterNumber:
          type: string
          example: 1ESY1160669167
          nullable: true
        productId:
          type: integer
          example: 1
          nullable: true
        productName:
          type: string
          example: Flex 24
          nullable: true
        productCode:
          type: string
          example: flx_24
          nullable: true
        campaignId:
          type: integer
          example: 1
          nullable: true
        salesChannelId:
          type: integer
          example: 1
          nullable: true
        unpaidDebt:
          type: number
          format: float
          example: 109.21
          nullable: true
        vatRate:
          type: number
          format: float
          example: 0.09
          description: VAT Rate, usually 0.19 (=19%) for electricity and 0.07 (=7%) for gas
          nullable: true
        basePrice:
          type: number
          format: float
          example: 0.09
          nullable: true
        workingPrice:
          type: number
          format: float
          example: 0.09
          nullable: true
        billingAddress:
          type: string
          description: >-
            Address where written communication should be sent to. NULL if same
            as delivery address
          example: Rechnungssstraße 24, 10587 Berlin
          nullable: true
        business:
          type: boolean
          example: false
          nullable: true
        phone:
          type: string
          example: 491721041689
          nullable: true
        gridOperatorName:
          type: string
          example: E.ON Bayern AG
          nullable: true
        gridOperatorCode:
          type: string
          example: 1000000000000
          nullable: true
        registers:
          type: array
          items:
            type: object
          nullable: true
        erpUrls:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                example: https://erp-system.com/contract/123
              logo:
                type: string
                description: Logo the FE should show when processing an URL of this type
                enum:
                  - powercloud
                  - lynqtech
                  - sap
                example: powercloud
          nullable: true
        rawData:
          nullable: true
          type: object
          description: >-
            Raw source data from the originating ERP system in the
            ERP-proprietary format is included here. Only provided on request.
          additionalProperties: true
          example: null
        agentPreview:
          type: array
          description: Preview information shown to agents in the UI
          items:
            type: object
            properties:
              label:
                type: string
                description: Label text shown to the agent
                example: Tarif
              value:
                type: string
                description: Value text shown to the agent
                example: Flex 24
              tooltip:
                type: string
                nullable: true
                description: Optional tooltip shown on hover
                example: |-
                  AP: 28.5 ct/kWh
                  GP: 149.88 €/Jahr
              url:
                type: string
                nullable: true
                description: Optional URL that opens when clicking the preview item
                example: https://erp.example.com/contract/123
        tabPreview:
          type: object
          nullable: true
          description: Preview information shown in contract tabs
          properties:
            color:
              type: string
              enum:
                - blue
                - green
                - red
                - grey
                - yellow
                - purple
                - orange
                - teal
              description: Color indicator for contract status
              example: green
            icon:
              type: string
              enum:
                - electricity
                - gas
                - other
              description: Icon shown in the tab
              example: electricity
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````