Once you tested Connect using this guide, choose between web-app (webview) and native-app (FlatPeak API in Swift, Flutter, Kotlin, Java etc) integration options.

Understanding Connect

  1. Connect handles obtaining access to your customer’s energy tariff.
  2. Your backend systems then make requests to API endpoints to obtain tariff data, calculate energy cost, plan consumption. schedule exports and more.

Trying Connect-hosted

The FlatPeak-hosted version of Connect, the Connect-hosted, is a copy of the Connect-web codebase hosted on FlatPeak servers, so you can access it without having to set up the project.

Follow this guide to start a session with Connect and experience how it may work for your customers:

Create a Connect token

Connect Token is a single-use object that identifies and secures your session with the Connect service for the duration of that session. To create it, make a request to create-connect-token API endpoint.

  1. Set connect_web_uri to https://connect-web.flatpeak.com.
  2. Set callback_uri to any page that can accept callbacks.
Our team likes https://webhook.site for callback tests but you can use something else.

Start new session with Connect

1

Launch Connect-web in your browser

Launch FlatPeak-hosted version of Connect in your preferred web browser at https://connect-web.flatpeak.com and append connect_token you obtained in the previous step as the query parameter fp_cot. The resulting URI shall look similar to the example below:

2

Input a postal address to get a list of energy providers serving the area

Connect will present you with a screen asking you to provide a postal address. This information creates a filtered list of providers (and their tariffs) available in your area. You can use your address or any other one you want to test.

3

Follow the Connect flow

Connect will present you with a set of pages that will let you share your tariff information. It automatically chooses the best route to discover your tariff based on the availability of provider APIs, data-sharing regulations and frequency of provider use within the FlatPeak base.

RouteDescription
DIRECTLogin to your account with your energy provider and grant access to read your tariff.
LIBRARYPick up your tariff from FlatPeak-maintained tariff library.
MARKETConnect automatically maps your address with the energy market rate.
MANUALYou input information about your tariff via a series of interactive pages.

Depending on the route, provider, and tariff combination, you may be presented with anywhere between 4 and 6 pages. FlatPeak’s AI-powered Connect engine works to reduce the pages behind the scenes.

4

Connect redirects to callback_url

Once you complete the flow, Connect will redirect your browser to callback_url that you specified earlier:

https://webhook.site/4623e56fc5c1?fp_cot=cot_6587fa4362341be5b524de3b&fp_status=success

Exchange Connect Token for a Location ID

Using connect_token as a reference, call exchange-token API endpoint to obtain location_id that permanently identifies of the physical location where tariff applies.

Make requests to Tariff Rates API

You can now request tariff-rates and other API endpoints using location_id as a reference.