Skip to main content

Introduction

The Quotes API provides real-time pricing for currency conversions. Bipa’s smart order router queries multiple exchange order books simultaneously to find the best available price.

Flexible input

Specify amount in source or target currency, net or gross

Transparent fees

Clear breakdown of total, partner, and Bipa fees

Best execution

Smart routing across multiple exchanges

Partner revenue

Set your own fee and earn on every conversion

How it works

Supported pairs

FromToUse case
BRLUSDTBuy stablecoins with Brazilian Real
USDTBRLSell stablecoins for Brazilian Real
BRLBTCBuy Bitcoin with Brazilian Real
BTCBRLSell Bitcoin for Brazilian Real
USDTBTCConvert stablecoins to Bitcoin
BTCUSDTConvert Bitcoin to stablecoins
All BRL pairs settle instantly. Crypto-to-crypto pairs execute on-chain or via Lightning depending on amount.

The quote object

{
  "id": "quote_abc123xyz",
  "customer_id": "cus_a1b2c3d4e5f6",
  "from_asset": "BRL",
  "to_asset": "BTC",
  "from_amount": "1005000",
  "to_amount": "25000",
  "from_decimals": 2,
  "to_decimals": 8,
  "price": "40200000000",
  "price_decimals": 2,
  "fees": {
    "total": "5000",
    "total_bps": 50,
    "partner": "2500",
    "partner_bps": 25,
    "bipa": "2500",
    "bipa_bps": 25
  },
  "status": "pending",
  "expires_at": "2024-01-15T10:30:30Z",
  "created_at": "2024-01-15T10:30:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique quote identifier
customer_idstringCustomer requesting the quote
from_assetstringSource asset (BRL, USDT, BTC)
to_assetstringTarget asset (BRL, USDT, BTC)
from_amountstringAmount debited from customer (smallest unit)
to_amountstringAmount credited to customer (smallest unit)
from_decimalsintegerDecimal places for source asset
to_decimalsintegerDecimal places for target asset
pricestringExchange price (1 unit of to_asset in from_asset smallest unit)
price_decimalsintegerDecimal places for price display
feesobjectFee breakdown
fees.totalstringTotal fee in from_asset smallest unit
fees.total_bpsintegerTotal fee in basis points
fees.partnerstringPartner’s fee portion in from_asset smallest unit
fees.partner_bpsintegerPartner fee in basis points
fees.bipastringBipa’s fee portion in from_asset smallest unit
fees.bipa_bpsintegerBipa fee in basis points
statusstringQuote status
expires_atstringISO 8601 expiration timestamp
created_atstringISO 8601 creation timestamp

Amount encoding

All amounts use integer strings in the smallest unit:
AssetDecimalsExample
BRL2"100000" = R$ 1,000.00
USDT6"100000000" = 100 USDT
BTC8"1000000" = 0.01 BTC

Net vs Gross amounts

When requesting a quote, specify whether your amount is net or gross:
TypeDescriptionUse case
netAmount the customer receives after fees”I want exactly 0.001 BTC”
grossAmount the customer pays before fees”I want to spend exactly R$ 1,000”
Example: Buying BTC with R$ 1,000 (gross)
Request: amount=100000, amount_type=gross
Result:  from_amount=100000 (R$ 1,000 paid)
         to_amount=24750   (0.0002475 BTC received)
         fees.total=500    (R$ 5 fee)
Example: Buying exactly 0.001 BTC (net)
Request: amount=100000, amount_type=net, amount_asset=BTC
Result:  from_amount=405000 (R$ 4,050 paid)
         to_amount=100000   (0.001 BTC received)
         fees.total=2025    (R$ 20.25 fee)

Partner fees

Partners can set their own fee on each quote using partner_fee_bps. This fee is:
  • Added to the total cost for the customer
  • Split between the partner and Bipa (you keep your portion)
  • Shown transparently in the fees object
// Request with 1% partner fee (100 bps)
{
  "partner_fee_bps": 100
}

// Response shows the split
{
  "fees": {
    "total": "15000",      // R$ 150 total
    "total_bps": 150,
    "partner": "10000",    // R$ 100 partner earns
    "partner_bps": 100,
    "bipa": "5000",        // R$ 50 Bipa earns
    "bipa_bps": 50
  }
}

Quote lifecycle

StateDurationDescription
pending30 secondsQuote can be executed
expiredAfter 30sMust request a new quote
executed-Quote has been used for a trade
Quotes expire after 30 seconds due to market volatility. Always execute promptly or request a fresh quote.

Endpoints

Limits

PairMinimumMaximum
BRL → USDTR$ 10.00R$ 1,000,000.00
USDT → BRL2 USDT200,000 USDT
BRL → BTCR$ 10.00R$ 1,000,000.00
BTC → BRL0.0001 BTC10 BTC
BTC ↔ USDT0.0001 BTC10 BTC
Contact us for higher limits on verified business accounts.