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.expiredTriggered when a tariff reaches its end date or becomes invalid.
tariff.fetch.failedTriggered after several failed attempts to retrieve tariff data from the provider, for example when credentials are invalid or have expired.
location.updateTriggered when any data (for example, prices) at a location change. When this occurs, re-fetch energy prices or recreate schedules as needed for your use case.
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",
    "<turncated for shortness>"
  },
  "time_created": "2024-02-01T11:25:39Z"
}

When your backend receives locaiton.update events:

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