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

# List batteries from vendor

> Returns connected batteries for the vendor account directly from vendor system.



## OpenAPI

````yaml get /v1.0.0/link/users/{userId}/vendor-accounts/{vendorAccountId}/batteries
openapi: 3.0.1
info:
  description: A service used for battery and pv inverter devices
  title: home-power-service
  version: 1.0.0
servers:
  - description: Generated server url
    url: https://api.energy-hub.io
security: []
paths:
  /v1.0.0/link/users/{userId}/vendor-accounts/{vendorAccountId}/batteries:
    get:
      tags:
        - Home Power Link Controller
      summary: List batteries from vendor
      description: >-
        Returns connected batteries for the vendor account directly from vendor
        system.
      operationId: getAllBatteriesFromVendor
      parameters:
        - schema:
            type: string
          in: path
          name: userId
          description: User ID
          required: true
        - schema:
            format: uuid
            type: string
          in: path
          name: vendorAccountId
          description: Vendor account ID
          required: true
        - schema:
            format: int32
            type: integer
            minimum: 0
          in: query
          name: page
          description: Zero-based page index (0..N)
          required: true
          example: 0
        - schema:
            format: int32
            maximum: 100
            type: integer
            minimum: 1
          in: query
          name: size
          description: >-
            The size of the page to be returned. Default value is 10. Maximum
            value is 100.
          required: true
          example: 10
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageResponseBatteryLinkDto'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorMessageDto'
              examples:
                BAD_REQUEST:
                  $ref: '#/components/examples/BAD_REQUEST'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                UNAUTHORIZED:
                  $ref: '#/components/examples/UNAUTHORIZED'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                VENDOR_ACCOUNT_NOT_FOUND:
                  $ref: '#/components/examples/VENDOR_ACCOUNT_NOT_FOUND'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                VENDOR_ACCOUNT_IS_DISCONNECTED:
                  $ref: '#/components/examples/VENDOR_ACCOUNT_IS_DISCONNECTED'
                VENDOR_COMMUNICATION_ERROR:
                  $ref: '#/components/examples/VENDOR_COMMUNICATION_ERROR'
                VENDOR_AUTHENTICATION_ERROR:
                  $ref: '#/components/examples/VENDOR_AUTHENTICATION_ERROR'
                VENDOR_CONNECTION_ERROR:
                  $ref: '#/components/examples/VENDOR_CONNECTION_ERROR'
      security:
        - API_Key: []
components:
  schemas:
    PageResponseBatteryLinkDto:
      type: object
      required:
        - content
        - totalElements
        - totalPages
      properties:
        totalPages:
          format: int64
          description: Total number of pages.
          type: integer
          example: 1
        content:
          description: >-
            Elements in the page. If there is no elements the list will be
            empty.
          type: array
          items:
            $ref: '#/components/schemas/BatteryLinkDto'
        totalElements:
          format: int64
          description: Total number of elements.
          type: integer
          example: 1
    ValidationErrorMessageDto:
      allOf:
        - $ref: '#/components/schemas/ErrorMessageDto'
        - type: object
          properties:
            errorCode:
              description: The error code
              type: string
              example: EXAMPLE_ERROR_CODE
            validationErrors:
              description: List of validation errors
              type: array
              items:
                $ref: '#/components/schemas/ValidationError'
            id:
              format: uuid
              description: The error identifier
              type: string
              example: 7958818d-64d2-4ede-b12b-4786dd2f348b
            message:
              description: The error message
              type: string
              example: Example error message
      type: object
      required:
        - errorCode
        - id
        - message
    ErrorMessageDto:
      type: object
      required:
        - errorCode
        - id
        - message
      properties:
        errorCode:
          description: The error code
          type: string
          example: EXAMPLE_ERROR_CODE
        id:
          format: uuid
          description: The error identifier
          type: string
          example: 7958818d-64d2-4ede-b12b-4786dd2f348b
        message:
          description: The error message
          type: string
          example: Example error message
    BatteryLinkDto:
      description: Object of battery for linking process.
      type: object
      required:
        - externalId
        - id
        - isLinked
        - name
        - vendor
      properties:
        isLinked:
          description: Indicates if the battery is linked to the Energy Hub.
          type: boolean
        vendor:
          description: The vendor of the battery.
          type: string
          enum:
            - FRONIUS
            - TESLA
            - HUAWEI
            - SMA
        name:
          description: The display name of the battery.
          type: string
          example: My battery
        externalId:
          description: The ID of the battery in external vendor system.
          type: string
          example: '8413731391660801'
        siteName:
          description: The site name of the home energy device.
          type: string
          example: My Home
        id:
          format: uuid
          description: The ID of the battery.
          type: string
    ValidationError:
      type: object
      properties:
        field:
          description: Affected field
          type: string
        message:
          description: Validation message
          type: string
  examples:
    BAD_REQUEST:
      value:
        errorCode: BAD_REQUEST
        validationErrors:
          - field: Affected field
            message: Validation message
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: Bad request
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: Unauthorized
    VENDOR_ACCOUNT_NOT_FOUND:
      value:
        errorCode: VENDOR_ACCOUNT_NOT_FOUND
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: '[VENDOR_ACCOUNT] Requested vendor account is not found.'
    VENDOR_ACCOUNT_IS_DISCONNECTED:
      value:
        errorCode: VENDOR_ACCOUNT_IS_DISCONNECTED
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: '[VENDOR_ACCOUNT] Vendor account is disconnected'
    VENDOR_COMMUNICATION_ERROR:
      value:
        errorCode: VENDOR_COMMUNICATION_ERROR
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: '[VENDOR API] Communication error with Vendor API'
    VENDOR_AUTHENTICATION_ERROR:
      value:
        errorCode: VENDOR_AUTHENTICATION_ERROR
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: '[VENDOR API] Authentication error with Vendor API'
    VENDOR_CONNECTION_ERROR:
      value:
        errorCode: VENDOR_CONNECTION_ERROR
        id: 57da008b-bd4d-442e-b8f8-584cb9058e29
        message: '[VENDOR API] Connection cannot be established with Vendor API'
  securitySchemes:
    API_Key:
      in: header
      name: X-API-KEY
      description: API key used for authorization and authentication.
      type: apiKey

````