Skip to content

Quote Request

BRIJ sends this request to get a quote for a crypto transaction.

Endpoint

POST https://api.yourplatform.com/quote
Content-Type: application/json
X-Forwarded-For: 203.0.113.42

The X-Forwarded-For header contains the end-user's IP address, which you can use for geo-based restrictions, fraud detection, or compliance requirements.

Request Body

{
  "countryCode": "USA",
  "rampType": "ONRAMP",
  "fromCurrency": "USD",
  "toCurrency": "SOLANA_SOL",
  "network": "SOLANA",
  "paymentMethod": "USA_ACH",
  "fromAmount": "100.50"
}

Request Parameters

Field Type Required Description
countryCode string Yes ISO 3166-1 alpha-3 country code (e.g., "USA", "GBR")
rampType string Yes Transaction type: "ONRAMP" (buy crypto) or "OFFRAMP" (sell crypto)
fromCurrency string Yes Source currency code (see Currency Codes)
toCurrency string Yes Destination currency code (see Currency Codes)
network string Yes Blockchain network (see Networks)
paymentMethod string Yes Payment method code (see Payment Methods)
fromAmount string Yes Amount in source currency (decimal as string, e.g., "100.50")

Note

  • For ONRAMP: fromCurrency is fiat (e.g., "USD"), toCurrency is crypto (e.g., "SOLANA_SOL")
  • For OFFRAMP: fromCurrency is crypto (e.g., "SOLANA_SOL"), toCurrency is fiat (e.g., "USD")

Response Body

{
  "toAmount": "1.5234",
  "rawResponse": {
    "exchangeRate": "65.9123",
    "fees": "1.50",
    "estimatedTime": "5-10 minutes",
    "quoteId": "quote_abc123",
    "expiresAt": "2025-01-15T10:30:00Z"
  }
}

Response Parameters

Field Type Required Description
toAmount string Yes Amount customer will receive in destination currency (decimal as string)
rawResponse object No Additional quote details (free-form, stored for reference)

rawResponse Guidelines:

  • Can include any JSON-serializable data
  • BRIJ stores this for audit and reference purposes

Error Response

Return appropriate HTTP status codes:

Status Code Description Example Body
400 Invalid request parameters {"error": "Invalid currency code"}
422 Amount outside limits {"error": "Amount below minimum limit of 10 USD"}
503 Service temporarily unavailable {"error": "Quote service unavailable"}