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

# Migrate to Flatpeak

> Give existing users prices without a Connect flow: import tariffs, or assign a market tariff by address.

Existing users can get prices before they open Connect. Create the user, location and device as in the [Quickstart](/docs/energy-api/guides/quickstart.md), then create the tariff yourself.

## Import tariffs you hold

[Create a tariff](/docs/energy-api/reference/tariffs/create.md) with the `location_id`, and every device at the location prices against it. For a tariff that prices one device only, also pass its `device_id`. See [device tariffs](/docs/energy-api/guides/key-concepts.md#device-tariffs).

The tariff schedule supports market-based pricing, transmission fees, consumption tiers, seasonal rates and special day overrides.

## Assign a market tariff by address

If you hold addresses but no tariff data, assign a market tariff. Users get prices at once, and you can ask them to connect their own tariff in Connect for accurate prices.

1. Create the location with a complete, correct `postal_address`. Flatpeak resolves the market index from it.
2. Create a tariff with the user's `supplier_id` and contract dates. The supplier is the retailer that bills the user; the index supplies only the wholesale part of the rate.
3. In the rate, set the `index` variable to `AUTO_WHOLESALE`. To choose the index yourself, pass its code, such as `NORDPOOL_DK`. See [market coverage](https://flatpeak.com/coverage).

```json Request body (truncated) theme={"system"}
{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "supplier_id": "sup_63a6087272921ef075a8fd3e",
  "tariff_type": "COMMODITY",
  "direction": "IMPORT",
  "contract_start_date": "2026-01-24T00:00:00Z",
  "contract_end_date": "2027-01-24T00:00:00Z",
  "schedule": [
    {
      "months": ["All"],
      "dates": [],
      "days_and_hours": [
        {
          "days": ["All"],
          "hours": [
            {
              "valid_from": "00:00:00",
              "valid_to": "00:00:00",
              "rate": {
                "vat_included": "UNKNOWN",
                "variables": { "index": "AUTO_WHOLESALE" },
                "expression": "$index"
              }
            }
          ]
        }
      ]
    }
  ]
}
```

Check the response:

| Response | Meaning |
| :- | :- |
| `connection_type` is `MARKET` | Flatpeak mapped an index. The `index` variable in the returned schedule shows which, such as `NORDPOOL_DK` for a Danish address |
| Any other `connection_type` | No index could be mapped for the address |
| An error | The address is incorrect |

## Export your data

You own the data you store in Flatpeak, as the [DPA](https://flatpeak.com/legal/data-processing-agreement) sets out. Export it with the list endpoints: [users](/docs/energy-api/reference/users/list.md), [locations](/docs/energy-api/reference/locations/list.md), [devices](/docs/energy-api/reference/devices/list.md) and [tariffs](/docs/energy-api/reference/tariffs/list.md). For help, contact [support](https://console.flatpeak.com/support).


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