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

# Savings calculator

> Calculates savings for Basic PV, smart PV and No PV installations.



## OpenAPI

````yaml /api-reference/swagger-partner.json post /api/v2/savings-calculator
openapi: 3.0.4
info:
  title: Partner API
  description: API for partner services
  version: v1
servers:
  - url: https://api.partner.cubee.cz
    description: Partnerý API server
security: []
paths:
  /api/v2/savings-calculator:
    post:
      tags:
        - Calculator
      summary: Savings calculator
      description: Calculates savings for Basic PV, smart PV and No PV installations.
      operationId: Calculate Savings
      requestBody:
        description: Input model with all available parameters to set.
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/SavingCalculatorRequestModel'
          text/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/SavingCalculatorRequestModel'
          application/*+json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/SavingCalculatorRequestModel'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/SavingsCalculatorResultModel'
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsCalculatorResultModel'
            text/json:
              schema:
                $ref: '#/components/schemas/SavingsCalculatorResultModel'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                type: string
            application/json:
              schema:
                type: string
            text/json:
              schema:
                type: string
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    SavingCalculatorRequestModel:
      required:
        - battery
        - distribution
        - electricityBuyingSettings
        - periodType
        - totalKWp
      type: object
      properties:
        periodType:
          required:
            - 12M
            - '2024'
          type: string
          nullable: true
        yearlyConsumptionKWh:
          type: number
          format: float
        totalKWp:
          type: number
          format: float
        battery:
          $ref: '#/components/schemas/SavingCalculatorBatteryRequestModel'
        distribution:
          $ref: '#/components/schemas/SavingCaluclatorDistributionRequestModel'
        electricityBuyingSettings:
          oneOf:
            - $ref: '#/components/schemas/FixBuyingSettings'
            - $ref: '#/components/schemas/SpotBuyingSettings'
        electricitySellingSettings:
          oneOf:
            - $ref: '#/components/schemas/FixSellingSettings'
            - $ref: '#/components/schemas/SpotSellingSettings'
          nullable: true
        customProductionConsumptionData:
          type: array
          items:
            $ref: '#/components/schemas/CustomProductionConsumptionDataModel'
          nullable: true
      additionalProperties: false
    SavingsCalculatorResultModel:
      allOf:
        - $ref: '#/components/schemas/SavingsCalculatorResultBase'
        - type: object
          properties:
            months:
              type: array
              items:
                $ref: '#/components/schemas/SavingsCalculatorMonthlyResultModel'
              nullable: true
          additionalProperties: false
    SavingCalculatorBatteryRequestModel:
      required:
        - batterySizeKwh
        - reservedBatteryCapacityPercentage
      type: object
      properties:
        batterySizeKwh:
          type: number
          format: float
        reservedBatteryCapacityPercentage:
          maximum: 100
          minimum: 0
          type: integer
          format: int32
        maximumBatteryChargingPowerWatt:
          type: integer
          format: int32
          nullable: true
        maximumBatteryDischargingPowerWatt:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
    SavingCaluclatorDistributionRequestModel:
      required:
        - circuitBreakerMonthlyFee
        - distributionRate
        - distributor
        - distributorFeeHighPerMWh
        - lowTariffCommand
        - renewableEnergyFeePerMWh
        - systemServicesFeePerMWh
      type: object
      properties:
        distributor:
          minLength: 1
          type: string
        distributionRate:
          minLength: 1
          type: string
        lowTariffCommand:
          minLength: 1
          type: string
        distributorFeeHighPerMWh:
          type: number
          format: double
        distributorFeeLowPerMWh:
          type: number
          format: double
        renewableEnergyFeePerMWh:
          type: number
          format: double
        systemServicesFeePerMWh:
          type: number
          format: double
        circuitBreakerMonthlyFee:
          type: number
          format: double
      additionalProperties: false
    FixBuyingSettings:
      title: FixBuyingSettings
      required:
        - buyingType
        - monthlyFeeCzk
      allOf:
        - required:
            - fixedBuyPriceCzkPerMWh
          type: object
          properties:
            fixedBuyPriceCzkPerMWh:
              type: number
              format: double
            fixedBuyPriceCzkPerMwhInLowTariff:
              type: number
              format: double
          additionalProperties: false
      properties:
        buyingType:
          minLength: 1
          required:
            - FIX
            - SPOT
          type: string
        monthlyFeeCzk:
          type: number
          format: double
        vat:
          type: number
          format: double
          nullable: true
    SpotBuyingSettings:
      title: SpotBuyingSettings
      required:
        - buyingType
        - monthlyFeeCzk
      allOf:
        - required:
            - fee
            - feeType
            - spotPriceMinZero
          type: object
          properties:
            feeType:
              minLength: 1
              required:
                - Percentage
                - PerMWh
              type: string
            fee:
              type: number
              format: double
            spotPriceMinZero:
              type: boolean
          additionalProperties: false
      properties:
        buyingType:
          minLength: 1
          required:
            - FIX
            - SPOT
          type: string
        monthlyFeeCzk:
          type: number
          format: double
        vat:
          type: number
          format: double
          nullable: true
    FixSellingSettings:
      title: FixSellingSettings
      required:
        - monthlyFeeCzk
        - sellingType
      allOf:
        - required:
            - fixedSellPriceCzkPerMWh
          type: object
          properties:
            fixedSellPriceCzkPerMWh:
              type: number
              format: double
          additionalProperties: false
      properties:
        sellingType:
          minLength: 1
          required:
            - FIX
            - SPOT
          type: string
        monthlyFeeCzk:
          type: number
          format: double
    SpotSellingSettings:
      title: SpotSellingSettings
      required:
        - monthlyFeeCzk
        - sellingType
      allOf:
        - required:
            - fee
            - feeType
            - spotPriceMinZero
          type: object
          properties:
            feeType:
              minLength: 1
              required:
                - Percentage
                - PerMWh
              type: string
            fee:
              type: number
              format: double
            spotPriceMinZero:
              type: boolean
          additionalProperties: false
      properties:
        sellingType:
          minLength: 1
          required:
            - FIX
            - SPOT
          type: string
        monthlyFeeCzk:
          type: number
          format: double
    CustomProductionConsumptionDataModel:
      type: object
      properties:
        time:
          type: string
          format: date-time
        productionWh:
          type: integer
          format: int32
        consumptionWh:
          type: integer
          format: int32
      additionalProperties: false
    SavingsCalculatorResultBase:
      type: object
      properties:
        withoutPV:
          $ref: '#/components/schemas/EnergyDataSet'
        basicPV:
          $ref: '#/components/schemas/EnergyDataSet'
        smartPV:
          $ref: '#/components/schemas/EnergyDataSet'
        savingsComparedToBasicPV:
          type: number
          format: double
      additionalProperties: false
    SavingsCalculatorMonthlyResultModel:
      allOf:
        - $ref: '#/components/schemas/SavingsCalculatorResultBase'
        - type: object
          properties:
            month:
              type: string
              format: date
          additionalProperties: false
    EnergyDataSet:
      type: object
      properties:
        energyProducedKWh:
          type: number
          format: double
        energyConsumedKWh:
          type: number
          format: double
        energyPurchasedKWh:
          type: number
          format: double
        energySoldKWh:
          type: number
          format: double
        costOfPurchasedEnergy:
          type: number
          format: double
        revenueFromSoldEnergy:
          type: number
          format: double
        netEnergyCost:
          type: number
          format: double
          readOnly: true
        averagePurchasePricePerMWh:
          type: number
          format: double
          readOnly: true
        averageSellPricePerMWh:
          type: number
          format: double
          readOnly: true
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      scheme: bearer
      bearerFormat: JWT

````