Build a page in your app to enable customers to quickly add, check the status and manage their tariff connections.

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 paying Company B to transmit that electricity to their home.

Tariff direction and type

To enable any business case, FlatPeak supports four combinations of tariff type and energy transfer direction:

COMMODITY type represents contract to purchase “electrons”. NON_COMMODITY type represents the contract to pay for the transfer of those electrons from the power station to the customer’s home.
Type/DirectionDescription
COMMODITY+IMPORTThe price of the actual imported electricity. It’s essential always to allow your customers to add their commodity import tariff, as this is the most fundamental fee across all markets and regions.
NON_COMMODITY+IMPORTThe cost of transporting electricity, known as network or grid fees, may be charged separately in many markets. FlatPeak recommends allowing customers to add this tariff, as it affects their total energy cost.
COMMODITY+EXPORTThe price of exported electricity. You should offer this option if your solution includes energy storage or generation. FlatPeak separates import and export tariffs, as customers may use different providers.
NON_COMMODITY+EXPORTThe price of transporting electricity from the customer to the grid. FlatPeak disabled this feature as there are no known cases of export transmission fees.

Setting tariff direction and type in Connect

When you create a connect token, you provide the tariff direction and the tariff type you want this Connect session to work with:

Connect token request for COMMODITY+IMPORT
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 tariff settings page

You must choose what combination(s) or tariff types and directions you want to enable your customers to add. Your decision can be based on the type of your service and/or device(s) and where your customers are located.

The simplest option is to let your customers set only the COMMODITY+IMPORT combination. You can also let your customers set other combinations. See examples in the tabs below:

On click, start the Connect flow for COMMODITY+IMPORT flow.

Tariff settings page with existing tariff connections

To render the tariff settings page in your app, call the location-status API endpoint. The response provides all the data needed to build a settings page similar to the example at the top of this guide.

Your systems should query FlatPeak API to retrieve the location object every time you need to render your tariff settings page. Otherwise, you are at risk of displaying out-of-date information.

Disconnecting a tariff without launching Connect

Sometimes you may want to build a function in your app that will enable customers to disconnect the tariff without having to interact with Connect. For this:

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"
}'

You have now disconnected the IMPORT tariff from the Location.