---
title: "Update tariff"
method: PUT
path: "/tariffs/{tariffId}"
tags: ["Tariffs"]
---

# Update tariff

`PUT /tariffs/{tariffId}`

## Request

- Base URL: `https://connect.clever.gy`
- URL: `https://connect.clever.gy/tariffs/{tariffId}`
- Auth: API key in header `clevergy-api-key`

Updates a tariff and returns it

## Path parameters

- `tariffId` string, required

## Request body

- CreateTariff: Tariff
  - `internalName` string, required
  - `commercialName` string, required
  - `commercialDescription` string
  - `powerPrices` number[]
  - `energyPrices` number[]
  - `provider` string
  - `type` 'PVPC_2_0_TD' | 'MERCADO_LIBRE_2_0_TD_FIJA' | 'MERCADO_LIBRE_2_0_TD' | 'MERCADO_LIBRE_3_0_TD' | 'INDEXADA_2_0_TD' | 'MERCADO_LIBRE_6_1_TD' | 'OMIE_MARGEN', required
  - `solarPrice` number, float
  - `margin` number, float

## Response `200`

Tariff successfully updated.

- Tariff: Tariff
  - `id` string, required
  - `internalName` string, required
  - `commercialName` string, required
  - `commercialDescription` string
  - `powerPrices` number[]
  - `energyPrices` number[]
  - `provider` string
  - `type` 'PVPC_2_0_TD' | 'MERCADO_LIBRE_2_0_TD_FIJA' | 'MERCADO_LIBRE_2_0_TD' | 'MERCADO_LIBRE_3_0_TD' | 'INDEXADA_2_0_TD' | 'MERCADO_LIBRE_6_1_TD' | 'OMIE_MARGEN', required
  - `solarPrice` number, float
  - `margin` number, float

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `404`: Not found
- `default`: Unexpected error

---

[API](https://skmtc.dev/clevergy/apis/clevergy-connect-api.md) - [All operations](https://skmtc.dev/clevergy/apis/clevergy-connect-api/llms.txt) - [OpenAPI document](https://skmtc.dev/clevergy/apis/clevergy-connect-api/revisions/d333c5eecb5b?raw)
