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

# Tariffs

> Who creates tariffs, how a tariff gates enrollment, and how to create location and device tariffs.

A tariff prices energy at a location, and costs, instruction costs and earnings estimates all resolve through it. A device cannot enroll until its location has a connected tariff.

## Who creates tariffs

Flatpeak records at onboarding whether your account supplies energy. Contact Flatpeak to change it.

| Your account | Tariffs |
| :- | :- |
| Supplies energy | You create them with [create a tariff](/docs/fleet-api/reference/tariffs/create.md), at the device's `location_id`. They carry your supplier. Required for [managed tariffs](/docs/fleet-api/guides/programs.md) |
| Does not supply energy | The customer connects their tariff in Connect, and a create call returns `403`. Read tariffs with [list all tariffs](/docs/fleet-api/reference/tariffs/list.md) |

## Tariffs and enrollment

An enrollment waits in `PENDING`, at step `AWAITING_TARIFF`, until the location has two `COMMODITY` tariffs, one `IMPORT` and one `EXPORT`. Connect asks the customer to connect them. If you supply energy, create both when `vpp_enrollment.update` reports that step. `NON_COMMODITY` tariffs, for other charges, are optional.

## Location or device

| Tariff | Prices | Pass |
| :- | :- | :- |
| Location tariff | Every device at the location, including devices added later | `location_id` |
| Device tariff | One device, while it is at that location | `location_id` and `device_id` |

A device tariff replaces the location tariff of the same `tariff_type` and `direction` for that device; the two are never combined. Use one when the supply prices a device separately, such as an EV charger on a reduced rate, or for a managed tariff.

When the device moves, its device tariff stays with the location and stops applying. Deleting the device deletes its device tariffs. In Connect, a tariff the customer connects for one device becomes a device tariff.

## Create a tariff

```json Request body theme={"system"}
{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "tariff_type": "COMMODITY",
  "direction": "IMPORT",
  "display_name": "Two-rate home tariff",
  "contract_start_date": "2026-07-01T00:00:00Z",
  "contract_end_date": "2027-06-30T23:59:59Z",
  "schedule": [
    {
      "months": ["All"],
      "dates": [],
      "days_and_hours": [
        {
          "days": ["All"],
          "hours": [
            {
              "valid_from": "00:00:00",
              "valid_to": "07:00:00",
              "rate": { "vat_included": "YES", "vat_percentage": 0.05, "variables": { "price": 0.12 }, "expression": "$price" }
            },
            {
              "valid_from": "07:00:00",
              "valid_to": "00:00:00",
              "rate": { "vat_included": "YES", "vat_percentage": 0.05, "variables": { "price": 0.29 }, "expression": "$price" }
            }
          ]
        }
      ]
    }
  ]
}
```

* `schedule` is a list of plans, each scoped by `months`, `dates` and `days_and_hours`. Use `"All"` and `[]` where the price does not vary.
* Times are local to the location. Prices are in major currency units.
* Flatpeak prices only between `contract_start_date` and `contract_end_date`.
* There is no update: create the replacement, then [delete](/docs/fleet-api/reference/tariffs/delete.md) the old tariff.

To track wholesale prices, put a market index in the rate:

```json Market-tracking rate theme={"system"}
{
  "vat_included": "YES",
  "vat_percentage": 0.12,
  "variables": { "index": "AUTO_WHOLESALE", "spread": 1.25, "fees": 2.10, "unit_scale": 0.01 },
  "expression": "(($index + $spread + $fees) * $unit_scale)"
}
```

`AUTO_WHOLESALE` resolves the market from the address; to pin a market, name its index. See [coverage](https://flatpeak.com/coverage).

## One address, several locations

A location belongs to the OEM account that registered the device, so a household with devices from two OEMs has two `location_id`s with the same address. Create the tariff at each location you serve, and match them on your own customer reference, or on `postal_address` where the customer granted `LOCATION`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.