This implementation also lets your customer reconfigure their tariff, let you know they switched energy providers or revoke tariff sharing consent and disable Connect.

You don’t need to implement any new features in your app. All you need to do is pass the location_id parameter when obtaining the Connect token:

1

Create a Connect token

You will be starting a new session with Connect, so you must create a new Connect token. Go to create-connect-token API endpoint and include the following parameters in your request:

  • Set location_id to where you want to display the tariff summary.

  • Set callback_uri to any page that can accept callbacks.

  • Set connect_web_uri to the URL where Connect-web is running (http://localhost:7070 in this example).

    curl --request POST \
    --url https://api.flatpeak.com/connect/tariff/token \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "location_id": "loc_641b90b758fb8e6293716e40",
    "callback_uri": "https://webhook.site/4623e56fc5c1",
    "connect_web_uri": "http://localhost:7070"
    }'
    
2

Open Connect-web in your browser

For this example, we presume that you are running Connect-web locally on your computer. Open http://localhost:7070?fp_cot=cot_***. replacing cot*** with the connect_token you obtained in previous step. The resulting URI may look similar to this example:

3

Tariff summary will load

Connect will return the tariff summary page. It will have controls that your customer can use to re-enter their tariff, exit the tariff summary view or disconnect their tariff (the latter will completely disable Connect in that location).