> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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 Kotlin, and remove it again.

> [!NOTE]
>
> Business Accounts are in **early access**. See [Business Accounts](https://docs.dynamic.xyz/docs/business-accounts/accounts.md) for the model.

The Kotlin 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](https://docs.dynamic.xyz/docs/kotlin/business-accounts/manage-signers.md).

## 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](https://docs.dynamic.xyz/docs/kotlin/wallet-creation.md)).

```kotlin theme={"system"}
import com.dynamic.sdk.android.DynamicSDK

val sdk = DynamicSDK.getInstance()

val wallet = sdk.wallets.userWallets.firstOrNull() ?: return
val walletId = wallet.id ?: return
```

## Link a wallet

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

```kotlin theme={"system"}
val detail = sdk.businessAccounts.addWallet(
    businessAccountId = account.id,
    walletId = walletId
)

println(detail.wallets?.size ?: 0)
```

**walletId** `String` *required*

The wallet to link, from `sdk.wallets.userWallets`.

**businessAccountId** `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.

> [!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.

## Remove a wallet

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

```kotlin theme={"system"}
val detail = sdk.businessAccounts.removeWallet(
    businessAccountId = account.id,
    walletId = walletId
)
```

## On error

Both calls are `suspend` functions that 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:

```kotlin theme={"system"}
try {
    sdk.businessAccounts.addWallet(businessAccountId = account.id, walletId = walletId)
} catch (e: Exception) {
    println("Failed to link wallet: ${e.message}")
}
```

## Next steps

> [card] [Manage signers](https://docs.dynamic.xyz/docs/kotlin/business-accounts/manage-signers.md)
>
> Add teammates or servers as signers on the wallet.

> [card] [Sign transactions](https://docs.dynamic.xyz/docs/kotlin/business-accounts/signing.md)
>
> Sign with a business-account wallet.


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