Quote

Get a fixed-rate quote between BRL and any supported asset before committing to an on-ramp or off-ramp.

POST /api/quote

Returns a price + fee breakdown plus a short-lived quoteToken. Pass the token to a downstream endpoint (/api/deposit/asset, /api/withdraw/pix) to lock the displayed rate.

Quotes expire 2 minutes after creation. Always show the user the exact outputAmount you receive — this is the number the downstream call will honor.

Request

curl --request POST \
  --url https://api.hodle.com.br/api/quote \
  --header "Authorization: Bearer $API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "inputCurrency": "BRL",
    "inputPaymentMethod": "PIX",
    "outputCurrency": "USDC",
    "outputPaymentMethod": "BASE",
    "inputAmount": "100.00"
  }'
const res = await fetch('https://api.hodle.com.br/api/quote', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.HODLE_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    inputCurrency: 'BRL',
    inputPaymentMethod: 'PIX',
    outputCurrency: 'USDC',
    outputPaymentMethod: 'BASE',
    inputAmount: '100.00',
  }),
})
const data = await res.json()
import os, requests

res = requests.post(
    "https://api.hodle.com.br/api/quote",
    headers={
        "Authorization": f"Bearer {os.environ['HODLE_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "inputCurrency": "BRL",
        "inputPaymentMethod": "PIX",
        "outputCurrency": "USDC",
        "outputPaymentMethod": "BASE",
        "inputAmount": "100.00",
    },
)
data = res.json()

Parameters

FieldTypeRequiredDescription
inputCurrencystringYesBRL, USDT, USDC, USDB, LBTC, BTC.
inputPaymentMethodstringYesPIX, POLYGON, BASE, TRON, LIQUID, LIGHTNING, SPARK.
outputCurrencystringYesSame set as inputCurrency.
outputPaymentMethodstringYesSame set as inputPaymentMethod.
inputAmountstringYes (or outputAmount)Amount in inputCurrency. Decimal string.
outputAmountstringYes (or inputAmount)Amount in outputCurrency. Use this for exact-out quotes.
outputBrCodestringNoPIX BR Code if the output is going to a known PIX recipient. Locks third-party-pricing rules.

Pass exactly one of inputAmount or outputAmount.

Response

200 OK
{
  "success": true,
  "data": {
    "quoteToken": "qt_8f3a4b...",
    "pairName": "BRL-USDC",
    "basePrice": "0.18634",
    "inputCurrency": "BRL",
    "outputCurrency": "USDC",
    "inputAmount": "100.00",
    "outputAmount": "18.41",
    "appliedFees": [
      { "type": "MARKUP",        "amount": "0.20", "currency": "USDC" },
      { "type": "INPUT_FIXED",   "amount": "0.50", "currency": "BRL"  },
      { "type": "OUTPUT_FIXED",  "amount": "0.05", "currency": "USDC" }
    ],
    "expiresAt": "2026-05-09T22:02:00.000Z"
  }
}
FieldTypeDescription
data.quoteTokenstringPass to the next call (/api/deposit/asset or /api/withdraw/pix).
data.basePricestringMid-market outputCurrency per 1 unit of inputCurrency before fees.
data.outputAmountstringWhat the user actually receives after fees are applied.
data.appliedFeesarrayItemised — your UI can render each line.
data.expiresAtstringISO timestamp; after this, re-quote.

Errors

400 — pair not supported
{ "success": false, "error": "No route for BRL-LBTC at this time" }
400 — amount below minimum
{ "success": false, "error": "inputAmount must be at least 1.00 BRL" }
410 — quote expired
{ "success": false, "error": "Quote expired at 2026-05-09T22:02:00.000Z" }

Common quote shapes

Use caseInputOutput
BRL → USDC (Base) on-rampBRL / PIXUSDC / BASE
BRL → USDT (Polygon) on-rampBRL / PIXUSDT / POLYGON
USDT (Tron) → BRL off-rampUSDT / TRONBRL / PIX
BRL → BTC (Lightning) on-rampBRL / PIXBTC / LIGHTNING
Lightning → BRL off-rampBTC / LIGHTNINGBRL / PIX
Lightning → USDB (Spark via Flashnet AMM)BTC / LIGHTNINGUSDB / SPARK