Requesting a Quote
Requesting a Fiat-to-Crypto Quote
Overview
Request a quote to convert fiat currency into cryptocurrency. The quote endpoint provides real-time exchange rates and generates deposit instructions for the fiat payment.
Endpoint
POST /v1/onramp/quoteAuthentication
Requires HMAC authentication headers:
x-client-id: Your project's client IDx-signature: HMAC-SHA256 signaturex-timestamp: Request timestamp (optional)
Check our authentication guide for more info.
Request Parameters
Required Fields
fromCurrency
string
Source fiat currency code (e.g., "BRL")
intent
object
Defines the transaction amount and method
recipientId
string
UUID of the recipient to receive cryptocurrency
Intent Object
The intent object supports three methods to specify transaction amounts:
fromAmount
Exact fiat amount to spend
Decimal string representing fiat amount
{ "method": "fromAmount", "value": "500" } means 500 BRL
toAmount
Exact crypto amount to receive
String representing smallest units (wei-equivalent)
{ "method": "toAmount", "value": "100000000000000000000" } means 100 BRZ
usd
USD value for conversion
String representing smallest units (18 decimals)
{ "method": "usd", "value": "100000000000000000000" } means $100 USD
Important:
Fiat amounts (
fromAmount) use standard decimal notation:"500"= 500 BRLCrypto amounts (
toAmount) use smallest units based on token decimals:"100000000000000000000"= 100 tokens (18 decimals)USD amounts (
usd) use 18 decimals like Ether:"100000000000000000000"= $100 USD
Amount Formats
Understanding Smallest Units
Cryptocurrency amounts are represented in their smallest indivisible units (similar to wei for Ether):
18-Decimal Tokens (BRZ on most chains):
1 BRZ = 1000000000000000000 smallest units
Formula:
smallest_units = amount × 10^18
6-Decimal Tokens (USDC, USDT):
1 USDC = 1000000 smallest units
Formula:
smallest_units = amount × 10^6
Conversion Examples
import { ethers } from 'ethers';
// For 18-decimal tokens (BRZ)
const toSmallestUnits = ethers.parseUnits("100", 18); // "100000000000000000000"
const fromSmallestUnits = ethers.formatUnits("100000000000000000000", 18); // "100.0"
// For USD values (always 18 decimals)
const usdInSmallestUnits = ethers.parseUnits("100", 18); // "100000000000000000000"import Web3 from 'web3';
const web3 = new Web3();
// For 18-decimal tokens
const toSmallestUnits = web3.utils.toWei("100", "ether"); // "100000000000000000000"
const fromSmallestUnits = web3.utils.fromWei("100000000000000000000", "ether"); // "100"
// For 6-decimal tokens
const toSmallestUnits = web3.utils.toWei("100", "mwei"); // "100000000"Request Examples
curl -X POST https://api.orda.network/v1/onramp/quote \
-H "Content-Type: application/json" \
-H "x-client-id: your-client-id" \
-H "x-signature: your-signature" \
-H "x-timestamp: 1234567890" \
-d '{
"fromCurrency": "BRL",
"intent": {
"method": "fromAmount",
"value": "500"
},
"recipientId": "123e4567-e89b-12d3-a456-426614174000"
}'curl -X POST https://api.orda.network/v1/onramp/quote \
-H "Content-Type: application/json" \
-H "x-client-id: your-client-id" \
-H "x-signature: your-signature" \
-H "x-timestamp: 1234567890" \
-d '{
"fromCurrency": "BRL",
"intent": {
"method": "toAmount",
"value": "100000000000000000000"
},
"recipientId": "123e4567-e89b-12d3-a456-426614174000"
}'Note: The value "100000000000000000000" represents 100 BRZ in smallest units (18 decimals).
curl -X POST https://api.orda.network/v1/onramp/quote \
-H "Content-Type: application/json" \
-H "x-client-id: your-client-id" \
-H "x-signature: your-signature" \
-H "x-timestamp: 1234567890" \
-d '{
"fromCurrency": "BRL",
"intent": {
"method": "usd",
"value": "100"
},
"recipientId": "123e4567-e89b-12d3-a456-426614174000"
}'Implementation Notes
Recipient Requirements
Recipient must exist and belong to your project
Must have crypto settlement details configured:
toChain: Target blockchain IDtoToken: Token contract addresstoAddress: Wallet address for delivery
Quote Expiration
Quotes typically expire after 5-10 minutes
Check
expiresAtfield for exact expiration timeExecute deposit before expiration to lock in rate
Rate Calculation
Exchange rates include all fees
No hidden charges or additional fees
Rate is guaranteed once deposit is made
Current Flow Limitation
At present, all BRL on-ramp flows are routed through BRZ as an intermediate step:
Now:
BRL → BRZ → Target Asset (e.g. USDC, ETH, AUSD)Future:
BRL → Target Asset(direct)
This means:
When configuring a recipient, you must first enable BRZ settlement.
Additional conversions (BRZ → USDC, ETH, etc.) are handled automatically, but they add one extra step in the flow.
⚠️ Note: Direct BRL → asset settlement is in development. Once live, you’ll be able to on-ramp directly into USDC, ETH or other supported tokens with a single transaction.
Next Steps
After receiving a quote:
Display deposit instructions to user
For PIX: Show QR code or copy PIX key
Monitor payment status
Execute the quote by completing deposit
Last updated