> ## Documentation Index
> Fetch the complete documentation index at: https://devdraft.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get exchange rate between specified currencies

> Retrieves the current exchange rate between two specified currencies.
    
This flexible endpoint allows you to get exchange rates for any supported currency pair:
- Supports USD and EUR currency codes
- Provides comprehensive rate information
- Real-time market data

## Supported Currency Pairs
- USD to EUR (USDC to EURC)
- EUR to USD (EURC to USDC)

## Query Parameters
- **from**: Source currency code (usd, eur)
- **to**: Target currency code (usd, eur)

## Use Cases
- Flexible exchange rate queries
- Multi-currency application support
- Dynamic currency conversion calculations
- Financial analytics and reporting

## Rate Information
All rates are provided with full market context including mid-market, buy, and sell rates.



## OpenAPI

````yaml /swagger.yml get /api/v0/exchange-rate
openapi: 3.0.0
info:
  title: Devdraft AI Payment & Business Management API
  description: >-

    A comprehensive payment processing and business management API that enables
    seamless integration of cryptocurrency and traditional payment methods.
        
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.devdraft.ai
    description: Production Server
security: []
tags: []
paths:
  /api/v0/exchange-rate:
    get:
      tags:
        - Exchange Rates
      summary: Get exchange rate between specified currencies
      description: >-
        Retrieves the current exchange rate between two specified currencies.
            
        This flexible endpoint allows you to get exchange rates for any
        supported currency pair:

        - Supports USD and EUR currency codes

        - Provides comprehensive rate information

        - Real-time market data


        ## Supported Currency Pairs

        - USD to EUR (USDC to EURC)

        - EUR to USD (EURC to USDC)


        ## Query Parameters

        - **from**: Source currency code (usd, eur)

        - **to**: Target currency code (usd, eur)


        ## Use Cases

        - Flexible exchange rate queries

        - Multi-currency application support

        - Dynamic currency conversion calculations

        - Financial analytics and reporting


        ## Rate Information

        All rates are provided with full market context including mid-market,
        buy, and sell rates.
      operationId: ExchangeRateController_getExchangeRate
      parameters:
        - name: from
          required: true
          in: query
          description: Source currency code (e.g., usd)
          schema:
            example: usd
            type: string
        - name: to
          required: true
          in: query
          description: Target currency code (e.g., eur)
          schema:
            example: eur
            type: string
      responses:
        '200':
          description: Exchange rate retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeRateResponseDto'
        '400':
          description: Bad Request - Invalid currency codes or unsupported currency pair
        '401':
          description: Unauthorized - Invalid or missing API credentials
        '404':
          description: App not found or no access permission
        '500':
          description: Internal server error
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    ExchangeRateResponseDto:
      type: object
      properties:
        from:
          type: string
          example: usd
          description: Source currency code (USD for USDC)
        to:
          type: string
          example: eur
          description: Target currency code (EUR for EURC)
        midmarket_rate:
          type: string
          example: '0.85000'
          description: Mid-market exchange rate from source to target currency
        buy_rate:
          type: string
          example: '0.84500'
          description: >-
            Rate for buying target currency (what you get when converting from
            source to target)
        sell_rate:
          type: string
          example: '0.85500'
          description: >-
            Rate for selling target currency (what you pay when converting from
            target to source)
        timestamp:
          type: string
          example: '2024-01-15T10:30:00Z'
          description: Timestamp when the exchange rate was last updated
      required:
        - from
        - to
        - midmarket_rate
        - buy_rate
        - sell_rate
  securitySchemes:
    x-client-secret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your secret API key. Keep this secure and never expose it in client-side
        code.
    x-client-key:
      type: apiKey
      in: header
      name: x-client-key
      description: Your unique client API key. Obtain this from your Devdraft AI dashboard.

````