> ## 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 in Unity, then list, read, and rename it.

<Note>
  Business Accounts are in **early access**. See the [overview](/docs/unity/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/unity/business-accounts/add-wallets), [signers](/docs/unity/business-accounts/manage-signers), and [members](/docs/unity/business-accounts/members-and-roles).

## Create an account

`Create` takes an optional `name`, `externalRef`, and `metadata`, and returns the new account.

```csharp theme={"system"}
using System.Collections.Generic;
using DynamicSDK.Models.BusinessAccounts;
using UnityEngine;

var account = await DynamicSDK.Instance.BusinessAccounts.Create(
    name: "Acme Treasury",
    externalRef: "org_acme_123",
    metadata: new Dictionary<string, object> { { "tier", "enterprise" } });

Debug.Log(account.Id); // use this to add wallets, signers, and members
```

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

<ParamField path="externalRef" type="string">
  A developer-supplied label for mapping your own org or tenant ID onto this account. Not unique, so multiple accounts may share a value.
</ParamField>

<ParamField path="metadata" type="object">
  Arbitrary key-value metadata stored alongside the account.
</ParamField>

The returned `BusinessAccount` has `Id`, `Name`, `ExternalRef`, `Metadata`, `ProjectEnvironmentId`, `CreatedAt`, and `UpdatedAt`.

## List accounts

`List` returns the accounts the current user is a member of, for the active environment. Pass `externalRefs` to filter by your own org or tenant IDs.

```csharp theme={"system"}
var list = await DynamicSDK.Instance.BusinessAccounts.List();

foreach (var item in list.Items ?? new List<BusinessAccount>())
{
    Debug.Log(item.Name ?? item.Id);
}

// Filter by your own references
var filtered = await DynamicSDK.Instance.BusinessAccounts.List(
    new List<string> { "org_acme_123" });
```

`BusinessAccountList` returns `Items` plus a `NextCursor` for paging.

## Read one account

`Get` returns the account plus its `Members`, `Signers`, and `Wallets`.

```csharp theme={"system"}
var detail = await DynamicSDK.Instance.BusinessAccounts.Get(account.Id);

Debug.Log(detail.Members.Count);
Debug.Log(detail.Signers.Count);
Debug.Log(detail.Wallets?.Count ?? 0);
```

Each entry in `detail.Wallets` is a `BusinessAccountWalletSummary` with `Id`, `Chain`, and `PublicKey`. Use the `Id` when you [add or remove wallets](/docs/unity/business-accounts/add-wallets) and when you [manage signers](/docs/unity/business-accounts/manage-signers).

<Tip>
  Only members of an account can read it. A request from a non-member returns 404 rather than 403, so account existence is not leaked across tenants.
</Tip>

## Rename an account

`Update` changes the account name.

```csharp theme={"system"}
var renamed = await DynamicSDK.Instance.BusinessAccounts.Update(
    account.Id, "Acme Operating Funds");
```

## On error

Every method returns a `UniTask` that throws on failure. Wrap calls in `try/catch` and show the failure to the player:

```csharp theme={"system"}
try
{
    var account = await DynamicSDK.Instance.BusinessAccounts.Create(name: "Acme Treasury");
    Debug.Log(account.Id);
}
catch (System.Exception e)
{
    Debug.LogError($"Failed to create business account: {e.Message}");
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Add wallets" icon="wallet" href="/docs/unity/business-accounts/add-wallets">
    Link an embedded wallet to the account.
  </Card>

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