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

# Connect a funding source

> Connect a funding source to an investor. Two flows:

- **Plaid** (`type: plaid`): exchange a public token from Plaid Link;
  one or more bank accounts become available as funding sources.
  The response is a list envelope (one entry per linked account).
- **Manual** (`type: manual`): supply bank details directly. The
  response is a single funding-source resource.




## OpenAPI

````yaml /api-reference/openapi.yaml post /investors/{investor_id}/funding-sources/connect
openapi: 3.0.0
info:
  title: Bluum Finance Investment API
  version: 1.0.0
  description: >
    The Bluum Finance API provides embeddable investment experiences, allowing
    fintech partners to manage investor accounts, facilitate trading, handle
    document uploads, and manage wallet operations.


    ### Response conventions


    Every resource response carries a small, consistent set of envelope keys

    followed by domain fields:


    ```json

    {
      "id": "<prefix>_<base32>",
      "object": "<resource>",
      "created": <unix_seconds>,
      "livemode": <boolean>,
      "metadata": { ... },
      ... domain fields ...
    }

    ```


    List endpoints return:


    ```json

    {
      "object": "list",
      "url": "/v1/<resource>",
      "has_more": false,
      "data": [ <resource>... ]
    }

    ```


    Errors are wrapped in:


    ```json

    {
      "error": {
        "type": "invalid_request_error",
        "code": "BLUM-400-001",
        "message": "...",
        "param": "tax_id"
      }
    }

    ```


    See `ResourceEnvelope`, `ListEnvelope`, and `ErrorEnvelope` in

    `shared-schemas.yaml` for the full schemas.


    ### Product entitlements


    Core investing (accounts, funding, trading, positions, documents,

    webhooks) is available to every tenant. Three surfaces are add-on products

    that must be enabled for your tenant before use:


    - **Market Data** — `/v1/market-data/*`

    - **Cash Management** — `/v1/cash-management/*`


    Calling a disabled product returns HTTP `403` with the legacy

    `{ "status": "error", "code": "PRODUCT_NOT_ENABLED", "message": "..." }`

    body (not the standard error envelope). Contact your Bluum account manager

    to enable a product.


    ### Field naming


    - snake_case throughout (no camelCase)

    - `email` / `phone` (not `email_address` / `phone_number`)

    - `first_name` / `middle_name` / `last_name` (not `given_name` /
    `family_name`)

    - `address: { street: [string], unit?, city, state?, postal_code?, country
    }`
      (the `street` array form preserves multi-line addresses; ISO 3166-1
      alpha-2 country code on `address.country` and on the top-level
      `country_of_*` fields)
    - `quantity` (not `qty`)

    - Status enums are lowercase Bluum-native vocabulary (e.g. `pending` /
    `filled` / `cancelled` / `failed`)


    Regulatory vocabulary (CAIS / FINRA / IRS / FATF) is preserved verbatim

    (e.g. `tax_id_type`, `country_of_tax_residence`, `is_politically_exposed`,

    `funding_source`).


    ### Terminology


    The investor resource lives at `/v1/investors`. Path parameter is

    `investor_id`.


    ### Asset classification


    Assets carry a canonical `(class, country)` pair:

    - `class`: `equity` | `etf` | `bond` | `bill` | `note` | `mutual_fund` |
      `derivative` | `cryptocurrency` | `commodity` | `real_estate` | `cash`
    - `country`: ISO 3166-1 alpha-2, lower-case (`us`, `ng`, …). Null for
      country-agnostic instruments (most crypto).

    ### Fixed income (bonds)


    Bond orders use the same `POST /v1/investors/{investor_id}/orders`

    endpoint as equities, with bond-specific semantics:

    - `quantity` carries **face value** (e.g. `"10000"` for $10k face),
      and must be a multiple of the bond's `min_increment`.
    - `limit_price` is quoted as **% of par** (e.g. `"99.875"` = 99.875%
      of face value).
    - `settlement_date` is optional; defaults to T+1 for US treasuries
      and T+2 for corporates.
    - Bond quote responses (`/v1/market-data/assets/{symbol}/quote`)
      include a `bond` block with clean/dirty price, accrued interest,
      and yield to maturity.

    Bond trading must be explicitly enabled on the tenant before orders

    will route. Contact Bluum support to flip `fixedIncomeEnabled`.


    ### Authentication


    HTTP Basic Authentication. **API Key** is the username, **API Secret** is

    the password. Base64-encode `API_KEY:API_SECRET` and send in the

    `Authorization` header.
servers:
  - url: https://api.bluumfinance.com/v1
    description: Production Environment
  - url: https://sandbox.api.bluumfinance.com/v1
    description: Sandbox/Testing Environment
  - url: https://service.bluumfinance.com/v1
    description: Production Environment (legacy alias)
  - url: https://test-service.bluumfinance.com/v1
    description: Sandbox/Testing Environment (legacy alias)
security:
  - BluumApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Investors
    description: Create and manage investor accounts, wallets, and transactions.
  - name: API Keys
    description: Mint, list, and revoke investor-scoped API keys for programmatic access.
  - name: Compliance
    description: Investor compliance workflows, KYC checks, and document submissions.
  - name: Transfers
    description: Deposit and withdrawal operations for investor wallets.
  - name: Funding Sources
    description: Connect and manage external funding sources (Plaid, bank accounts).
  - name: Trading
    description: Place, list, and cancel investor orders.
  - name: Positions
    description: View investor portfolio positions.
  - name: Assets
    description: Search and retrieve asset reference data.
  - name: Document Management
    description: Upload, list, and download documents.
  - name: Markets
    description: Market reference data, status, calendar, and halts.
  - name: Market Data
    description: Real-time quotes, snapshots, and historical bars (paywalled product).
  - name: Webhooks
    description: Register and manage webhook endpoints for event delivery.
  - name: Disclosures
    description: >-
      Partner-facing disclosure library (verbatim regulated copy, PDFs) +
      per-investor acceptance trail.
  - name: Cash Sweep
    description: >-
      High Yield Cash (HYC) / FDIC Bank Sweep enrollment, tier management, and
      interest reporting.
  - name: Cash Management
    description: >-
      Multi-currency, zero-day-liquidity yield on cash — programs, eligibility,
      enrollment, sweeps, withdrawals, earnings.
paths:
  /investors/{investor_id}/funding-sources/connect:
    post:
      tags:
        - Funding Sources
      summary: Connect a funding source
      description: |
        Connect a funding source to an investor. Two flows:

        - **Plaid** (`type: plaid`): exchange a public token from Plaid Link;
          one or more bank accounts become available as funding sources.
          The response is a list envelope (one entry per linked account).
        - **Manual** (`type: manual`): supply bank details directly. The
          response is a single funding-source resource.
      operationId: connectFundingSource
      parameters:
        - $ref: '#/components/parameters/parameters-InvestorIdPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectFundingSourceRequest'
            examples:
              plaid:
                summary: Connect via a Plaid public_token from Plaid Link
                value:
                  type: plaid
                  public_token: public-sandbox-1234abcd-5678-90ef
              manual_wire:
                summary: Connect a manual international-wire payout destination
                value:
                  type: manual
                  bank_name: Deutsche Bank
                  account_holder_name: Jane Doe
                  account_number: '0123456789'
                  swift_code: DEUTDEFF
                  iban: DE89370400440532013000
                  country: DE
                  currency: EUR
                  address_line_1: 123 Hauptstrasse
                  city: Berlin
                  postal_code: '10115'
              manual_us_ach:
                summary: Connect a manual US ACH bank account
                value:
                  type: manual
                  bank_name: Chase
                  account_holder_name: Jane Doe
                  account_number: '000123456789'
                  routing_number: '021000021'
                  bank_account_type: CHECKING
                  country: US
                  currency: USD
      responses:
        '201':
          description: Funding source(s) connected successfully.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FundingSource'
                  - allOf:
                      - $ref: '#/components/schemas/ListEnvelope'
                      - type: object
                        properties:
                          data:
                            type: array
                            items:
                              $ref: '#/components/schemas/FundingSource'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    parameters-InvestorIdPath:
      name: investor_id
      in: path
      required: true
      schema:
        type: string
      description: The prefixed public id of the investor (e.g. `inv_…`).
  schemas:
    ConnectFundingSourceRequest:
      oneOf:
        - $ref: '#/components/schemas/ConnectPlaidRequest'
        - $ref: '#/components/schemas/ConnectManualRequest'
      discriminator:
        propertyName: type
        mapping:
          plaid:
            $ref: '#/components/schemas/ConnectPlaidRequest'
          manual:
            $ref: '#/components/schemas/ConnectManualRequest'
    FundingSource:
      description: |
        A connected funding source (bank account) that can be used for
        deposits and withdrawals. Envelope-wrapped.
      allOf:
        - $ref: '#/components/schemas/ResourceEnvelope'
        - type: object
          properties:
            type:
              type: string
              enum:
                - plaid
                - manual
            status:
              type: string
              enum:
                - active
                - disconnected
                - error
            bank_name:
              type: string
              nullable: true
            mask:
              type: string
              nullable: true
            provider_id:
              type: string
              description: Plaid `item_id` for Plaid sources.
            account_name:
              type: string
              nullable: true
            account_type:
              type: string
              nullable: true
            account_subtype:
              type: string
              nullable: true
            account_holder_name:
              type: string
              nullable: true
              description: Legal name of the account holder.
            bank_account_type:
              type: string
              nullable: true
              enum:
                - CHECKING
                - SAVINGS
              description: Type of bank account.
            account_number:
              type: string
              nullable: true
              description: Masked account number (last 4 digits visible).
            routing_number:
              type: string
              nullable: true
              description: Bank routing number (ABA for US banks).
            swift_code:
              type: string
              nullable: true
              description: SWIFT/BIC code for international wires.
            iban:
              type: string
              nullable: true
              description: Masked IBAN (last 4 digits visible).
            wire_routing_kind:
              type: string
              nullable: true
              description: 'Routing code type: aba, sort_code, ifsc, etc.'
            bank_code:
              type: string
              nullable: true
              description: Bank-specific code (used in some regions).
            beneficiary_address:
              type: string
              nullable: true
              description: Beneficiary address as a single string (legacy field).
            address_line_1:
              type: string
              nullable: true
              description: Street address for wire payout beneficiary.
            payout_country:
              type: string
              nullable: true
              description: ISO 3166-1 alpha-2 country code for wire payout beneficiary.
            payout_currency:
              type: string
              nullable: true
              description: ISO 4217 currency code for wire payout beneficiary.
            payout_city:
              type: string
              nullable: true
              description: City for wire payout beneficiary.
            payout_region:
              type: string
              nullable: true
              description: State or region for wire payout beneficiary.
            payout_postal_code:
              type: string
              nullable: true
              description: Postal code for wire payout beneficiary.
            wire_payout_complete:
              type: boolean
              description: >-
                Whether enough fields are populated for a wire payout via the
                custodian.
            metadata:
              type: object
              description: Arbitrary key-value metadata attached to the funding source.
            updated_at:
              type: string
              format: date-time
    ListEnvelope:
      type: object
      description: |
        List envelope. `data` holds the page of items;
        each item is itself wrapped in a ResourceEnvelope.
      required:
        - object
        - url
        - has_more
        - data
      additionalProperties: true
      properties:
        object:
          type: string
          enum:
            - list
        url:
          type: string
          description: The endpoint path that produced this list.
          example: /v1/investors/inv_…/deposits
        has_more:
          type: boolean
          description: Whether more results exist beyond `data`.
          example: false
        data:
          type: array
          items:
            $ref: '#/components/schemas/ResourceEnvelope'
    ConnectPlaidRequest:
      type: object
      description: >-
        Connect a bank account via Plaid by exchanging the public token from
        Plaid Link
      required:
        - type
        - public_token
      properties:
        type:
          type: string
          enum:
            - plaid
          description: Funding source type
          example: plaid
        public_token:
          type: string
          description: Public token from Plaid Link
          example: public-production-abc123def456
    ConnectManualRequest:
      type: object
      description: Add a bank account manually with bank details
      required:
        - type
        - bank_name
        - account_holder_name
        - account_number
      properties:
        type:
          type: string
          enum:
            - manual
          description: Funding source type
          example: manual
        bank_name:
          type: string
          description: Name of the bank
          example: First National Bank
        account_holder_name:
          type: string
          description: Name of the account holder
          example: Jane Doe
        bank_account_type:
          type: string
          enum:
            - CHECKING
            - SAVINGS
          description: Bank account type
          example: CHECKING
        account_number:
          type: string
          minLength: 4
          description: Bank account number
          example: '1234567890'
        routing_number:
          type: string
          description: 9-digit ABA routing number (US accounts)
          example: '021000021'
        swift_code:
          type: string
          description: SWIFT/BIC code (international accounts)
          example: FNBMUS33
        beneficiary_address:
          type: string
          description: Beneficiary address
          example: 123 Main St, New York, NY 10001
        currency:
          type: string
          description: 3-letter currency code
          example: USD
        country:
          type: string
          description: 2-letter country code
          example: US
        bank_code:
          type: string
          description: Bank code (for non-US accounts)
        address_line_1:
          type: string
          description: Beneficiary street line (wire payout)
        city:
          type: string
          description: Beneficiary city (wire payout)
        region:
          type: string
          description: State / province / region (wire payout)
        postal_code:
          type: string
          description: Postal or ZIP code (wire payout)
        iban:
          type: string
          description: IBAN for jurisdictions that use it (wire payout)
        wire_routing_kind:
          type: string
          maxLength: 32
          description: >
            When `bank_code` carries a non-US routing identifier, set this to
            the Alpaca routing-code type

            consumed only by the custodian layer (e.g. `sort_code`, `ifsc`).
            Omit for US ABA (`routing_number`).
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Arbitrary metadata key-value pairs
    ResourceEnvelope:
      type: object
      description: |
        Resource envelope. Domain fields are spread after the
        envelope keys (`id`, `object`, `created`, `livemode`, `metadata`).
        Some Bluum-original resources may emit only `object` + `livemode`
        without `id` / `created` (e.g. one-off action results).
      required:
        - object
        - livemode
      additionalProperties: true
      properties:
        id:
          type: string
          description: Prefixed public id (e.g. `inv_…`, `ord_…`, `dep_…`).
          example: inv_01j9x8m2k7qpzwv3t5r6y8n0ab
        object:
          type: string
          description: The resource type discriminator.
          example: investor
        created:
          type: integer
          nullable: true
          description: Unix-seconds timestamp of resource creation.
          example: 1747776000
        livemode:
          type: boolean
          description: |
            Whether this resource was created against a live API key.
            Test-mode keys always return `false`.
          example: false
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Partner-set key/value map for cross-referencing.
    ErrorEnvelope:
      type: object
      description: |
        Error envelope. The Bluum-specific `BLUM-XXX-XXX`
        code is carried in `error.code`; `error.type` is the broad
        category clients branch on.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - conflict_error
                - idempotency_error
                - rate_limit_error
                - api_error
              example: invalid_request_error
            code:
              type: string
              description: The Bluum-specific error code.
              example: BLUM-400-001
            message:
              type: string
              description: Developer-facing message.
            param:
              type: string
              description: Field path of the invalid input.
              example: tax_id
            doc_url:
              type: string
              format: uri
              example: https://docs.bluum.finance/errors/BLUM-400-001
            request_log_url:
              type: string
              format: uri
              description: Deep link to the request log in the partner dashboard.
  responses:
    BadRequestError:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              type: invalid_request_error
              code: BLUM-400-002
              message: Required field 'symbol' is missing.
              param: symbol
    UnauthorizedError:
      description: Authentication information is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              type: authentication_error
              code: BLUM-401-001
              message: Missing or invalid Authorization header.
    NotFoundError:
      description: The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              type: not_found_error
              code: BLUM-404-001
              message: Investor not found.
  securitySchemes:
    BluumApiKeyAuth:
      type: http
      scheme: basic
      description: >
        HTTP Basic Authentication using the **API Key** as username and **API
        Secret** as password.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        JWT token from Clerk authentication

````