Enable users to quickly add, view, and manage their energy tariff connections within your app.
Depending on their energy market structure and choices, customers may have contracts with multiple energy providers simultaneously. For instance, they might buy electricity from Company A while also paying Company B for the delivery of that electricity to their home.

Tariff type + direction

FlatPeak supports three tariff configurations (type and direction):
Type/DirectionDescription
COMMODITY+IMPORTCost of the electricity consumed. Essential to enable this—it’s foundational across all markets.
NON_COMMODITY+IMPORTDelivery costs (e.g., grid fees). Recommended if your users’ location separates out delivery charges.
COMMODITY+EXPORTPrice for exported electricity. Use this if your users have solar panels or energy storage.

Set Direction & Type in Connect

When you create a Connect token, specify tariff direction and type:
Example request
curl --request POST \
  --url https://api.flatpeak.com/connect/tariff/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "COMMODITY",
  "direction": "IMPORT"
}'

Default vs Extended Settings Page

You can choose to implement a simple or advanced tariff settings page, depending on your use case.

1. Default: Only IMPORT (most common)

Provide a single Connect button that initiates:
  • COMMODITY + IMPORT
This is the minimum required setup to support cost reporting and scheduling based on energy consumed from the grid.

2. Extended: IMPORT + EXPORT (with optional grid fees)

Offer controls for the following flows:
  • COMMODITY + IMPORT — required for consumption tracking
  • COMMODITY + EXPORT — recommended if the user has solar or storage
  • NON_COMMODITY + IMPORT — optional; add if your users are in a region with separated grid fees
Use separate buttons or toggles to let customers manage each tariff flow (IMPORT, EXPORT, NON_COMMODITY) independently. See the example UI at the top of this page for reference.

Handling already-connected tariffs

To render the settings UI showing current tariff status:
  • Call the location-status API each time the settings page needs to be displayed.
  • This ensures your UI reflects up-to-date connection info and avoids showing stale data.

Disconnecting without UI

If you want to remove a tariff programmatically:
1

Create a Connect token

Create a Connect token with the location_id where the tariff should be disconnected.
curl --request POST \
  --url https://api.flatpeak.com/connect/tariff/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "COMMODITY",
  "direction": "IMPORT",
  "location_id": "loc_641b90b758fb8e6293716e40",
  "callback_uri": "<any service that can receive webhooks>",
}'
2

Call Connect without launching UI

Call Connect’s summary_fixed_confirm route and send DISCONNECT action:
curl --request POST \
  --url https://connect.flatpeak.com \
  --header 'Content-Type: application/json' \
  --data '{
  "connect_token": "cot_6587fa4362341be5b524de3b",
  "route": "summary_fixed_confirm",
  "action": "DISCONNECT"
}'