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

# Get Onramp Exchange Rate

> An integrator can use this endpoint to get the exchange rate between two currencies

An integrator can use this endpoint to get the exchange rate between two currencies for onramp transactions.


## OpenAPI

````yaml POST /api/v3/rate/onramp
openapi: 3.0.0
info:
  title: KOTANI PAY API PLATFORM
  description: ''
  version: '3.0'
  contact: {}
servers:
  - url: https://preview.kotanipay.com
security: []
tags: []
paths:
  /api/v3/rate/onramp:
    post:
      tags:
        - RATES
      summary: Get Onramp Exchange rate
      description: >-
        An integrator can use this endpoint to get the exchange rate between two
        currencies
      operationId: RateController_getOnrampRates_api/v3
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OnrampRateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Available exchange rate.
                  data:
                    $ref: '#/components/schemas/OnchainRateResponseDto'
                    type: object
        '401':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid API Key
                  data:
                    type: object
                    example: {}
      security:
        - JWT: []
components:
  schemas:
    OnrampRateRequest:
      type: object
      properties:
        from:
          description: From currency
          example: KES
          allOf:
            - $ref: '#/components/schemas/Currency'
        to:
          description: To currency
          example: USDT
          allOf:
            - $ref: '#/components/schemas/STABLE_COIN'
        fiatAmount:
          type: number
          description: Rate value
          example: '0.85'
      required:
        - from
        - to
        - fiatAmount
    OnchainRateResponseDto:
      type: object
      properties:
        from:
          type: string
          description: From currency
          example: USD
        to:
          type: string
          description: To currency
          example: EUR
        value:
          type: string
          description: Rate value
          example: '0.85'
        id:
          type: string
          description: Rate ID
          example: '1234567890'
        fiatAmount:
          type: number
          description: Fiat amount
          example: '100'
        cryptoAmount:
          type: number
          description: Crypto amount
          example: '100'
        transactionAmount:
          type: number
          description: Transaction amount
          example: '100'
        fee:
          type: number
          description: Fee
          example: '100'
      required:
        - from
        - to
        - value
        - id
        - fiatAmount
        - cryptoAmount
        - transactionAmount
        - fee
    Currency:
      type: string
      enum:
        - KES
        - GHS
        - NGN
        - ZAR
        - ZAR
        - USD
        - XOF
        - ZMW
        - XAF
        - SLE
        - CDF
        - TZS
        - UGX
        - EGP
        - MWK
        - RWF
        - ETB
        - MZN
        - LSL
        - GNF
        - USDT
        - BTC
        - ETH
        - USDC
      description: From currency
    STABLE_COIN:
      type: string
      enum:
        - CUSD
        - USDC
        - USDT
        - USDGLO
        - CKES
        - CGHS
        - MSAT
      description: To currency
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http

````