> ## 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 a withdrawal

> Checks withdrawal availability, fees, and processing time. Stock-funded previews require a current price and compatible sell quote.



## OpenAPI

````yaml swagger/v3.yaml POST /v3/wallets/{id}/withdrawal-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}/withdrawal-preview:
    post:
      tags:
        - Portfolio Wallets
      summary: Preview a withdrawal
      description: >-
        Checks withdrawal availability, fees, and processing time. Stock-funded
        previews require a current price and compatible sell quote.
      operationId: withdrawalPreviewWalletV3
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Wallet ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - destinationChain
                - token
              properties:
                memo:
                  $ref: '#/components/schemas/StellarMemo'
                destinationChain:
                  type: string
                  description: Destination network for the withdrawal.
                  enum:
                    - arbitrum
                    - base
                    - ethereum
                    - ethereum_sepolia
                    - polygon
                    - solana
                    - solana_devnet
                    - stellar
                    - stellar_testnet
                    - tempo
                    - tempo_moderato
                    - tron
                    - tron_shasta
                token:
                  $ref: '#/components/schemas/PortfolioWalletWithdrawalToken'
                amountUsd:
                  type: string
                  pattern: ^(?!0(?:\.0{1,6})?$)(?:0|[1-9][0-9]*)(?:\.[0-9]{1,6})?$
                  nullable: true
                  description: >-
                    Gross wallet value as a positive decimal string with at most
                    6 decimal places, before execution fees. Omit to evaluate
                    the maximum gross withdrawable amount. Route limits still
                    apply to that resolved amount.
                sources:
                  type: array
                  minItems: 1
                  description: >-
                    Optional gross cash contribution by source when automatic
                    rebalancing is disabled. Omit it to let Ground select
                    sources automatically.
                  items:
                    type: object
                    required:
                      - assetId
                      - amountUsd
                    properties:
                      amountUsd:
                        type: string
                        pattern: >-
                          ^(?:[1-9][0-9]*(?:\.[0-9]{1,6})?|0\.(?:[1-9][0-9]{0,5}|0[1-9][0-9]{0,4}))$
                        description: >-
                          Gross cash contribution as a decimal string with at
                          most 6 decimal places. Stock redemptions may convert a
                          bounded share buffer; excess proceeds remain in the
                          wallet. Minimum $0.01 per source.
                      stockPriceTolerancePct:
                        type: number
                        minimum: 0
                        maximum: 5
                        default: 1
                        description: >-
                          Optional maximum difference between an Ondo stock
                          redemption quote and its reference price for this
                          source. Other sources ignore this field.
                        multipleOf: 0.01
                      assetId:
                        $ref: '#/components/schemas/AssetId'
                partnerFeeAmountUsd:
                  type: string
                  pattern: ^(?!0(?:\.0{1,6})?$)(?:0|[1-9][0-9]*)(?:\.[0-9]{1,6})?$
                  description: >-
                    Partner-calculated fee as a decimal string for a USDC or
                    USDT withdrawal on a supported EVM network, or a TRON USDT
                    withdrawal. Must be positive, smaller than `amountUsd` when
                    provided, have at most 6 decimal places, and be supplied
                    with `partnerFeeRecipientAddress`.
                partnerFeeRecipientAddress:
                  $ref: >-
                    #/components/schemas/PortfolioWalletPartnerFeeRecipientAddress
            example:
              destinationChain: arbitrum
              amountUsd: '50.000000'
              token: usdc
              partnerFeeAmountUsd: '0.500000'
              partnerFeeRecipientAddress: '0x1111111111111111111111111111111111111111'
      responses:
        '200':
          description: Withdrawal preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalPreview'
              example:
                amountRequestedUsd: '50.000000'
                feeUsd: '0.001000'
                partnerFeeUsd: '0.500000'
                amountToReceiveUsd: '49.499000'
                withdrawableUsd: '1000.000000'
                totalUsdAfterWithdrawal: '950.000000'
                processingEstimate:
                  min: 1260
                  max: 1260
                  unit: seconds
        '400':
          description: >-
            Invalid request, unsupported destination chain, or Tempo beta limit
            exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unsupported_chain:
                  value:
                    error: Unsupported chain
                    code: unsupported_chain
                tempo_beta_transfer_limit_exceeded:
                  value:
                    error: >-
                      Tempo beta withdrawals are limited to 100.000000 USDC.e
                      per request
                    code: tempo_beta_transfer_limit_exceeded
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Wallet not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                wallet_not_found:
                  value:
                    error: Wallet not found
                    code: wallet_not_found
        '409':
          description: Insufficient funds
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - code
                  - amountRequestedUsd
                  - balance
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                      - insufficient_funds
                  amountRequestedUsd:
                    type: string
                  balance:
                    type: object
                    required:
                      - totalUsd
                      - withdrawableUsd
                      - reservedUsd
                    properties:
                      totalUsd:
                        type: string
                      withdrawableUsd:
                        type: string
                      reservedUsd:
                        type: string
              examples:
                insufficient_funds:
                  value:
                    error: >-
                      Requested amount exceeds available balance for this
                      destination
                    code: insufficient_funds
                    amountRequestedUsd: '50.000000'
                    balance:
                      totalUsd: '800.000000'
                      withdrawableUsd: '700.000000'
                      reservedUsd: '100.000000'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          description: >-
            A current stock price or indicative sell quote is unavailable; retry
            the preview later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
              example:
                error: A current stock price is unavailable. Retry later.
                code: service_temporarily_unavailable
components:
  schemas:
    StellarMemo:
      type: object
      additionalProperties: false
      required:
        - type
        - value
      description: >-
        Optional recipient memo for Stellar withdrawals. Text is 1–28 UTF-8
        bytes without null characters. ID is an unsigned 64-bit integer string
        (0–18446744073709551615); leading zeros are normalized. Omit for no
        memo.
      properties:
        type:
          type: string
          enum:
            - id
            - text
        value:
          type: string
          minLength: 1
          maxLength: 28
      example:
        type: id
        value: '123456'
    PortfolioWalletWithdrawalToken:
      type: string
      enum:
        - usdc
        - usdt
        - ousd
      description: Token delivered by the withdrawal.
    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.
    PortfolioWalletPartnerFeeRecipientAddress:
      type: string
      description: >-
        Recipient of the partner fee on the destination network. Supported for
        EVM and TRON payouts; supply a valid address for that network together
        with partnerFeeAmountUsd. In the withdrawal request it must differ from
        destinationAddress. Not supported for Solana, Stellar, or Tempo payouts.
    WithdrawalPreview:
      type: object
      required:
        - amountRequestedUsd
        - feeUsd
        - partnerFeeUsd
        - amountToReceiveUsd
        - withdrawableUsd
        - totalUsdAfterWithdrawal
        - processingEstimate
      properties:
        memo:
          $ref: '#/components/schemas/StellarMemo'
        amountRequestedUsd:
          type: string
          description: >-
            Gross wallet value evaluated by this preview. Equals the requested
            amount, or the resolved maximum gross withdrawable amount when
            `amountUsd` was omitted.
        feeUsd:
          type: string
          description: >-
            Estimated execution fee deducted from the gross requested amount,
            including yield source protocol exit fees.
        partnerFeeUsd:
          type: string
          description: Partner fee deducted from the gross requested amount.
        amountToReceiveUsd:
          type: string
          description: >-
            Estimated net amount to be sent to the destination after execution
            and partner fees are deducted from the gross requested amount.
        withdrawableUsd:
          type: string
          description: >-
            Maximum gross wallet value that can safely start a new withdrawal
            for this destination right now.
        totalUsdAfterWithdrawal:
          type: string
          description: >-
            Estimated wallet total after the gross requested amount is removed,
            including owned holdings that cannot fund this destination.
        processingEstimate:
          $ref: '#/components/schemas/WithdrawalProcessingTimeRange'
    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
    ServiceUnavailableError:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            retryable:
              type: boolean
              description: Whether the client should retry with the same requestId
    WithdrawalProcessingTimeRange:
      type: object
      nullable: true
      additionalProperties: false
      description: >-
        Estimated elapsed seconds for the selected withdrawal route after
        applying provider calendars, holidays, and cutoffs. Bounds preserve
        day-level uncertainty when only settlement dates are known. A preview is
        anchored at the preview time; a workflow range is measured from request
        acceptance, not a countdown. Null means no reliable estimate is
        available. The upper bound is typical, not a guaranteed deadline.
      required:
        - min
        - max
        - unit
      properties:
        min:
          type: integer
          minimum: 0
          description: Lower end of the typical elapsed processing range in seconds.
        max:
          type: integer
          minimum: 0
          description: Upper end of the typical elapsed range in seconds, at least min.
        unit:
          type: string
          enum:
            - seconds
    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.
  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
    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.