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

# Preview wallet allocation

> Previews movements between asset UUIDs within a wallet, including cash and not-yet-held destinations. Returns projected asset changes.

Use `fromAssetId` and `toAssetId` from the catalog for cash, funds, and stocks.
The source must have an available balance in this wallet; the destination need
not be held yet. The response's `changes` identify assets and show projected
values. Preview does not create a holding. `assetQuotes`, when present, contain
indicative stock quotes. Submit the same movements to
[Allocate wallet funds](https://docs.groundtech.co/v3/api-reference/allocate.md) after a successful preview.

Tempo beta plans may spend at most 100 USDC.e of Tempo cash across all legs.
An oversized plan returns `400 tempo_beta_transfer_limit_exceeded`.
Ground does not split or reduce the plan to fit.
Preview validates whether a movement is supported for this wallet.


## OpenAPI

````yaml swagger/v3.yaml POST /v3/wallets/{id}/allocate-preview
openapi: 3.0.0
info:
  title: Ground API
  description: API for Portfolio Wallets, gtokens, MicroVaults, and webhooks.
  version: 3.0.0
servers:
  - url: https://sandbox.groundtech.co
  - url: https://production.groundtech.co
security:
  - bearerAuth: []
tags:
  - name: System
    description: System health and utility endpoints.
  - name: Sandbox Faucets
    description: Sandbox-only test token faucets.
  - name: Portfolio Wallets
    description: >-
      Portfolio wallets with strategy allocation, deposits, withdrawals, and
      yield positions.
  - name: gVaults
    description: >-
      Direct access to gtokens with deposit access controls and optional fee
      wrappers.
  - name: MicroVaults
    description: >-
      Customer-owned onchain vaults with externally held ERC-20 shares. Private
      preview.
  - name: Webhook Endpoints
    description: Webhook endpoint management for portfolio wallet notifications.
paths:
  /v3/wallets/{id}/allocate-preview:
    post:
      tags:
        - Portfolio Wallets
      summary: Preview an allocation for a wallet without automatic rebalancing
      description: >-
        Previews movements between asset UUIDs within a wallet, including cash
        and not-yet-held destinations. Returns projected asset changes.
      operationId: previewWalletAllocationV3
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Wallet ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AllocationPreviewRequest'
            examples:
              purchaseAssets:
                summary: Buy a fund and a stock
                value:
                  allocations:
                    - fromAssetId: 4ab063cf-303d-4f62-80a6-5a142c1d2fdb
                      toAssetId: 80f900d0-a4b8-4c97-bdc2-8e2ab5228e19
                      amountUsd: '100.000000'
                    - fromAssetId: 4ab063cf-303d-4f62-80a6-5a142c1d2fdb
                      toAssetId: d2ab3e33-f5c9-429d-ac0b-b162397fa92c
                      amountUsd: '100.000000'
                      stockPriceTolerancePct: 1
              redeemToCash:
                summary: Redeem stock to cash
                value:
                  allocations:
                    - fromAssetId: d2ab3e33-f5c9-429d-ac0b-b162397fa92c
                      toAssetId: 4ab063cf-303d-4f62-80a6-5a142c1d2fdb
                      amountUsd: '100.000000'
                      stockPriceTolerancePct: 1
      responses:
        '200':
          description: Allocation preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllocationPreview'
              examples:
                purchaseAssets:
                  summary: Projected fund and stock purchases
                  value:
                    changes:
                      - assetId: 4ab063cf-303d-4f62-80a6-5a142c1d2fdb
                        label: USDC
                        beforeUsd: '250.000000'
                        afterUsd: '50.000000'
                        deltaUsd: '-200.000000'
                      - assetId: 80f900d0-a4b8-4c97-bdc2-8e2ab5228e19
                        label: Morpho Gauntlet USDC Prime
                        beforeUsd: '0.000000'
                        afterUsd: '100.000000'
                        deltaUsd: '100.000000'
                      - assetId: d2ab3e33-f5c9-429d-ac0b-b162397fa92c
                        label: SPDR S&P 500 ETF
                        beforeUsd: '750.000000'
                        afterUsd: '850.000000'
                        deltaUsd: '100.000000'
        '400':
          description: >-
            Invalid or unbalanced allocation changes, a stock quote above the
            selected price limit, or Tempo beta limit exceeded
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                additionalProperties: false
                properties:
                  error:
                    type: string
                  code:
                    type: string
                  requiredStockPriceTolerancePct:
                    type: number
                    minimum: 0
                    maximum: 5
                    description: >-
                      Minimum max slippage for the current indicative stock
                      quote, present only when the quote exceeds the selected
                      limit and is still within the route ceiling. Confirm with
                      the customer before retrying preview.
                    multipleOf: 0.01
                  assetId:
                    type: string
                    description: Stock position whose quote needs the higher limit.
              examples:
                stock_price_tolerance_confirmation_required:
                  value:
                    error: >-
                      The current stock quote exceeds your max slippage. Review
                      the higher limit before continuing.
                    code: validation_error
                    requiredStockPriceTolerancePct: 1.5
                    assetId: ffb32944-f0e4-45b3-ab70-5b4d29849778
                tempo_beta_transfer_limit_exceeded:
                  value:
                    error: >-
                      Tempo beta allocations and rebalances may move at most
                      100.000000 USDC.e out of Tempo per plan
                    code: tempo_beta_transfer_limit_exceeded
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            A new Ondo stock or Etherfuse bond purchase is not enabled for this
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: >-
                  Ondo stock purchases are not enabled for your organization.
                  Contact Ground to request access.
                code: product_not_enabled
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            The wallet settings, balance, route, or current workflow prevent
            this allocation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                operation_not_supported:
                  value:
                    error: >-
                      This wallet has autoRebalance set to true. Use PATCH
                      /v3/wallets/{id}/strategy instead.
                    code: operation_not_supported
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    AllocationPreviewRequest:
      type: object
      required:
        - allocations
      additionalProperties: false
      properties:
        allocations:
          $ref: '#/components/schemas/AllocationMovementsInput'
    AllocationPreview:
      type: object
      required:
        - changes
      properties:
        assetQuotes:
          type: array
          description: >-
            Indicative quotes for stock conversions in the requested paths, in
            path order. Intermediate fees and later execution prices can change
            the result.
          items:
            $ref: '#/components/schemas/StockAllocationQuote'
        changes:
          type: array
          minItems: 2
          description: >-
            Projected asset values after the requested allocation. These are
            estimates, not current holdings.
          items:
            $ref: '#/components/schemas/AllocationPreviewAssetChange'
    ErrorResponse:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: >-
            Human-readable error message. May change without notice; do not
            parse programmatically.
        code:
          type: string
          description: >-
            Machine-readable error code. Use it for programmatic handling rather
            than parsing the error message.
          enum:
            - validation_error
            - unknown_parameters
            - payload_too_large
            - unsupported_media_type
            - submission_id_conflict
            - feedback_unavailable
            - unsupported_chain
            - unsupported_token
            - invalid_destination_address
            - stellar_destination_account_not_active
            - stellar_destination_usdc_not_enabled
            - precision_overflow
            - invalid_cursor
            - unauthenticated
            - forbidden
            - wallet_not_found
            - wallet_limit_reached
            - withdrawal_not_found
            - deposit_not_found
            - yield_source_not_found
            - wallet_projection_unavailable
            - insufficient_funds
            - duplicate_request_id
            - request_id_conflict
            - invalid_position_weight
            - invalid_withdrawal_plan
            - payout_not_found
            - webhook_not_found
            - webhook_duplicate_url
            - withdrawal_not_cancellable
            - withdrawal_already_cancelled
            - withdrawal_payout_in_progress
            - withdrawal_policy_required
            - workflow_conflict
            - stale_rebalance_plan
            - stale_wallet_strategy
            - payout_already_terminal
            - payout_in_progress
            - payout_not_retryable
            - address_book_entry_not_found
            - address_book_duplicate_entry
            - address_book_whitelist_violation
            - rate_limited
            - rate_limit_exceeded
            - internal_error
            - wallet_creation_failed
            - service_temporarily_unavailable
            - operation_not_supported
            - wallet_withdrawal_active
            - stellar_customer_approval_unavailable
            - withdrawal_signing_required
            - wallet_performance_unavailable
            - tempo_beta_transfer_limit_exceeded
            - product_not_enabled
            - gvault_not_found
            - allowlist_update_pending
            - fee_wrapper_not_found
            - fee_wrapper_fee_update_pending
            - statement_too_large
            - no_reportable_wallets
            - report_timeout
            - read_only_api_key
    AllocationMovementsInput:
      type: array
      minItems: 1
      maxItems: 100
      description: >-
        One or more movements using fromAssetId and toAssetId for cash, funds,
        and stocks. The source balance belongs to the wallet in the request
        path. Preview validates whether a movement is supported for this wallet.
      items:
        $ref: '#/components/schemas/AllocationMovementInput'
    StockAllocationQuote:
      type: object
      required:
        - fromAssetId
        - assetId
        - side
        - indicative
        - quotedAt
        - stockNativeUnits
        - stockTokenDecimals
        - cashAssetId
        - cashNativeUnits
        - toAssetId
      properties:
        fromAssetId:
          $ref: '#/components/schemas/AssetId'
        toAssetId:
          $ref: '#/components/schemas/AssetId'
        assetId:
          $ref: '#/components/schemas/AssetId'
        side:
          type: string
          enum:
            - buy
            - sell
        indicative:
          type: boolean
          enum:
            - true
          description: >-
            Execution obtains a fresh quote. This preview does not authorize a
            trade or guarantee a fill.
        quotedAt:
          type: string
          format: date-time
        stockNativeUnits:
          type: string
          pattern: ^[1-9]\d*$
        stockTokenDecimals:
          type: integer
          minimum: 0
        cashNativeUnits:
          type: string
          pattern: ^[1-9]\d*$
          description: >-
            Estimated USDC spend for a buy or receive amount for a sell, in
            native units.
        cashBudgetNativeUnits:
          type: string
          pattern: ^[1-9]\d*$
          description: >-
            Buy budget at this operation. Earlier bridge or redemption fees can
            reduce the budget available at execution.
        unspentCashNativeUnits:
          type: string
          pattern: ^(0|[1-9]\d*)$
          description: Buy budget remaining after the indicative quoted spend.
        minimumCashNativeUnits:
          type: string
          pattern: ^[1-9]\d*$
          description: >-
            Minimum cash receive derived from this sell preview and the current
            route price bounds. A fresh boundary is established at execution.
        cashAssetId:
          $ref: '#/components/schemas/AssetId'
    AllocationPreviewAssetChange:
      type: object
      required:
        - assetId
        - label
        - beforeUsd
        - afterUsd
        - deltaUsd
      properties:
        assetId:
          $ref: '#/components/schemas/AssetId'
        label:
          type: string
        beforeUsd:
          type: string
          pattern: ^(0|[1-9]\d*)\.\d{6}$
          description: >-
            Position value before the allocation, with exactly six decimal
            places.
        afterUsd:
          type: string
          pattern: ^(0|[1-9]\d*)\.\d{6}$
          description: >-
            Requested position value after the allocation, with exactly six
            decimal places. Indicative stock quotes are reported separately;
            execution prices and fees can change the settled value.
        deltaUsd:
          type: string
          pattern: ^-?(0|[1-9]\d*)\.\d{6}$
          description: Signed position value change, with exactly six decimal places.
      description: >-
        Projected value change for a catalog asset in this wallet. Preview does
        not create a holding. Both held and not-yet-held assets use their
        existing catalog UUIDs.
    AuthErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Authentication or authorization error message.
        message:
          type: string
          nullable: true
          description: Additional auth middleware detail, when present.
        code:
          type: string
          nullable: true
          description: >-
            Some auth and scope failures include a stable code; middleware
            errors may omit it.
    AllocationMovementInput:
      $ref: '#/components/schemas/AllocationMovementToAsset'
      description: >-
        A flat movement between catalog asset UUIDs within this wallet. The
        source must be held; the destination need not be held yet. Preview
        validates whether a movement is supported for this wallet.
    AssetId:
      type: string
      format: uuid
      description: >-
        Immutable catalog asset UUID, shared by every wallet in this
        environment. Cash, funds, and stocks use the same identity. Read IDs
        from GET /v3/assets; do not derive them from names, symbols, or wallet
        account IDs.
    AllocationMovementToAsset:
      title: Asset movement
      type: object
      additionalProperties: false
      required:
        - fromAssetId
        - amountUsd
        - toAssetId
      properties:
        fromAssetId:
          $ref: '#/components/schemas/AssetId'
        toAssetId:
          $ref: '#/components/schemas/AssetId'
        amountUsd:
          type: string
          pattern: ^(0|[1-9]\d*)(\.\d{1,6})?$
          description: Positive dollar amount to move, with at most six decimal places.
        stockPriceTolerancePct:
          $ref: '#/components/schemas/AllocationStockPriceTolerancePct'
    AllocationStockPriceTolerancePct:
      type: number
      minimum: 0
      maximum: 5
      default: 1
      description: >-
        Optional maximum difference between an Ondo stock executable quote and
        its reference price for this movement. Used for each stock conversion in
        its route. A preview that needs a higher limit returns 400 with
        requiredStockPriceTolerancePct; review that value before retrying with a
        selected higher limit. This is a price bound, not a fee or a guaranteed
        execution price.
      multipleOf: 0.01
  responses:
    Unauthorized:
      description: >-
        The request is missing a valid bearer token, or the token is invalid or
        expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthErrorResponse'
          example:
            error: Unauthenticated request
            message: Missing or invalid bearer token
    NotFound:
      description: >-
        The requested resource does not exist or is not visible to the
        authenticated organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Portfolio wallet not found
            code: wallet_not_found
    TooManyRequests:
      description: >-
        Rate limit exceeded. Limits are enforced by API key/customer identity
        and by endpoint class. Wait for the number of seconds in Retry-After,
        add a small random delay, then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Rate limit exceeded
            code: rate_limited
    InternalServerError:
      description: >-
        An unexpected error occurred. Reconcile the original operation before
        retrying a write; preserve its required idempotency key and payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
            code: internal_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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