Exchange Rates API
The Exchange Rates API provides real-time exchange rates between currencies, including fee calculations, transaction limits, and payment rail options. This endpoint is essential for displaying conversion rates to users before they create quotes or transactions.
Get Current Exchange Rate
Retrieve the current exchange rate between two currencies with comprehensive fee calculations, limit information, and payment rail options. This endpoint supports both FIAT and CRYPTO transactions.
Endpoint
GET /api/v1/exchange-rates
Authentication
This endpoint does not require authentication for basic rate queries, but authentication is recommended for accurate user-specific rates and limits.
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
quote_type | string | Yes | Type of transaction | EXCHANGE, WITHDRAWAL, DEPOSIT, TRANSFER, SWAP, DIRECT_EXCHANGE |
source_currency | string | Yes | Source currency code (3-letter for FIAT, 4-letter for stablecoins) | USD, USDC, USDT |
target_currency | string | Yes | Target currency code | NGN, EUR |
amount | string | Yes | Amount to convert (decimal string) | 100.00 |
amount_side | string | No | Side of the amount (SOURCE or TARGET). Default: SOURCE | SOURCE, TARGET |
fee_config_id | string (UUID) | No | Optional fee configuration ID to override default rail selection | 550e8400-e29b-41d4-a716-446655440000 |
rail_name | string | No | Optional rail name to specify payment method | WIRE, ACH |
user_type_id | integer | No | User type ID (1 for INDIVIDUAL, 2 for BUSINESS). Default: 1 | 1, 2 |
Transaction Types
EXCHANGE- Currency conversion between different currenciesWITHDRAWAL- Withdraw funds to external destinationDEPOSIT- Deposit funds from external sourceTRANSFER- Internal transfer between accountsSWAP- Currency swap within same accountDIRECT_EXCHANGE- Direct exchange with external beneficiary
Success Response (200 OK)
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"source_currency": "USD",
"source_amount": "100.00",
"target_currency": "NGN",
"target_amount": "149250.00",
"rate": "1492.50",
"display_rate": "1492.50",
"valid_until": "2025-06-01T12:00:00Z",
"rail": {
"fee_config_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "WIRE",
"description": "Wire Transfer",
"display_name": "Wire Transfer",
"speed": "Same day",
"total_payable": "105.00",
"fees": {
"processing_fee": "3.00",
"deposit_fee": "2.00",
"payout_fee": "0.00",
"total_fees": "5.00",
"fee_currency": "USD"
}
},
"min_deposit_amount": "10.00",
"max_deposit_amount": "10000.00",
"min_withdrawal_amount": "50.00",
"max_withdrawal_amount": "5000.00"
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Exchange rate identifier |
source_currency | string | Source currency code |
source_amount | string | Original amount in source currency |
target_currency | string | Target currency code |
target_amount | string | Converted amount in target currency |
rate | string | Exchange rate used for conversion |
display_rate | string | Formatted rate for display in UI |
valid_until | string (ISO 8601) | Rate validity expiration timestamp |
rail | object | Payment rail information with fees |
rail.fee_config_id | string (UUID) | Fee configuration identifier |
rail.name | string | Rail name (e.g., WIRE, ACH) |
rail.display_name | string | User-friendly rail name |
rail.speed | string | Estimated settlement time |
rail.total_payable | string | Total amount including fees |
rail.fees | object | Fee breakdown |
rail.fees.processing_fee | string | Processing fee amount |
rail.fees.deposit_fee | string | Deposit fee amount |
rail.fees.payout_fee | string | Payout fee amount |
rail.fees.total_fees | string | Total fees |
rail.fees.fee_currency | string | Currency for fees |
min_deposit_amount | string | Minimum deposit amount |
max_deposit_amount | string | Maximum deposit amount |
min_withdrawal_amount | string | Minimum withdrawal amount |
max_withdrawal_amount | string | Maximum withdrawal amount |
Error Responses
| Status Code | Description |
|---|---|
400 | Bad request - invalid parameters |
404 | Exchange rate or fee configuration not found |
500 | Internal server error |
Example: cURL
# Get exchange rate for USD to NGN
curl -X GET "/api/v1/exchange-rates?quote_type=EXCHANGE&source_currency=USD&target_currency=NGN&amount=100.00" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
# Get exchange rate with target amount (reverse calculation)
curl -X GET "/api/v1/exchange-rates?quote_type=EXCHANGE&source_currency=USD&target_currency=NGN&amount=150000.00&amount_side=TARGET"
# Get exchange rate for withdrawal
curl -X GET "/api/v1/exchange-rates?quote_type=WITHDRAWAL&source_currency=USD&target_currency=NGN&amount=500.00"
# Get exchange rate for crypto deposit (USDC to NGN)
curl -X GET "/api/v1/exchange-rates?quote_type=DEPOSIT&source_currency=USDC&target_currency=NGN&amount=100.00"Example: HTTP Request
GET /api/v1/exchange-rates?quote_type=EXCHANGE&source_currency=USD&target_currency=NGN&amount=100.00 HTTP/1.1
Host: api.sznd.app
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/jsonUse Cases
- Rate Display - Show users current exchange rates before creating quotes
- Fee Calculation - Display total fees and payable amounts
- Limit Validation - Check if transaction amounts are within allowed limits
- Rail Selection - Compare different payment rails and their fees
- Reverse Calculation - Calculate required source amount for a target amount
Key Features
- FIAT and CRYPTO Support - Handles both traditional currencies and stablecoins (USDC, USDT)
- USD Bridging - Automatically bridges crypto transactions through USD for accurate conversions
- Smart Currency Mapping - Automatically detects stablecoins and applies appropriate conversions
- Fee Calculations - Provides detailed fee breakdowns for all payment rails
- Transaction Limits - Includes minimum and maximum amounts for deposits and withdrawals
- Rate Validity - Provides expiration timestamps for rate locking
Best Practices
- Cache Rates - Exchange rates change frequently, but you can cache them for short periods (e.g., 30 seconds)
- Check Validity - Always check the
valid_untiltimestamp before using a rate - Validate Limits - Verify transaction amounts against
min_*andmax_*limits before proceeding - Display Fees Clearly - Show users the total payable amount including all fees
- Handle Errors - Provide fallback options if rate lookup fails
Transaction Limits
Transaction limits are included in the exchange rate response. These limits help ensure transactions comply with regulatory requirements and business rules.
Limit Fields
The exchange rate response includes the following limit fields:
| Field | Description |
|---|---|
min_deposit_amount | Minimum amount allowed for deposits in source currency |
max_deposit_amount | Maximum amount allowed for deposits in source currency |
min_withdrawal_amount | Minimum amount allowed for withdrawals in source currency |
max_withdrawal_amount | Maximum amount allowed for withdrawals in source currency |
Next Steps
- Create Quote - Use the exchange rate to create a quote for currency conversion
- Currencies API - Get list of supported currencies
- Transactions API - Track completed transactions