Quote
Price a BRL to asset conversion, with the full fee breakdown, before you run an on-ramp or off-ramp.
POST /api/quote
Returns a price + itemised fee breakdown for a pair, so you can show the user what they will get before they commit.
A quote is pricing, not a rate lock. No endpoint accepts a
quoteTokentoday —/api/deposit/assetand/api/wallet/payoutboth price at execution time. TreatoutputAmountas indicative, quote immediately before executing, and show the user the amount the operation response returns as the final one.
expiresAtis set 2 minutes after creation. It marks when the displayed price is stale enough that you should re-quote — it does not reserve anything.
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
| Field | Type | Required | Description |
|---|---|---|---|
inputCurrency | string | Yes | BRL, USDT, USDC, USDB, LBTC, BTC. |
inputPaymentMethod | string | Yes | PIX, POLYGON, BASE, TRON, LIQUID, LIGHTNING, SOLANA, SPARK. |
outputCurrency | string | Yes | Same set as inputCurrency. |
outputPaymentMethod | string | Yes | Same set as inputPaymentMethod. |
inputAmount | string | Yes (or outputAmount) | Amount in inputCurrency. Decimal string. |
outputAmount | string | Yes (or inputAmount) | Amount in outputCurrency. Use this for exact-out quotes. |
outputBrCode | string | No | PIX BR Code, when the output goes to a known PIX recipient. Used to route and price this quote. It carries no third-party permission — third-party operations are authorised per account, see Third-party operations. |
Pass exactly one of inputAmount or outputAmount.
Response
{
"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"
}
}| Field | Type | Description |
|---|---|---|
data.quoteToken | string | Provider-side reference, returned for traceability. No Hodle endpoint accepts it as input — it does not lock the rate. |
data.basePrice | string | Mid-market outputCurrency per 1 unit of inputCurrency before fees. |
data.outputAmount | string | What the user actually receives after fees are applied. |
data.appliedFees | array | Itemised — your UI can render each line. |
data.expiresAt | string | ISO timestamp; after this, re-quote. |
data.settlement | object | Only present when outputPaymentMethod is SOLANA. See Solana quotes. |
Solana quotes
SOLANA is only routable with USDT or USDC; any other currency on that
payment method answers 400 "No route ... at this time".
A Solana quote is priced on the Base leg, because that is where the money actually lands before it moves: a Pix on-ramp settles USDC on Base and Relay then bridges it to the destination Solana address. The response says so explicitly:
{
"success": true,
"data": {
"outputAmount": "18.41",
"settlement": {
"quotedNetwork": "BASE",
"deliveryNetwork": "SOLANA",
"bridge": "relay",
"bridgeFeeIncluded": false
}
}
}bridgeFeeIncluded: false is the part to plan around — the Relay bridge cost is
charged on delivery, so the amount that lands on Solana is marginally below
outputAmount. Do not treat a Solana quote as an exact-out guarantee.
Errors
{ "success": false, "error": "No route for BRL-USDC at this time" }{ "success": false, "error": "inputAmount must be at least 1.00 BRL" }There is no "expired quote" error, because nothing consumes the quote. Once expiresAt has passed, call /api/quote again.
Common quote shapes
| Use case | Input | Output |
|---|---|---|
| BRL → USDC (Base) on-ramp | BRL / PIX | USDC / BASE |
| BRL → USDT (Polygon) on-ramp | BRL / PIX | USDT / POLYGON |
| BRL → USDC (Solana) on-ramp | BRL / PIX | USDC / SOLANA |
| USDC (Solana) → BRL off-ramp | USDC / SOLANA | BRL / PIX |
| USDT (Tron) → BRL off-ramp | USDT / TRON | BRL / PIX |
| BRL → BTC (Lightning) on-ramp | BRL / PIX | BTC / LIGHTNING |
| Lightning → BRL off-ramp | BTC / LIGHTNING | BRL / PIX |
| Lightning → USDB (Spark via Flashnet AMM) | BTC / LIGHTNING | USDB / SPARK |