Resources
Limits

Transaction Limits

Transaction limits define the minimum and maximum amounts allowed for deposits and withdrawals in each currency. These limits help ensure compliance with regulatory requirements and manage risk.

Understanding Limits

Transaction limits are returned as part of the Exchange Rates API response. When you query an exchange rate, the response includes limit information for the source currency.

Limit Types

Limit TypeDescription
min_deposit_amountMinimum amount required for a deposit transaction
max_deposit_amountMaximum amount allowed for a deposit transaction
min_withdrawal_amountMinimum amount required for a withdrawal transaction
max_withdrawal_amountMaximum amount allowed for a withdrawal transaction

Getting Limits

Limits are automatically included when you fetch an exchange rate:

curl -X GET "/api/v1/exchange-rates?quote_type=DEPOSIT&source_currency=USD&target_currency=NGN&amount=100.00"

The response includes limit information:

{
  "min_deposit_amount": "10.00",
  "max_deposit_amount": "10000.00",
  "min_withdrawal_amount": "50.00",
  "max_withdrawal_amount": "5000.00"
}

Limit Validation

Always validate transaction amounts against limits before creating quotes or transactions:

function validateAmount(rate, amount, transactionType) {
  const amountFloat = parseFloat(amount);
  
  if (transactionType === 'DEPOSIT') {
    const min = parseFloat(rate.min_deposit_amount);
    const max = parseFloat(rate.max_deposit_amount);
    
    if (amountFloat < min) {
      throw new Error(`Amount must be at least ${min} ${rate.source_currency}`);
    }
    if (amountFloat > max) {
      throw new Error(`Amount cannot exceed ${max} ${rate.source_currency}`);
    }
  } else if (transactionType === 'WITHDRAWAL') {
    const min = parseFloat(rate.min_withdrawal_amount);
    const max = parseFloat(rate.max_withdrawal_amount);
    
    if (amountFloat < min) {
      throw new Error(`Amount must be at least ${min} ${rate.source_currency}`);
    }
    if (amountFloat > max) {
      throw new Error(`Amount cannot exceed ${max} ${rate.source_currency}`);
    }
  }
  
  return true;
}

Best Practices

  1. Check Limits Early - Validate amounts against limits before showing rates to users
  2. Display Limits - Show users the applicable limits in your UI
  3. Handle Errors - Provide clear error messages when limits are exceeded
  4. Currency-Specific - Remember that limits are currency-specific and may vary

Next Steps