Skip to main content
After the customer completes the Connect flow, Flatpeak starts to continuously synchronise their tariff data. If any action is needed, Flatpeak sends events via webhooks to your backend so you can prompt the customer to take corrective steps.

Event types you must handle

Subscribe to these three events:
EventDescription
tariff.expiredEmitted when a tariff reaches its end date or becomes invalid. Direct the customer to the Tariff settings page to set their current tariff.
tariff.fetch.failedEmitted after repeated failures to retrieve tariff data from the provider, for example when credentials are invalid or expired. Direct the customer to the Tariff settings page to reconnect their tariff.
tariff.connection.upgradeEmitted when a higher quality connection becomes available for the provider, typically DIRECT. Direct the customer to the Tariff settings page to upgrade their tariff connection.
location.updateEmitted when any data at a location changes, for example prices. Re fetch energy prices or recreate schedules as required by your use case.
connect_session.completeEmitted when Connect session creates a locaiton ID
Example webhook payloads:
{
  "id": "evt_6966d693e8d7beb3558bc54a",
  "object": "event",
  "type": "tariff.expired",
  "data": {
    "live_mode": true,
    "location_id": "loc_69661c764a5497be3666d0f6",
    "tariff_id": "trf_69665bd289b104fb993db999",
    "account_id": "acc_67ff7e8e2e5c80a54972fc75"
  }
}
Your systems can continue to access energy prices after the webhooks trigger. Flatpeak forecasts and extrapolates tariff data until the customer re establishes the tariff connection.
To subscribe, go to Dashboard > Webhooks page.

When your backend receives tariff.* events:

  1. Process the webhook payload — parse the event and extract location_id
  2. Prompt customer action — notify the user (in-app or by email) with a deep link to the Tariff Settings Page, asking them to update their tariff connection
{
  "id": "evt_66167787c1652b3fbeba5f01",
  "object": "event",
  "type": "tariff.expired"
  "data": {
    "location_id": "loc_661677cdc31d91695fd8f33d",
    "tariff_id": "trf_6597ef46529ab4467502af0b",
    "<truncated for shortness>"
  },
  "time_created": "2024-02-01T11:25:39Z"
}

When your backend receives location.update events:

  1. Process the webhook payload — parse the event and extract location_id
  2. [Re-fetch energy prices or recreate schedules](/guides/schedule) - as needed for your use case
{
  "id": "evt_66167787c1652b3fbeba5f01",
  "object": "event",
  "type": "location.update"
    "data": {
    "id": "loc_641b90b758fb8e6293716e40",
    "object": "location",
    "<truncated for shortness>"
  },
  "time_created": "2024-02-01T11:25:39Z"
}