> ## 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.

# Add Wallets to a Business Account

> Link an existing embedded wallet to a business account in Flutter, and remove it again.

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

The Flutter SDK links an embedded wallet you already own into a business account, so the team can share it. The account then owns the wallet (not a single user), and you become its first [signer](/docs/flutter/business-accounts/manage-signers).

## Find the wallet ID

Linking takes a wallet ID. Read it from the user's wallets, which are created automatically after authentication (see [wallet creation](/docs/flutter/wallet-creation)).

```dart theme={"system"}
import 'package:dynamic_sdk/dynamic_sdk.dart';

final sdk = DynamicSDK.instance;

final wallet = sdk.wallets.userWallets.first;
final walletId = wallet.id;
```

## Link a wallet

`addWallet` links the wallet into the account, and returns the updated `BusinessAccountDetail` including members, signers, and wallets.

```dart theme={"system"}
final detail = await sdk.businessAccounts.addWallet(
  businessAccountId: account.id,
  walletId: walletId,
);

print(detail.wallets?.length ?? 0);
```

<ParamField path="walletId" type="String" required>
  The wallet to link, from `sdk.wallets.userWallets`.
</ParamField>

<ParamField path="businessAccountId" type="String?">
  The account to link into. If omitted, the wallet is linked into its per-wallet business account, which is found or created automatically. Pass it explicitly to link into a specific account you own or administer.
</ParamField>

<Warning>
  Only the wallet's owner can link it, and a wallet can belong to **one** business account. Linking a wallet that already belongs to a different account is rejected.
</Warning>

## Remove a wallet

`removeWallet` unlinks a wallet from the account and returns the updated account.

```dart theme={"system"}
final detail = await sdk.businessAccounts.removeWallet(
  businessAccountId: account.id,
  walletId: walletId,
);
```

## On error

Both calls throw on failure. Catch the error and show it to the user, for example when the caller is not an owner or admin of the account:

```dart theme={"system"}
try {
  await sdk.businessAccounts.addWallet(
    businessAccountId: account.id,
    walletId: walletId,
  );
} catch (e) {
  print('Failed to link wallet: $e');
}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Manage signers" icon="key" href="/docs/flutter/business-accounts/manage-signers">
    Add teammates or servers as signers on the wallet.
  </Card>

  <Card title="Sign transactions" icon="signature" href="/docs/flutter/business-accounts/signing">
    Sign with a business-account wallet.
  </Card>
</CardGroup>
