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

# Treasury Wallets

> Create and manage treasury wallets for your company's stablecoin operations

This guide walks you through creating a Treasury Wallet — a company-owned wallet for managing stablecoins — and performing basic operations like funding and checking balances.

For background on what Treasury Wallets are and when to use them, see the [Treasury Wallets concept page](/wallets/concepts/treasury).

## Prerequisites

<CardGroup cols={2}>
  <Snippet file="before-you-start.mdx" />
</CardGroup>

<Snippet file="enterprise-feature.mdx" />

## Create a Treasury Wallet

<Steps>
  <Step title="Install the SDK">
    Run the following command to install the SDK:

    <Snippet file="wallets-sdk-installation-cmd.mdx" />
  </Step>

  <Step title="Create a treasury wallet">
    See all supported chains [here](/introduction/supported-chains).

    <CodeGroup>
      ```typescript Node.js theme={null}
      import { CrossmintWallets, createCrossmint } from "@crossmint/wallets-sdk";

      const crossmint = createCrossmint({
          apiKey: "<your-server-api-key>",
      });

      const crossmintWallets = CrossmintWallets.from(crossmint);

      const wallet = await crossmintWallets.createWallet({
          chain: "base-sepolia",
          recovery: { type: "server", secret: "<your-recovery-secret>" },
          owner: "COMPANY",
          alias: "treasury",
      });

      console.log(wallet.address);
      ```

      ```bash cURL theme={null}
      curl --request POST \
          --url 'https://staging.crossmint.com/api/2025-06-09/wallets' \
          --header 'X-API-KEY: <your-server-api-key>' \
          --header 'Content-Type: application/json' \
          --data '{
              "chain": "base-sepolia",
              "adminSigner": {
                  "type": "evm-keypair",
                  "address": "<your-recovery-signer-address>"
              },
              "owner": "COMPANY",
              "alias": "treasury"
          }'
      ```

      ```python Python theme={null}
      import requests

      url = "https://staging.crossmint.com/api/2025-06-09/wallets"

      payload = {
          "chain": "base-sepolia",
          "adminSigner": {
              "type": "evm-keypair",
              "address": "<your-recovery-signer-address>"
          },
          "owner": "COMPANY",
          "alias": "treasury"
      }
      headers = {
          "X-API-KEY": "<your-server-api-key>",
          "Content-Type": "application/json"
      }

      response = requests.post(url, json=payload, headers=headers)

      print(response.json())
      ```
    </CodeGroup>

    **Key Points:**

    * The `owner` field must be set to `"COMPANY"` for treasury wallets to ensure the wallet appears under Company in the console
    * The `recovery` signer must be a non-custodial type (`external-wallet`, `passkey`, or `server`)
    * The `alias` field is set to `"treasury"` to identify this as your treasury wallet
    * A `server` signer is suitable for low-risk use-cases. For higher-risk use-cases, use an `external-wallet` signer via [Cloud KMS](/wallets/guides/signers/cloud-kms)
  </Step>

  <Step title="Fund and check treasury wallet balance">
    Fund the wallet using the SDK, then check the balance:

    <CodeGroup>
      ```typescript Node.js theme={null}
      import { CrossmintWallets, createCrossmint } from "@crossmint/wallets-sdk";

      const crossmint = createCrossmint({
          apiKey: "<your-server-api-key>",
      });

      const crossmintWallets = CrossmintWallets.from(crossmint);

      const treasuryWallet = await crossmintWallets.getWallet("<your-wallet-address>", {
          chain: "base-sepolia",
      });
      // Fund the wallet (staging only)
      await treasuryWallet.stagingFund(10);

      // Check balance
      const balances = await treasuryWallet.balances(["usdc"]);
      console.log(balances.usdc.amount);
      ```

      ```bash cURL theme={null}
      # Fund the wallet (staging only)
      curl --request POST \
          --url 'https://staging.crossmint.com/api/v1-alpha2/wallets/<your-wallet-address>/balances' \
          --header 'X-API-KEY: <your-server-api-key>' \
          --header 'Content-Type: application/json' \
          --data '{
              "amount": 10,
              "token": "usdxm",
              "chain": "base-sepolia"
          }'

      # Check balance
      curl --request GET \
          --url 'https://staging.crossmint.com/api/2025-06-09/wallets/<your-wallet-address>/balances' \
          --header 'X-API-KEY: <your-server-api-key>'
      ```

      ```python Python theme={null}
      import requests

      api_key = "<your-server-api-key>"
      wallet_address = "<your-wallet-address>"
      headers = {
          "X-API-KEY": api_key,
          "Content-Type": "application/json"
      }

      # Fund the wallet (staging only)
      fund_url = f"https://staging.crossmint.com/api/v1-alpha2/wallets/{wallet_address}/balances"
      fund_payload = {
          "amount": 10,
          "token": "usdxm",
          "chain": "base-sepolia"
      }
      requests.post(fund_url, json=fund_payload, headers=headers)

      # Check balance
      balance_url = f"https://staging.crossmint.com/api/2025-06-09/wallets/{wallet_address}/balances"
      response = requests.get(balance_url, headers={"X-API-KEY": api_key})

      print(response.json())
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the code">
    Execute your `index.ts` file using one of the following methods:

    **Using ts-node:**

    ```bash theme={null}
    npx ts-node index.ts
    ```

    **Or compile and run with Node.js:**

    ```bash theme={null}
    npx tsc index.ts && node index.js
    ```

    You should see the wallet address printed to the console after successful execution.
  </Step>

  <Step title="Verify in the console">
    After creating your treasury wallet, you can verify it was created correctly in the <a href="https://staging.crossmint.com/console" target="_blank">Crossmint Console</a>:

    1. Navigate to **Wallets** in the left sidebar
    2. Click on the **Company** tab
    3. Your treasury wallet should appear in the list with the alias "treasury"
  </Step>
</Steps>

## Launching in Production

<Snippet file="enterprise-feature.mdx" />

For production, the steps are almost identical, but some changes are required:

1. Create a developer account on the <a href="https://www.crossmint.com/console" target="_blank">production console</a>
2. Create a production server API key on the <a href="https://www.crossmint.com/console/projects/apiKeys" target="_blank">API Keys</a> page with the API scopes `wallets.read`, `wallets.create`, `wallets:transactions.create`, `wallets:transactions.sign`, `wallets:balance.read`, `wallets.fund`
3. Replace your test API key with the production key
4. Discuss with your Crossmint Customer Success Engineering (CSE) team the best signer configuration for your expected usage, and recovery mechanisms

## Next Steps

<CardGroup cols={2}>
  <Card title="Check Balances" icon="money-bill-transfer" iconType="duotone" href="/wallets/guides/check-balances">
    Check the balance of a wallet.
  </Card>

  <Card title="Funding the Wallet" icon="money-bill-transfer" iconType="duotone" color="#41B118" href="/stablecoin-orchestration/guides/on-off-ramps/funding-company-wallets">
    Learn how to fund your treasury wallet.
  </Card>

  <Card title="Withdrawals" icon="building-columns" iconType="duotone" color="#8B5CF6" href="/stablecoin-orchestration/guides/on-off-ramps/withdrawing-from-company-wallets">
    Withdraw stablecoins to your bank account.
  </Card>

  <Card title="Payouts" icon="coins" iconType="duotone" color="#1A5785" href="/stablecoin-orchestration/regulated-transfers/overview">
    Send stablecoins to your customers and vendors.
  </Card>
</CardGroup>
