Quote Request

View as Markdown

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

1{
2 "countryCode": "USA",
3 "rampType": "ONRAMP",
4 "fromCurrency": "USD",
5 "toCurrency": "SOLANA_SOL",
6 "network": "SOLANA",
7 "paymentMethod": "USA_ACH",
8 "fromAmount": "100.50"
9}

Request Parameters

FieldTypeRequiredDescription
countryCodestringYesISO 3166-1 alpha-3 country code (e.g., “USA”, “GBR”)
rampTypestringYesTransaction type: "ONRAMP" (buy crypto) or "OFFRAMP" (sell crypto)
fromCurrencystringYesSource currency code (see Currency Codes)
toCurrencystringYesDestination currency code (see Currency Codes)
networkstringYesBlockchain network (see Networks)
paymentMethodstringYesPayment method code (see Payment Methods)
fromAmountstringYesAmount 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

1{
2 "toAmount": "1.5234",
3 "rawResponse": {
4 "exchangeRate": "65.9123",
5 "fees": "1.50",
6 "estimatedTime": "5-10 minutes",
7 "quoteId": "quote_abc123",
8 "expiresAt": "2025-01-15T10:30:00Z"
9 }
10}

Response Parameters

FieldTypeRequiredDescription
toAmountstringYesAmount customer will receive in destination currency (decimal as string)
rawResponseobjectNoAdditional 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 CodeDescriptionExample Body
400Invalid request parameters{"error": "Invalid currency code"}
422Amount outside limits{"error": "Amount below minimum limit of 10 USD"}
503Service temporarily unavailable{"error": "Quote service unavailable"}