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

# Get contract by id



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api get /contract/{contractId}
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/{contractId}:
    get:
      tags:
        - Contract
      summary: Get contract by id
      operationId: getContractById
      parameters:
        - name: contractId
          in: path
          required: true
          description: The id of the contract to retrieve
          schema:
            type: string
          example: '123'
        - name: includeRawData
          in: query
          required: false
          description: >-
            If set to true, then the raw response from the ERP system will be
            included
          schema:
            type: boolean
          example: false
        - name: refresh
          in: query
          required: false
          description: >-
            If set to true, then enneo will fetch the data from the underlying
            ERP system first
          schema:
            type: boolean
          example: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contract'
        '403':
          description: Unauthorized
        '404':
          description: Contract not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
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
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
  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

````