Skip to main content
A link session is one time through Link: your user adds a charger, changes its network, sets it up or reconnects it. Link opens it with a client secret when the hosted flow starts, and the SDK returns its id as sessionId when Link closes. Your server reads it with Get a link session.

Statuses

abandon_reason is cancelled (your user closed Link), consent_declined (they chose Not now on the consent screen) or error. With error, error.code says why, for your logs, for example wifi_join_failed or charger_unreachable. New codes may be added: don’t branch on them.

The result in your app and the truth on your server

When Link closes, your app gets a result with: The result is for your app’s screens. Before your server relies on it, it reads the link session itself:
  1. Your app sends sessionId to your server.
  2. Your server calls GET /sdk/v1/link-sessions/{id} and checks that external_user_id is the signed-in user.
  3. When status is completed, it stores the chargers in devices.
A link session your server didn’t hear about (your app was killed, for example) is still there: you can also list a user’s chargers with GET /sdk/v1/chargers?external_user_id=….

Chargers that belong to someone else

When your user adds a charger that is already connected to another Plugchoice account, Link can claim it for them. Plugchoice emails the current owner to approve it within 7 days. While the charger is online and not open to the public, your user can also prove they’re at the charger by plugging in a car. A claim can succeed after the link session has ended. The charger then appears at the link session’s site. claims in the link session shows each claim’s status: While a claim is pending, check the link session again later, for example once a day, or list the user’s chargers.