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/quote

Authentication

Requires HMAC authentication headers:

  • x-client-id: Your project's client ID

  • x-signature: HMAC-SHA256 signature

  • x-timestamp: Request timestamp (optional)

Check our authentication guide for more info.

Request Parameters

Required Fields

Parameter
Type
Description

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:

Method
Description
Value Format
Example

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 BRL

  • Crypto 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"

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"
  }'

Implementation Notes

Recipient Requirements

  • Recipient must exist and belong to your project

  • Must have crypto settlement details configured:

    • toChain: Target blockchain ID

    • toToken: Token contract address

    • toAddress: Wallet address for delivery

Quote Expiration

  • Quotes typically expire after 5-10 minutes

  • Check expiresAt field for exact expiration time

  • Execute 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.

Next Steps

After receiving a quote:

  1. Display deposit instructions to user

  2. For PIX: Show QR code or copy PIX key

  3. Monitor payment status

  4. Execute the quote by completing deposit

Last updated