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

# Fund the Wallet

> Link a bank via Plaid, connect it as a funding source, and deposit.

Funding is a bank-link step followed by a deposit. You link a bank through Plaid Link, connect the returned token as a funding source (`fs_`), then deposit against that funding source.

You need the `INVESTOR_ID` from earlier, and a verified investor from [Verify identity](/get-started/journey/verify-identity).

<Frame>
  <img src="https://mintcdn.com/bluumfinance/L5Dm3BN-WAZqlyQf/images/diagrams/plaid-link-sequence.svg?fit=max&auto=format&n=L5Dm3BN-WAZqlyQf&q=85&s=1c51f76c10c9af23cc334464f6b7d0d4" alt="Plaid Link funding sequence" width="1200" height="560" data-path="images/diagrams/plaid-link-sequence.svg" />
</Frame>

## Step 1 — Create a link token

Generate the token your frontend passes to Plaid Link.

```bash theme={null}
curl -X POST "$BASE_URL/investors/$INVESTOR_ID/funding-sources/plaid/link-token" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{ "enable_hosted_link": false }'
```

```json theme={null}
{
  "link_token": "link-sandbox-abc123def456",
  "hosted_link_url": null
}
```

<Tip>
  Set `enable_hosted_link: true` to get a `hosted_link_url` and use Plaid's hosted redirect flow instead of embedding the widget.
</Tip>

## Step 2 — Run Plaid Link on your frontend

Your frontend initializes Plaid Link with the `link_token`. The user selects their bank and authenticates. On success, Plaid returns a **`public_token`** to your frontend. Send that token to your backend for the next step.

<Note>
  The `public_token` is single-use. Exchange it once — a retry with the same token fails.
</Note>

## Step 3 — Connect the funding source

Exchange the `public_token` for a persistent funding source. The body is discriminated on `type`.

```bash theme={null}
curl -X POST "$BASE_URL/investors/$INVESTOR_ID/funding-sources/connect" \
  -H "Authorization: Basic $AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "plaid",
    "public_token": "public-sandbox-abc123def456"
  }'
```

```json theme={null}
{
  "id": "fs_7h8g9f0e1d2c3b4a",
  "object": "funding_source",
  "type": "plaid",
  "bank_name": "Wells Fargo",
  "account_mask": "6789",
  "status": "active",
  "created_at": "2026-07-01T10:40:00Z"
}
```

Store the funding source ID — deposits and withdrawals reference it:

```bash theme={null}
FUNDING_SOURCE_ID="fs_7h8g9f0e1d2c3b4a"
```

<Note>
  To connect a bank manually instead of via Plaid, send `{ "type": "manual", "bank_name": "...", "account_holder_name": "...", "account_number": "...", "routing_number": "...", "bank_account_type": "CHECKING" }`.
</Note>

## Step 4 — Deposit

Move cash into the wallet with an ACH deposit against the funding source.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "$BASE_URL/investors/$INVESTOR_ID/deposits" \
    -H "Authorization: Basic $AUTH" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: dep-$(uuidgen)" \
    -d '{
      "amount": "5000.00",
      "currency": "USD",
      "method": "ach",
      "description": "Initial deposit",
      "funding_source_id": "'"$FUNDING_SOURCE_ID"'"
    }'
  ```

  ```javascript Node.js theme={null}
  import { randomUUID } from "node:crypto";

  const res = await fetch(`${BASE_URL}/investors/${INVESTOR_ID}/deposits`, {
    method: "POST",
    headers: {
      Authorization: `Basic ${auth}`,
      "Content-Type": "application/json",
      "Idempotency-Key": `dep-${randomUUID()}`,
    },
    body: JSON.stringify({
      amount: "5000.00",
      currency: "USD",
      method: "ach",
      description: "Initial deposit",
      funding_source_id: FUNDING_SOURCE_ID,
    }),
  });

  const deposit = await res.json();
  console.log(deposit.id, deposit.status); // dep_..., pending
  ```

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

  res = requests.post(
      f"{BASE_URL}/investors/{INVESTOR_ID}/deposits",
      headers={
          "Authorization": f"Basic {auth}",
          "Content-Type": "application/json",
          "Idempotency-Key": f"dep-{uuid.uuid4()}",
      },
      json={
          "amount": "5000.00",
          "currency": "USD",
          "method": "ach",
          "description": "Initial deposit",
          "funding_source_id": FUNDING_SOURCE_ID,
      },
  )

  deposit = res.json()
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "id": "dep_2b3c4d5e6f7g8h9i",
  "object": "deposit",
  "amount": "5000.00",
  "currency": "USD",
  "method": "ach",
  "status": "pending",
  "funding_source_id": "fs_7h8g9f0e1d2c3b4a",
  "created_at": "2026-07-01T10:45:00Z"
}
```

Deposit status progresses `pending` → `processing` → `completed`. A deposit can also end `cancelled` or `failed`. In sandbox, ACH deposits settle within seconds.

<Warning>
  Always send an `Idempotency-Key` header on deposits and withdrawals. If a request times out and you retry, the key guarantees the transfer is created at most once.
</Warning>

For funding methods, wallet balances, and settlement, see [Funding](/concepts/funding) and [Wallets](/concepts/wallets).

<Tip>
  Next → [Place orders](/get-started/journey/place-orders).
</Tip>
