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

# Quote a fiat purchase

> Prices a fiat purchase — how much crypto a given amount of currency buys, including the onramp fee.

The onramp fee is set by the provider, not by Hypermid, and is reported back on the completed order.



## OpenAPI

````yaml /api-reference/openapi.json post /onramp/quote
openapi: 3.1.0
info:
  title: Hypermid API
  description: >-
    Price and execute cross-chain swaps, read reference data and payer balances,
    and quote the fiat on-ramp. Quotes return an executable `transactionRequest`
    your frontend submits directly, so Hypermid never custodies the funds.


    Payments — `checkout`, `deposit`, and `withdrawal` sessions — and
    payment-link management are available through these merchant REST endpoints
    and the [`@hypermid/sdk`](https://docs.hypermid.io/sdk/payments) package.
    Payer-facing routes are intentionally omitted.
  version: 0.2.0
  contact: {}
servers:
  - url: https://server.hypermid.io
    description: Production — live keys (sk_live_…)
  - url: https://server.hypermid.io
    description: Sandbox — test keys (sk_test_…), testnets only
security: []
tags:
  - name: payments
    description: >-
      Create and read payment sessions, manage webhooks, and configure payout
      addresses with a secret partner key.
  - name: payment links
    description: >-
      Create, read, version, and revoke reusable checkout payment links with a
      secret partner key.
  - name: quote
    description: >-
      Route pricing for the orchestration product. Returns an executable
      `transactionRequest` your frontend submits directly, so Hypermid never
      custodies the funds.
  - name: status
    description: >-
      Resolve the state of a submitted swap or transfer. Two endpoints with
      different audiences — see each one's description before choosing.
  - name: catalog
    description: >-
      Reference data an integration needs to render a picker: supported chains
      and tokens, prices, routable connections, and fee configuration. A sandbox
      key sees only testnets here.
  - name: balances
    description: Read a payer wallet's token balances across supported chains.
  - name: onramp
    description: >-
      The fiat rail — card and bank payment for crypto, quoted and settled
      through our onramp partner. Requires per-partner onramp credentials on
      your account.
  - name: webhooks
    description: >-
      Events Hypermid sends TO you when a session completes. These are requests
      we make to your server, not endpoints you call.
paths:
  /onramp/quote:
    post:
      tags:
        - onramp
      summary: Quote a fiat purchase
      description: >-
        Prices a fiat purchase — how much crypto a given amount of currency
        buys, including the onramp fee.


        The onramp fee is set by the provider, not by Hypermid, and is reported
        back on the completed order.
      operationId: OnrampController_quote
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnrampQuoteRequestDto'
      responses:
        '201':
          description: ''
      security:
        - x-api-key: []
components:
  schemas:
    OnrampQuoteRequestDto:
      type: object
      properties:
        srcAmount:
          type: string
          description: >-
            Fiat amount to spend (decimal string). Omit for a reverse quote —
            supply `dstAmount` instead and the provider computes this.
          example: '100'
        dstAmount:
          type: string
          description: >-
            Destination crypto amount to receive (decimal string). When set,
            this is a REVERSE quote: the provider computes the `srcAmount`
            (fiat) needed to deliver it, and `srcAmount` must be omitted. Used
            by fixed-price checkouts.
          example: '5'
        srcCurrency:
          type: string
          description: Fiat currency code (ISO 4217).
          example: USD
        dstCurrency:
          type: string
          description: Destination crypto asset symbol.
          example: USDC
        dstChain:
          type: string
          description: >-
            Destination chain code, as used by the fiat provider. Read the
            supported set from the onramp config endpoint rather than assuming
            it matches a chain id.
          example: base
        paymentMode:
          type: string
          description: Payment method code. Defaults to `card`.
          example: card
        walletAddress:
          type: string
          description: Payer wallet address (defaults to a sentinel when unconnected).
        userCountry:
          type: string
          description: ISO 3166-1 alpha-2 user country. Defaults to `US`.
          example: US
      required:
        - srcCurrency
        - dstCurrency
        - dstChain
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Soft-auth read routes accept `x-api-key` with a publishable or partner
        key; money-moving routes require a secret partner key in `Authorization:
        Bearer`.

````