---
title: "Create new tariff"
method: POST
path: "/tariffs"
tags: ["Tariffs"]
---

# Create new tariff

`POST /tariffs`

## Request

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

Creates a new tariff and returns it

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

- 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
- `409`: Conflict. Tariff already exists
- `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)
