> ## Documentation Index
> Fetch the complete documentation index at: https://developer.energy-hub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulated Connect

> Connect simulated vendor accounts and link virtual devices in the Sandbox environment without contacting real vendor identity providers.

The Sandbox environment allows you to go through the full connect and link flow without contacting a real vendor identity provider (IDP). This lets you develop and test your integration end-to-end using virtual devices.

<Note>
  The simulated connect flow is only active on subscriptions with **Sandbox**
  mode. On Live subscriptions, the standard connect flow with real vendor IDPs
  is used.
</Note>

## How It Works

The Sandbox connect flow behaves exactly like the production flow in terms of workflows, endpoint responses, and data model. The only difference is that no real vendor IDP is contacted. The Energy Hub Alliance simulates the vendor side entirely.

**The simulated connect flow follows the same two steps as production: connect session and linking:**

<Card title="Simulated Connect Session" icon="square-1">
  When you create a connect session in Sandbox mode, the user is redirected back
  to your redirect URI with a simulated `vendorAccountId` -- no real vendor
  authentication takes place. If the vendor has a custom connect screen, the
  screen is still shown but all user input is ignored. If the vendor has no
  custom connect screen, the redirect happens immediately.
</Card>

<Card title="Simulated Link" icon="square-2">
  During the link flow, a standard list of virtual devices is presented for the
  vendor. You select which devices to link, just like in production. Once
  linking is complete, the simulated devices are created and available through
  the API.
</Card>

## Connect Flow Details

<Steps>
  <Step title="Create connect session for vendor">
    Initiate the connect session using the same API endpoints as in production,
    for example [Connect session for vehicle](/api-reference/connection-controller/connect-url-for-a-vehicle-vendor).
    Redirect the user to the returned connect URL.
  </Step>

  <Step title="Simulated vendor redirect">
    Instead of authenticating with a real vendor IDP, the Sandbox environment
    handles the redirect automatically:

    * **Vendor with custom connect screen:** The connect screen is displayed as
      usual, but user input is not validated against a real vendor. The user is
      then redirected back to your `redirectUri` with a simulated
      `vendorAccountId`.
    * **Vendor without custom connect screen:** The user is immediately
      redirected back to your `redirectUri` with a simulated `vendorAccountId`.

    A simulated vendor account is created on redirect.
  </Step>

  <Step title="Retrieve virtual devices from vendor account">
    Use the same list endpoints as in production, for example
    [List vehicles from vendor](/api-reference/vendor-account-vehicles-link-controller/list-vehicles-from-vendor),
    to retrieve the available virtual devices. A standard set of one device per
    category is returned for each vendor.
  </Step>

  <Step title="Link virtual devices">
    Link the selected virtual devices using the same endpoints as in production,
    for example
    [Link vehicles](/api-reference/vendor-account-vehicles-link-controller/link-vehicles).
    Once linking is complete, the simulated devices are created and fully
    accessible through the API, including data streaming.
  </Step>
</Steps>

<Tip>
  Since the Sandbox environment mirrors the production data model and workflows,
  you can reuse the same integration code for both environments. Switch between
  them simply by using the credentials from your Sandbox or Live subscription.
</Tip>
