When customer selects a provider with a DIRECT integration, Connect will instruct you to redirect the customer to an external page where they will login to their provider’s online dashboard and provide consent for your application to access their tariff.

1

Handling Redirect

Connect will respond with the session_redirect route.

{
  "connect_token": "cot_6587fa4362341be5b524de3b",
  "route": "session_redirect",
  "live_mode": false,
  "data": {
    "redirect_url": "https://british-gas-uk.connect.flatpeak.com"
  }
}

You will redirect the session to redirect_url via HTTP-GET, appending connect_token.

Example redirect (http)
GET /?fp_cot=cot_6587fa4362341be5b524de3b HTTP/1.1
Host: british-gas-uk.connect.flatpeak.com
You can append any other query parameter to redirect, for example, your internal session or a security key. They will be returned to you via callback later.
2

Handling Callback

Once you redirect the customer’s session to redirect_url, you will soon receive a callback to the URI you specified when you created the connect_token via the API. It will have the same query params and payload that you appended to the original redirect.

POST your response to Connect via session_restore route:

myapp://oauth-callback/flatpeak?fp_cot=cot_6587fa4362341be5b524de3b

Your customer’s experience with redirects

Your customer will likely interact with only two pages - Login and Consent.

However, depending on how the provider implements the login process, the configuration of their account (such as having multiple properties supplied under one contract) and other factors, they may be presented with additional pages:

The actual look and feel may vary between providers as they develop and host the pages. The word [Brand] will always be replaced with your business name.