Skip to main content

Overview

If you already have customer addresses but the tariff data is missing, you can automatically assign market tariffs without requiring manual action. This allows your customers to immediately benefit from energy price data in your system, while still encouraging them to connect their actual tariff later via Connect for improved price accuracy.

Implementation

1

Create a Location

Before creating tariffs, you must first create a Location using the location-create endpoint. The response will return a Flatpeak Location ID, which you must permanently store in your system.
ParameterDescription
reference_idA reference that is meaningful to you, for example, an ID from your system.
postal_addressPostal address of your customer or their equipment. If the exact address is unknown, use an approximate one. The address will be used to map the correct Market rates source.
customer_id(Optional) If your system supports multiple locations per customer, call create-customer first, then include the generated Customer ID using this field.
curl --request POST \
  --url https://api.flatpeak.com/locations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "reference_id": "LOC1234567890",
  "postal_address": {
    "address_line1": "1-3 Strand",
    "city": "London",
    "state": "Greater London",
    "post_code": "WC2N 5EH",
    "country_code": "GB"
  }
}'
2

Create a Tariff

Once you have a Location ID, create a Tariff by calling create-tariff endpoint. This will instruct Flatpeak systems to apply the market rates to the Location you created earlier.
Parameter.Description
location_idFlatpeak Location ID you created earlier
directionIMPORT
typeCOMMODITY
contract_start_dateSet to today’s date
contract_end_dateSet to a date far in the future (for example, 10 years from today)
market_ratesSet to true (important)
curl --request POST \
  --url https://api.flatpeak.com/tariffs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "direction": "IMPORT",
  "type": "COMMODITY",
  "contract_start_date": "2025-01-01T00:00:00Z",
  "contract_end_date": "2035-01-01T00:00:00Z",
  "market_rates": true
}'
The presence of market_rate_source_id in the response confirms that Flatpeak successfully mapped a market rates data source.For more details, see the Market Rates Coverage guide.
You are all set. To retrieve energy prices, follow the Retrieve energy price guide. Skip the app integration section and go straight to Getting the data, which applies to this use case.