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

# Tariff data for user

> Returns general data of a single tariff for the user.



## OpenAPI

````yaml get /v1.0.0/users/{userId}/tariffs/{tariffId}
openapi: 3.0.1
info:
  description: A service used for smart energy players
  title: smart-energy-service
  version: 1.0.0
servers:
  - description: Generated server url
    url: https://api.energy-hub.io
security: []
paths:
  /v1.0.0/users/{userId}/tariffs/{tariffId}:
    get:
      tags:
        - User Tariff Controller
      summary: Tariff data for user
      description: Returns general data of a single tariff for the user.
      operationId: getTariffByUserIdAndTariffUuid
      parameters:
        - schema:
            type: string
          in: path
          name: userId
          description: User ID
          required: true
        - schema:
            format: uuid
            type: string
          in: path
          name: tariffId
          description: Tariff ID
          required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TariffResponse'
        '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:
                TARIFF_NOT_FOUND:
                  $ref: '#/components/examples/TARIFF_NOT_FOUND'
      security:
        - API_Key: []
components:
  schemas:
    TariffResponse:
      description: Object of tariff response.
      type: object
      required:
        - id
        - isOnline
        - staticData
        - userId
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of any variable of the tariff.
          type: string
        locationId:
          format: uuid
          description: The location ID of the tariff.
          type: string
          example: 7364fc92-20e1-4033-ac18-cb19c35e97e0
        isOnline:
          description: Indicates if the tariff is reachable trough the vendor system.
          type: boolean
          example: true
        id:
          format: uuid
          description: The ID of the tariff.
          type: string
          example: 6eb5497d-c6bb-4290-84ef-4409fe9501f1
        userId:
          description: The ID of the user.
          type: string
          example: 896f9d5a-b618-48a2-98ae-957059bf1bc9
        staticData:
          $ref: '#/components/schemas/StaticData'
    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
    StaticData:
      description: Object of static data of a tariff.
      type: object
      required:
        - countryCode
        - currency
        - name
        - vendor
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of any variable of the tariff.
          type: string
        vendor:
          description: The vendor of the tariff.
          type: string
          enum:
            - TIBBER
            - OSTROM
            - OCTOPUS_ENERGY
            - LUOX
        countryCode:
          description: The country of the tariff in ISO 3166-1 alpha-2 format.
          type: string
          example: DE
        name:
          description: The name of the tariff.
          type: string
          example: Tibber Bürgerfelder Str.
        currency:
          description: The currency of tariff prices and costs.
          type: string
          example: EUR
  examples:
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: 1068eb9d-7814-491b-8219-25bad554bef7
        message: Unauthorized
    TARIFF_NOT_FOUND:
      value:
        errorCode: TARIFF_NOT_FOUND
        id: 1068eb9d-7814-491b-8219-25bad554bef7
        message: '[TARIFF] Tariff not found.'
  securitySchemes:
    API_Key:
      in: header
      name: X-API-KEY
      description: API key used for authorization and authentication.
      type: apiKey

````