Skip to main content
POST
/
v1
/
onramp
/
quote
Get a fiat-to-crypto quote
curl --request POST \
  --url https://api.hypermid.io/v1/onramp/quote \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "fiatAmount": 100,
  "fiatCurrency": "USD",
  "cryptoToken": "ETH",
  "cryptoChain": "ethereum",
  "walletAddress": "<string>",
  "paymentMode": "card",
  "userCountry": "US"
}
'
{
  "data": {
    "fiatCurrency": "USD",
    "fiatAmount": 100,
    "cryptoAsset": "ETH",
    "chainId": 1,
    "cryptoAmount": "0.029615",
    "exchangeRate": 3376.65,
    "fees": {
      "networkFee": 2.50,
      "processingFee": 3.49,
      "partnerFee": 0.30,
      "totalFee": 6.29
    },
    "totalFiatAmount": 106.29,
    "paymentMethod": "credit_card",
    "expiresAt": 1711234877
  },
  "error": null,
  "meta": {
    "requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
    "timestamp": 1711234577,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1983,
      "reset": 1711234627
    }
  }
}
Returns a price quote for purchasing crypto with fiat currency, including exchange rate, fees, and estimated crypto amount.
fiatCurrency
string
required
The fiat currency code (e.g., USD, EUR, GBP).
cryptoAsset
string
required
The crypto asset symbol (e.g., ETH, USDC, BTC).
chainId
number
required
The chain ID to receive crypto on (e.g., 1 for Ethereum).
fiatAmount
number
required
The fiat amount to spend.
paymentMethod
string
required
Payment method: credit_card, debit_card, or bank_transfer.
walletAddress
string
required
The wallet address to receive crypto.
{
  "data": {
    "fiatCurrency": "USD",
    "fiatAmount": 100,
    "cryptoAsset": "ETH",
    "chainId": 1,
    "cryptoAmount": "0.029615",
    "exchangeRate": 3376.65,
    "fees": {
      "networkFee": 2.50,
      "processingFee": 3.49,
      "partnerFee": 0.30,
      "totalFee": 6.29
    },
    "totalFiatAmount": 106.29,
    "paymentMethod": "credit_card",
    "expiresAt": 1711234877
  },
  "error": null,
  "meta": {
    "requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
    "timestamp": 1711234577,
    "rateLimit": {
      "limit": 2000,
      "remaining": 1983,
      "reset": 1711234627
    }
  }
}
const quote = await client.getOnrampQuote({
  fiatCurrency: "USD",
  cryptoAsset: "ETH",
  chainId: 1,
  fiatAmount: 100,
  paymentMethod: "credit_card",
  walletAddress: "0xYourAddress",
});

console.log(`$100 USD = ${quote.data.cryptoAmount} ETH`);
console.log(`Total charge: $${quote.data.totalFiatAmount}`);
console.log(`Fees: $${quote.data.fees.totalFee}`);

Authorizations

X-API-Key
string
header
required

Partner API key. Optional for public endpoints, required for /v1/partner/*.

Body

application/json
fiatAmount
number
required
Example:

100

fiatCurrency
string
required
Example:

"USD"

cryptoToken
string
required
Example:

"ETH"

cryptoChain
string
required
Example:

"ethereum"

walletAddress
string
paymentMode
string
Example:

"card"

userCountry
string
Example:

"US"

Response

Quote returned

data
any
required

Response payload (null on error)

error
object
required
meta
object
required