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

# Calculate Imbalance

> Calculate energy imbalance for a clearing period.

Compares the scheduled values (from submitted schedules) against the actual metering values (from MSCONS messages) for each day of the clearing period. The imbalance cost uses the reBAP price (Regelenergiebilanzausgleichspreis) received via PRICAT from the TSO.

Returns total scheduled/actual MWh, total imbalance MWh and cost EUR, and a per-day breakdown.



## OpenAPI

````yaml /openapi.json get /schedule-management/v1/mabis/clearing-periods/{uid}/imbalance
openapi: 3.1.0
info:
  title: Engrate API
  version: 1.0.0
servers:
  - url: https://api.engrate.io
security:
  - apiKeyAuth: []
paths:
  /schedule-management/v1/mabis/clearing-periods/{uid}/imbalance:
    get:
      tags:
        - mabis
      summary: Calculate Imbalance
      description: >-
        Calculate energy imbalance for a clearing period.


        Compares the scheduled values (from submitted schedules) against the
        actual metering values (from MSCONS messages) for each day of the
        clearing period. The imbalance cost uses the reBAP price
        (Regelenergiebilanzausgleichspreis) received via PRICAT from the TSO.


        Returns total scheduled/actual MWh, total imbalance MWh and cost EUR,
        and a per-day breakdown.
      operationId: >-
        calculate_imbalance_schedule_management_v1_mabis_clearing_periods__uid__imbalance_get
      parameters:
        - description: Clearing period unique identifier.
          in: path
          name: uid
          required: true
          schema:
            description: Clearing period unique identifier.
            format: uuid
            title: Uid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImbalanceResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ImbalanceResponse:
      description: >-
        Aggregated imbalance calculation for an entire clearing period, broken
        down by day.
      properties:
        clearing_period_uid:
          description: >-
            Parent [Clearing
            Period](/api-reference/settlement-management/models/clearing-period)
            identifier.
          title: Clearing Period Uid
          type: string
        daily_imbalances:
          description: Per-day imbalance breakdown.
          items:
            $ref: '#/components/schemas/DailyImbalance'
          title: Daily Imbalances
          type: array
        total_actual_mwh:
          description: Total actual energy across all days in MWh.
          examples:
            - 3732.5
          title: Total Actual Mwh
          type: number
        total_imbalance_cost_eur:
          description: Total imbalance cost in EUR based on reBAP control energy prices.
          examples:
            - 1875
          title: Total Imbalance Cost Eur
          type: number
        total_imbalance_mwh:
          description: Total net imbalance across all days in MWh.
          examples:
            - 12.5
          title: Total Imbalance Mwh
          type: number
        total_scheduled_mwh:
          description: Total scheduled energy across all days in MWh.
          examples:
            - 3720
          title: Total Scheduled Mwh
          type: number
      required:
        - clearing_period_uid
        - daily_imbalances
        - total_actual_mwh
        - total_imbalance_cost_eur
        - total_imbalance_mwh
        - total_scheduled_mwh
      title: ImbalanceResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DailyImbalance:
      description: Imbalance summary for a single day within a clearing period.
      properties:
        actual_mwh:
          description: Total actual (metered) energy for this day in MWh.
          examples:
            - 125.5
          title: Actual Mwh
          type: number
        date:
          description: Settlement date in ISO 8601 format.
          examples:
            - '2026-01-15'
          title: Date
          type: string
        imbalance_mwh:
          description: Imbalance (actual minus scheduled) in MWh.
          examples:
            - 5.5
          title: Imbalance Mwh
          type: number
        scheduled_mwh:
          description: Total scheduled energy for this day in MWh.
          examples:
            - 120
          title: Scheduled Mwh
          type: number
      required:
        - actual_mwh
        - date
        - imbalance_mwh
        - scheduled_mwh
      title: DailyImbalance
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    apiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````