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

# Create a Business Account

> Create a business account, then list and read back its details.

<Note>
  Business Accounts are in **early access**. See the [overview](/docs/javascript/reference/business-accounts/overview) for the model.
</Note>

Create a business account as an authenticated user. You become the **owner**, and can then [add wallets](/docs/javascript/reference/business-accounts/add-wallets), [signers](/docs/javascript/reference/business-accounts/manage-signers), and [members](/docs/javascript/reference/business-accounts/members-and-roles).

## Create an account

`createBusinessAccount` takes an optional `name`, `externalRef`, and `metadata`, and returns the new account. The caller becomes the owner.

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    import { createBusinessAccount } from '@dynamic-labs-sdk/client/waas';

    const account = await createBusinessAccount({
      name: 'Acme Treasury',
      externalRef: 'org_acme_123',
    });
    // account.id  →  use this to add wallets, signers, and members
    ```
  </Tab>

  <Tab title="React">
    `useCreateBusinessAccount` returns a mutation — call `mutate` (or `mutateAsync`) to create.

    ```tsx theme={"system"}
    import { useCreateBusinessAccount } from '@dynamic-labs-sdk/react-hooks';

    const CreateAccount = () => {
      const { mutate, isPending } = useCreateBusinessAccount();

      return (
        <button
          onClick={() => mutate({ name: 'Acme Treasury', externalRef: 'org_acme_123' })}
          disabled={isPending}
        >
          Create account
        </button>
      );
    };
    ```
  </Tab>
</Tabs>

<ParamField path="name" type="string">
  Optional display name for the account.
</ParamField>

<ParamField path="externalRef" type="string">
  A developer-supplied label for mapping your own org/tenant ID onto this account — the primary B2B2B2C integration key. Not unique; multiple accounts may share a value.
</ParamField>

<ParamField path="metadata" type="Record<string, unknown>">
  Arbitrary key-value metadata to store alongside the account.
</ParamField>

## List accounts

`listBusinessAccounts` returns the accounts the current user is a member of, for the active environment.

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    import { listBusinessAccounts } from '@dynamic-labs-sdk/client/waas';

    const { items } = await listBusinessAccounts();
    ```
  </Tab>

  <Tab title="React">
    ```tsx theme={"system"}
    import { useListBusinessAccounts } from '@dynamic-labs-sdk/react-hooks';

    const AccountList = () => {
      const { data, isLoading } = useListBusinessAccounts();
      if (isLoading) return null;
      return (
        <ul>
          {data?.items.map((a) => <li key={a.id}>{a.name ?? a.id}</li>)}
        </ul>
      );
    };
    ```
  </Tab>
</Tabs>

## Read one account

`getBusinessAccount` returns the account plus its `members`, `signers`, and `wallets`.

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    import { getBusinessAccount } from '@dynamic-labs-sdk/client/waas';

    const detail = await getBusinessAccount({ businessAccountId: account.id });
    // detail.members  · detail.signers  · detail.wallets
    ```
  </Tab>

  <Tab title="React">
    ```tsx theme={"system"}
    import { useGetBusinessAccount } from '@dynamic-labs-sdk/react-hooks';

    const AccountDetail = ({ businessAccountId }: { businessAccountId: string }) => {
      const { data: detail } = useGetBusinessAccount({ businessAccountId });
      return <span>{detail?.wallets.length ?? 0} wallets</span>;
    };
    ```
  </Tab>
</Tabs>

<Tip>
  Only members of an account can read it. A non-member request returns 404 (not 403), so account existence isn't leaked across tenants.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Add wallets" icon="wallet" href="/docs/javascript/reference/business-accounts/add-wallets">
    Create a fresh wallet or link an existing one to the account.
  </Card>

  <Card title="Members & roles" icon="users" href="/docs/javascript/reference/business-accounts/members-and-roles">
    Invite admins and viewers, and transfer ownership.
  </Card>
</CardGroup>
