> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Redirects

> The session_redirect route: send the user to their supplier's sign-in page, or to a VPP operator's sign-up page.

Connect returns `session_redirect` when the user must finish a step on an external page. `redirect_type` says which page it is and what happens to the session.

| `redirect_type` | The user goes to | The session |
| :- | :- | :- |
| `SUPPLIER` | Their energy supplier, to sign in and consent to share their tariff | Continues: resume it when the user returns |
| `OPERATOR_SIGNUP` | A VPP operator's site, to sign up for a managed tariff | Ends. The user returns later by universal link, with a new session |

## Supplier sign-in

Tariff connection uses this redirect when the supplier has a DIRECT integration, or a [bill upload](/docs/energy-api/reference/connect/tariff/bill-upload.md) finds one. The user signs in to the supplier and consents to share their tariff.

**1. Redirect**

`redirect_url` varies by flow and supplier.

```json Connect response theme={"system"}
{
  "connect_session": "cos_6587fa4362341be5b524de3b",
  "route": "session_redirect",
  "live_mode": false,
  "data": {
    "redirect_type": "SUPPLIER",
    "redirect_url": "https://british-gas-uk.connect.flatpeak.com"
  }
}
```

Send the user's browser to `redirect_url` with a `GET`, appending the session ID as `connect_session`. Query parameters you add, such as your own session ID, come back in the callback.

```http Example redirect theme={"system"}
GET /?connect_session=cos_6587fa4362341be5b524de3b HTTP/1.1
Host: british-gas-uk.connect.flatpeak.com
```

**2. Callback**

After the supplier flow, Flatpeak sends the user to the `connect_url` set on the Connect session: your Connect web app, or a deep link into your app. `callback_url` is different: Connect sends the user there when the whole session ends.

```http Example callback theme={"system"}
myapp://oauth-callback/flatpeak?connect_session=cos_6587fa4362341be5b524de3b
```

Resume the session with `session_restore`:

```bash Your POST to Connect theme={"system"}
curl --request POST \
  --url https://connect.flatpeak.com \
  --header 'Content-Type: application/json' \
  --data '{
    "connect_session": "cos_6587fa4362341be5b524de3b",
    "route": "session_restore"
  }'
```

### What the user sees

Most users see two pages: Login, then Consent. Some suppliers add steps such as a one-time password, address selection for accounts with several properties, retry and recovery, or tariff selection.

> [tab] Login
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/login.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=2cb3b40b1462212591d14cbc86de932e)

> [tab] OTP
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/otp.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=d89a6366af314133506a622fd0914d88)

> [tab] Progress
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/progress.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=c37cb3f5e6818f65bfcf59d44c1603a3)

> [tab] Consent
>
> ![](https://mintcdn.com/flatpeak-d495c19e/2B6nWUU4-c2pSD3E/images/busbar/connect/consent.png?fit=max\&auto=format\&n=2B6nWUU4-c2pSD3E\&q=85\&s=cbed09127ec56c17448c381e7c95c62c)

Pages vary by supplier. Placeholder names such as **Nova Inc** are replaced with the business name set in [Console → Compliance](https://console.flatpeak.com/branding).

### Use a sheet

Open supplier pages in a modal or sheet, which avoids the layout problems a full browser window has around camera cut-outs. See [iOS sheets](https://developer.apple.com/design/human-interface-guidelines/sheets) and [Android bottom sheets](https://m3.material.io/components/bottom-sheets/guidelines).

![](https://mintcdn.com/flatpeak-d495c19e/p-4R6iP93HrMFoHs/images/shared/modal.png?fit=max\&auto=format\&n=p-4R6iP93HrMFoHs\&q=85\&s=84b1ec7a1ec3c1dd6619f847f31cc045)

## Operator sign-up

The [Programs](/docs/energy-api/reference/connect/vpp/programs.md#managed-tariffs) page returns this redirect when the user selects a managed tariff. The user reads the offer and signs up on the VPP operator's site before they consent to anything.

```json Connect response theme={"system"}
{
  "connect_session": "cos_6587fa4362341be5b524de3b",
  "route": "session_redirect",
  "live_mode": true,
  "data": {
    "redirect_type": "OPERATOR_SIGNUP",
    "redirect_url": "https://pge.com/programs/on-demand-v2g/signup?program_id=vpr_7b2f9d486ec0ef716cbbee57&oem_id=oem_6a3a8dada72cd0a249ff9528&signup_reference=sur_6a7c0e2f9b4d1a3c5e8f7b6d"
  }
}
```

1. Open `redirect_url` exactly as given. Do not append `connect_session`: the session ID is the only credential on Connect requests, and the VPP operator must not receive it.
2. Use the system browser, where the VPP operator's app can take over if the user has it installed. A sheet inside your app cannot hand over to another app.
3. Close Connect. The session is over: it recorded no consent and created no enrollment, and there is nothing to restore.

`redirect_url` carries a `signup_reference` that lets Flatpeak find the device again later; it holds no device or user data. Once the user has signed up, the VPP operator sends them back to your app by [universal link](/docs/energy-api/reference/connect/vpp/universal-links.md) with a new Connect session, where they consent and the enrollment starts. That can be minutes or days after the redirect.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.