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

# Act as

> How a person who belongs to one or more companies chooses whether they work in the portal with their personal account or on behalf of a company.

## At a glance

| Field | Value |
| - | - |
| Status | **Available** |
| Route | Top bar of every private section |
| Menu | **Act as** selector (left of the language) |
| Feature flag | None |
| Who sees it | People who belong to at least one customer company. Someone with no company does not see the selector |
| Last verified | 2026-11-10 against `develop` (`c10d24f33d`) |

## What it is for

One person can be a customer on their own and also represent one or more companies. **Act as** lets them choose
which account they work with in the portal: their personal account or a company's. What they see afterwards
(payment methods, coupons, benefits) belongs to the chosen account.

## How to get there

* In any private section, the top bar selector shows the current account, for example **My personal account**.
* On mobile it sits in the same bar, next to the menu button, and shows only the icon: a person for **My personal account**,
  a building for a company. The account name appears when the list opens.

![From the top bar, the Act as selector shows My personal account and the person's companies; picking one re-issues the session for that account and reloads the section data.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-manual/act-as-company-navigation.svg?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=c4fb6e7acdb6ab29dd9629ec9d3f5b70)

How the account is changed with Act as

## What the customer sees

> [tab] Desktop
>
> ![Act as selector open with My personal account checked and two companies with their RUT.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-screens/act-as-company/selector-open.en.desktop.webp?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=2ef012d0969fd8aa2f91875d02580711)
>
> Act as selector open

> [tab] Mobile
>
> ![Act as selector open on mobile.](https://mintcdn.com/bbrands/RmQmo8S4AibSINhm/images/portal-customer-screens/act-as-company/selector-open.en.mobile.webp?fit=max\&auto=format\&n=RmQmo8S4AibSINhm\&q=85\&s=0378282800ff0492df2a91c4822ef7bc)
>
> Selector open on mobile

| # | Element | What it does |
| - | - | - |
| 1 | **Act as** selector | Shows the current account (person or building icon) and opens the list |
| — | **My personal account** | Goes back to working with the person's account |
| — | Each company (name and RUT) | Works on behalf of that company; the chosen one has a ✓ |

## Step by step

### Work on behalf of a company

**1. Open the selector**

Tap the top bar selector (it reads **My personal account** or the current company's name).

**2. Choose the company**

Tap the company name. The selector is disabled for a moment while it switches, then shows the company name
with a building icon. The section reloads with the company's data.

> [tab] Desktop
>
> ![Top bar showing Comercial Los Andes SpA in the Act as selector.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-screens/act-as-company/acting-as-company.en.desktop.webp?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=de5f17cbcd3e33158731aa552843ea00)

> [tab] Mobile
>
> ![Top bar on mobile with the building icon in Act as, showing the person works on behalf of a company.](https://mintcdn.com/bbrands/RmQmo8S4AibSINhm/images/portal-customer-screens/act-as-company/acting-as-company.en.mobile.webp?fit=max\&auto=format\&n=RmQmo8S4AibSINhm\&q=85\&s=7b0fa276d4f2f77d811ed2a8cd4e15ff)

**3. Back to the personal account**

Open the selector and choose **My personal account**.

## Business rules

| ID | Rule |
| - | - |
| R-01 | The selector only shows when the person belongs to at least one company |
| R-02 | When the person belongs to **exactly one** company, the portal picks it automatically the first time in that browser. If the person later picks another account, the portal keeps their choice and never switches back |
| R-03 | The choice is kept in the browser (`localStorage`), so it applies to every tab of that browser |
| R-04 | Switching re-issues the session for the chosen account; every section query runs again with the new session |
| R-05 | Only a company the person is a member of can be chosen; the server rejects any other |
| R-06 | What the person may do inside the company depends on their role (see [Roles and permissions](https://docs.bbrands.io/portal-customer/roles-and-permissions.md)) |

## States and messages

| State | What the customer sees | Why | What to do |
| - | - | - | - |
| Personal account | "My personal account" with a person icon | No company chosen, or back to personal | — |
| Company | Company name with a building icon | They chose that company (or it was chosen for them, R-02) | — |
| Switching | Selector disabled for a moment | The new session is being issued | Wait |
| No companies | No selector | The person belongs to no company | — |

## Errors

| Message | Cause | Backend code | Support action |
| - | - | - | - |
| "Switch failed. We could not switch accounts. Please try again." | The server could not issue the session for the chosen account (outage, the person is no longer a member) | `POST /api/v3/auth/context` failed (403 when not a member) | Ask them to retry; if it persists, check in Horizon Enterprise that the person is still linked to the company |

![Red Switch failed notice at the top right.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-screens/act-as-company/switch-failed.en.desktop.webp?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=f30fdd438af3d8631ec047800c1fdb0b)

Notice when the switch fails

## Why it works this way

![The person picks an account; the portal asks horizon-api for a session for that organization; if they are a member it gets a new token, the portal rewrites its cookie and reloads the data; otherwise it shows the error notice.](https://mintcdn.com/bbrands/w6DX1nTsRjzB7VQp/images/portal-customer-manual/act-as-company-process.svg?fit=max\&auto=format\&n=w6DX1nTsRjzB7VQp\&q=85\&s=93263b7c014ab9a16a7b836cb2254709)

Account switch process

* **Account-centric identity.** The person is one (one sign-in), but may act for several accounts. The session
  carries the chosen account, so every piece of data the portal requests belongs to it and the server can check
  permissions.
* **Automatic choice only once.** Someone with a single company almost always comes to manage it, so the portal
  picks it for them the first time; but if the person switches, their choice wins.

## Technical detail

| Aspect | Detail |
| - | - |
| Selector | `app/lib/shell/organization-switcher.tsx` |
| Logic and automatic choice | `app/lib/shell/use-organization-context.ts` (`portal:organization-chosen:<account>` in `localStorage`) |
| Read the context | `GET /api/v3/auth/context` → `account`, `organization`, `organizations[]` (`dni`, `document_id`, `name`) |
| Switch account | The portal's `POST /api/auth/context` → `POST /api/v3/auth/context` (`{ organization }`) → token with `org_account_id`; the portal rewrites its session cookie |
| Texts | `messages/{es,en}.json` › `organizationSwitcher` |
| Initiative | `account/account-centric-identity` (D-09, D-66) |

## FAQ and support cases

> [accordion] The customer does not see the Act as selector
>
> They belong to no company, or the company does not have them as a member. Check the link in Horizon
> Enterprise.

> [accordion] The customer signs in and sees their company's data instead of their own
>
> They belong to a single company and the portal picked it automatically (R-02). They can go back to **My
> personal account** from the selector; the portal remembers that choice in that browser.

> [accordion] The customer cannot change their company's payment methods
>
> It depends on their role: only the account holder or the legal representative can. See
> [Roles and permissions](https://docs.bbrands.io/portal-customer/roles-and-permissions.md).

## Related and history

* [Sign-in and sign-out](https://docs.bbrands.io/portal-customer/access/sign-in.md)
* [Roles and permissions](https://docs.bbrands.io/portal-customer/roles-and-permissions.md)

| Date | Change |
| - | - |
| 2026-11-10 | First version |


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