This endpoint is updating. Previous version is in GA.

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 tariff direction and 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

Once the customer has completed a Connect flow, you will have a FlatPeak location_id stored in your systems. When you need to render the tariff settings page in your app, request the location object from the FlatPeak API. The response will include the tariff_status object, which enables you to build an informative page in your app.

Statuses explained:

StatusDescription
NOT_CONNECTEDTariff is not connected/added.
CONNECTEDTariff is connected/added and its status is healthy.
ERRORThere is an issue with the tariff that requires an intervention. For example, if FlatPeak cannot fetch tariff from your customer’s account with their provider or if it has expired.
NOT_SUPPORTEDTariff type/direction pair is unsupported and can not be connected. For example, when non_commodity rates do not apply to a location (i.e., supply address),
Your systems should query FlatPeak API to retrieve the location object every time you need to your tariff settings page. Otherwise, you are at risk of displaying out-of-date information.