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

# get battery estimated savings

> Estimates annual solar+battery savings for a home. Month inputs use calendar month numbers 1-12.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/homes/{id}/battery/estimate_savings
openapi: 3.0.0
info:
  title: WattShift API
  description: An API for the WattShift Service (https://wattshift.com/partners)
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/homes/{id}/battery/estimate_savings:
    post:
      tags:
        - homes
      summary: get battery estimated savings
      description: >-
        Estimates annual solar+battery savings for a home. Month inputs use
        calendar month numbers 1-12.
      operationId: estimateBatterySavings
      parameters:
        - name: x-ws-api-key
          in: header
          description: WattShift API Key
          schema:
            type: string
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatteryAnnualEstimatedSavingsRequestDto'
            example:
              days: 1
              solarCapacity: 5
              maxCapacityKiloWattHours: 13.5
              chargingPowerKiloWatts: 5
              dischargingPowerKiloWatts: 5
              chargingEfficiency: 0.95
              dischargingEfficiency: 0.95
              currentSOC: 0.5
              minPreferredSOC: 0.2
              maxPreferredSOC: 0.9
              months:
                - 1
                - 2
                - 3
                - 4
                - 5
                - 6
                - 7
                - 8
                - 9
                - 10
                - 11
                - 12
      responses:
        '400':
          description: Validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelopeDto'
              example:
                request_id: req_123
                error_code: VALIDATION_FAILED
                message: Request validation failed.
                field_errors:
                  - field: zipcode
                    message: zipcode is invalid
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelopeDto'
              example:
                request_id: req_123
                error_code: AUTH_MISSING_API_KEY
                message: Missing x-ws-api-key header.
                recovery_action: >-
                  Provide the x-ws-api-key header. If this contradicts the
                  public docs or OpenAPI contract, submit structured feedback
                  through /v1/feedback.
      security:
        - x-ws-api-key: []
        - x-ws-api-key: []
components:
  schemas:
    BatteryAnnualEstimatedSavingsRequestDto:
      type: object
      properties:
        days:
          type: number
        solarCapacity:
          type: number
          nullable: true
        maxCapacityKiloWattHours:
          type: number
        chargingPowerKiloWatts:
          type: number
        dischargingPowerKiloWatts:
          type: number
        chargingEfficiency:
          type: number
        dischargingEfficiency:
          type: number
        currentSOC:
          type: number
        minPreferredSOC:
          type: number
        maxPreferredSOC:
          type: number
        dispatchHoursPerDay:
          type: array
          items:
            type: array
            items:
              type: object
              properties:
                hour:
                  type: number
                price:
                  type: number
              required:
                - hour
                - price
          nullable: true
        numBiddingHours:
          type: number
          nullable: true
        leap:
          type: string
          enum:
            - CAISO
            - NYISO
          nullable: true
        months:
          description: >-
            Optional calendar months to include, using 1-12 month numbers. Omit
            or pass null for all months.
          type: array
          items:
            description: Calendar month number, 1-12 where 1 = January and 12 = December.
            type: integer
            minimum: 1
            exclusiveMinimum: false
            maximum: 12
            exclusiveMaximum: false
          nullable: true
      required:
        - days
        - solarCapacity
        - maxCapacityKiloWattHours
        - chargingPowerKiloWatts
        - dischargingPowerKiloWatts
        - chargingEfficiency
        - dischargingEfficiency
        - currentSOC
        - minPreferredSOC
        - maxPreferredSOC
    ApiErrorEnvelopeDto:
      type: object
      properties:
        request_id:
          type: string
          example: req_123
        error_code:
          type: string
          enum:
            - AUTH_MISSING_API_KEY
            - AUTH_INVALID_API_KEY
            - AUTH_EXPIRED_CREDENTIAL
            - AUTH_REVOKED_CREDENTIAL
            - AUTH_INSUFFICIENT_SCOPE
            - VALIDATION_FAILED
            - RATE_LIMITED
            - NOT_FOUND
            - FORBIDDEN
            - PRODUCTION_ACCESS_DENIED
            - INTERNAL_ERROR
          example: VALIDATION_FAILED
        message:
          type: string
          example: Request validation failed.
        recovery_action:
          type: string
          example: >-
            Provide the x-ws-api-key header. If this contradicts the public
            docs, submit feedback through /v1/feedback.
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiFieldErrorDto'
        retry_after_seconds:
          type: number
          example: 3600
      required:
        - request_id
        - error_code
        - message
    ApiFieldErrorDto:
      type: object
      properties:
        field:
          type: string
          example: zipcode
        message:
          type: string
          example: zipcode is invalid
      required:
        - message
  securitySchemes:
    x-ws-api-key:
      type: apiKey
      in: header
      name: x-ws-api-key
      description: WattShift API key

````