Quotes API

The Quotes API provides real-time price quotes for cryptocurrency conversions. Use quotes to display accurate pricing before creating payments.

Get Quote

Get a price quote for converting between currencies. Quotes are valid for 30 seconds.

POST /v1/quotes

Request Body

ParameterTypeRequiredDescription
fromCurrencystringYesSource currency (e.g., USD, ETH, BTC)
toCurrencystringYesTarget currency (e.g., USDC, ETH)
amountstringYesAmount to convert
chainstringNoBlockchain for token prices

Example Request

curl -X POST https://api.monterrey.app/v1/quotes \
  -H "X-API-Key: mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "fromCurrency": "USD",
    "toCurrency": "ETH",
    "amount": "100.00",
    "chain": "ethereum"
  }'

Response

{
  "id": "quote_abc123",
  "fromCurrency": "USD",
  "toCurrency": "ETH",
  "fromAmount": "100.00",
  "toAmount": "0.041234",
  "rate": "0.00041234",
  "chain": "ethereum",
  "validUntil": "2024-01-15T10:30:30Z",
  "fees": {
    "network": "0.001",
    "service": "0.50"
  }
}

Supported Currencies

Fiat Currencies

  • USD - US Dollar
  • EUR - Euro
  • GBP - British Pound
  • MXN - Mexican Peso

Cryptocurrencies

SymbolNameChains
ETHEthereumethereum, arbitrum, optimism, base
USDCUSD Coinethereum, polygon, arbitrum, optimism, base
USDTTetherethereum, polygon, arbitrum
DAIDaiethereum, polygon, arbitrum, optimism
WBTCWrapped Bitcoinethereum, polygon, arbitrum
MATICPolygonpolygon

Quote Validity

Quotes are valid for 30 seconds from creation. After expiration, you must request a new quote. The validUntil field indicates when the quote expires.

SDK Examples

import { MonterreyClient } from "@monterrey/sdk";

const monterrey = new MonterreyClient({
  apiKey: process.env.MONTERREY_API_KEY,
});

// Get a quote
const quote = await monterrey.quotes.create({
  fromCurrency: "USD",
  toCurrency: "USDC",
  amount: "50.00",
  chain: "polygon",
});

console.log(`$50 USD = ${quote.toAmount} USDC`);
console.log(`Rate: ${quote.rate}`);
console.log(`Valid until: ${quote.validUntil}`);

// Use quote to create payment
if (new Date(quote.validUntil) > new Date()) {
  const payment = await monterrey.payments.create({
    merchantRef: "order_123",
    amount: quote.toAmount,
    currency: "USDC",
    chain: "polygon",
    quoteId: quote.id, // Lock in the quoted rate
  });
}

Fees

Quote responses include fee breakdowns:

  • Network fees: Estimated blockchain transaction costs
  • Service fees: monterrey.app processing fee (0.5%)

All fees are included in the quoted toAmount - what you see is what the customer pays.

    Documentation | Monterrey