Skip to main content
POST
https://api.bipa.tech
/
v1
/
quotes
curl -X POST https://api.bipa.tech/v1/quotes \
  -H "Authorization: Bearer bipa_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_a1b2c3d4e5f6",
    "from_asset": "BRL",
    "to_asset": "BTC",
    "amount": "100000",
    "amount_asset": "BRL",
    "amount_type": "gross",
    "partner_fee_bps": 50
  }'
{
  "id": "quote_abc123xyz",
  "customer_id": "cus_a1b2c3d4e5f6",
  "from_asset": "BRL",
  "to_asset": "BTC",
  "from_amount": "100000",
  "to_amount": "24628",
  "from_decimals": 2,
  "to_decimals": 8,
  "price": "40200000",
  "price_decimals": 2,
  "fees": {
    "total": "1000",
    "total_bps": 100,
    "partner": "500",
    "partner_bps": 50,
    "bipa": "500",
    "bipa_bps": 50
  },
  "status": "pending",
  "expires_at": "2024-01-15T10:30:30Z",
  "created_at": "2024-01-15T10:30:00Z"
}

Request

Create a quote for converting between currencies. The quote locks in a price for 30 seconds and includes a transparent fee breakdown.

Body parameters

customer_id
string
required
Customer requesting the quote
from_asset
string
required
Source asset: BRL, USDT, or BTC
to_asset
string
required
Target asset: BRL, USDT, or BTC
amount
string
required
Amount in smallest unit of the specified amount_asset
amount_asset
string
required
Which asset the amount refers to: must match from_asset or to_asset
amount_type
string
required
Whether amount is net (after fees) or gross (before fees)
  • net: Amount the customer receives (for to_asset) or spends after fees (for from_asset)
  • gross: Total amount including fees
partner_fee_bps
integer
default:"0"
Partner fee in basis points (100 bps = 1%). This fee is added to the total and split between you and Bipa.

Response

id
string
Unique quote identifier to use when executing
customer_id
string
Customer who requested the quote
from_asset
string
Source asset
to_asset
string
Target asset
from_amount
string
Total amount debited from customer (smallest unit)
to_amount
string
Total amount credited to customer (smallest unit)
from_decimals
integer
Decimal places for source asset
to_decimals
integer
Decimal places for target asset
price
string
Exchange price: cost of 1 unit of to_asset in from_asset (smallest unit)
price_decimals
integer
Decimal places for displaying the price
fees
object
Fee breakdown
status
string
Quote status: pending, expired, or executed
expires_at
string
ISO 8601 expiration timestamp (30 seconds from creation)
created_at
string
ISO 8601 creation timestamp
curl -X POST https://api.bipa.tech/v1/quotes \
  -H "Authorization: Bearer bipa_live_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_a1b2c3d4e5f6",
    "from_asset": "BRL",
    "to_asset": "BTC",
    "amount": "100000",
    "amount_asset": "BRL",
    "amount_type": "gross",
    "partner_fee_bps": 50
  }'
{
  "id": "quote_abc123xyz",
  "customer_id": "cus_a1b2c3d4e5f6",
  "from_asset": "BRL",
  "to_asset": "BTC",
  "from_amount": "100000",
  "to_amount": "24628",
  "from_decimals": 2,
  "to_decimals": 8,
  "price": "40200000",
  "price_decimals": 2,
  "fees": {
    "total": "1000",
    "total_bps": 100,
    "partner": "500",
    "partner_bps": 50,
    "bipa": "500",
    "bipa_bps": 50
  },
  "status": "pending",
  "expires_at": "2024-01-15T10:30:30Z",
  "created_at": "2024-01-15T10:30:00Z"
}

Understanding the quote

Price interpretation

The price field represents how much from_asset you need for 1 unit of to_asset:
BRL → BTC quote:
  price = "40200000"
  price_decimals = 2

  1 BTC = 40200000 / 10^2 = R$ 402,000.00

Fee calculation

Fees are expressed both as absolute amounts and basis points:
# Example: R$ 1,000 → BTC with 100 bps total fee
from_amount = 100000  # R$ 1,000.00
fees_total = 1000     # R$ 10.00
fees_total_bps = 100  # 1%

# Net amount used for conversion
net_for_conversion = from_amount - fees_total  # R$ 990.00

# Partner earns 50 bps of the transaction
partner_fee = 500     # R$ 5.00
partner_bps = 50

# Bipa earns 50 bps
bipa_fee = 500        # R$ 5.00
bipa_bps = 50

Amount type examples

“I want to spend exactly R$ 1,000”
{
  "amount": "100000",
  "amount_asset": "BRL",
  "amount_type": "gross"
}
Result: from_amount = "100000" (exactly R$ 1,000 debited)
For the best user experience, use amount_type: "gross" when the user enters a BRL amount, and amount_type: "net" when they enter a crypto amount.