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

# Get swap quote

> Quote a move between two accounts the user owns — USDC<->EURC on the Base wallet, or the wallet <-> a the banking provider USD virtual account. Every solver that can serve the route is compared and `allQuotes` ranks them; `executionContract` says how to execute the winner (docs/balance-swap.md).



## OpenAPI

````yaml /openapi.json post /api/v1/balance/swap/quote
openapi: 3.1.0
info:
  title: HEVN API
  description: Backend API for HEVN mobile neobank
  version: 0.1.2
servers: []
security: []
paths:
  /api/v1/balance/swap/quote:
    post:
      tags:
        - Balance
      summary: Get swap quote
      description: >-
        Quote a move between two accounts the user owns — USDC<->EURC on the
        Base wallet, or the wallet <-> a the banking provider USD virtual
        account. Every solver that can serve the route is compared and
        `allQuotes` ranks them; `executionContract` says how to execute the
        winner (docs/balance-swap.md).
      operationId: get_swap_quote_api_v1_balance_swap_quote_post
      parameters:
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SwapQuoteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapQuoteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SwapQuoteRequest:
      properties:
        from:
          anyOf:
            - type: string
              format: uuid
            - type: string
              const: hevn
          title: From
          default: hevn
        to:
          anyOf:
            - type: string
              format: uuid
            - type: string
              const: hevn
          title: To
          default: hevn
        fromToken:
          anyOf:
            - $ref: '#/components/schemas/PayoutSourceToken'
            - type: 'null'
        toToken:
          anyOf:
            - $ref: '#/components/schemas/PayoutSourceToken'
            - type: 'null'
        amount:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Amount
        amountTo:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Amountto
        swapType:
          $ref: '#/components/schemas/SwapType'
          default: FLEX_INPUT
        providers:
          anyOf:
            - items:
                $ref: '#/components/schemas/CrossChainProvider'
              type: array
            - type: 'null'
          title: Providers
      type: object
      title: SwapQuoteRequest
      description: |-
        Quote a move between two accounts the user owns (docs/balance-swap.md).

        ``from``/``to`` name the accounts and default to the HEVN wallet, so the
        original token-swap payload (``fromToken`` + ``toToken`` + ``amount``)
        stays valid.
    SwapQuoteResponse:
      properties:
        quoteId:
          type: string
          title: Quoteid
        fromAmount:
          type: number
          title: Fromamount
        fromCurrency:
          type: string
          title: Fromcurrency
        toAmount:
          type: number
          title: Toamount
        toCurrency:
          type: string
          title: Tocurrency
        minToAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Mintoamount
        slippageBps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Slippagebps
        feeAmount:
          type: number
          title: Feeamount
        fixedFee:
          type: number
          title: Fixedfee
          default: 0
        flatFee:
          type: number
          title: Flatfee
          default: 0
        feeCurrency:
          type: string
          title: Feecurrency
        rate:
          type: number
          title: Rate
        expiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiresat
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        solver:
          anyOf:
            - type: string
            - type: 'null'
          title: Solver
        estimated:
          type: boolean
          title: Estimated
          default: false
        etaHours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Etahours
        allQuotes:
          items:
            $ref: '#/components/schemas/SwapQuoteOption'
          type: array
          title: Allquotes
          default: []
      type: object
      required:
        - quoteId
        - fromAmount
        - fromCurrency
        - toAmount
        - toCurrency
        - feeAmount
        - feeCurrency
        - rate
      title: SwapQuoteResponse
      description: |-
        A price for one move, and every solver that answered.

        How to execute it is submit's answer, not this one: two copies of the
        contract would let a client sign the stale one.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PayoutSourceToken:
      type: string
      enum:
        - USDC
        - EURC
      title: PayoutSourceToken
      description: |-
        Stablecoin a payout (offramp) quote is funded with.

        USDC is the default across all providers. EURC is Align-only: Align
        accepts an EURC deposit for EUR/SEPA offramps (and prices other
        destination currencies through its own FX).
    SwapType:
      type: string
      enum:
        - EXACT_INPUT
        - EXACT_OUTPUT
        - FLEX_INPUT
        - ANY_INPUT
      title: SwapType
      description: Type of swap quote.
    CrossChainProvider:
      type: string
      enum:
        - intents
        - lifi
        - align
        - cowswap
        - aerodrome
      title: CrossChainProvider
      description: Cross-chain swap provider.
    SwapQuoteOption:
      properties:
        solver:
          type: string
          title: Solver
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        toAmount:
          type: number
          title: Toamount
        minToAmount:
          anyOf:
            - type: number
            - type: 'null'
          title: Mintoamount
        feeAmount:
          type: number
          title: Feeamount
        feeCurrency:
          type: string
          title: Feecurrency
        estimated:
          type: boolean
          title: Estimated
          default: false
        etaHours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Etahours
        expiresAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expiresat
      type: object
      required:
        - solver
        - toAmount
        - feeAmount
        - feeCurrency
      title: SwapQuoteOption
      description: One solver's answer for the same route, for client-side comparison.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````