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

# Get Offramp 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 offramp transactions.


## OpenAPI

````yaml POST /api/v3/rate/offramp
openapi: 3.0.0
info:
  title: KOTANI PAY API PLATFORM
  description: ''
  version: '3.0'
  contact: {}
servers:
  - url: https://sandbox-api.kotanipay.com
security: []
tags: []
paths:
  /api/v3/rate/offramp:
    post:
      tags:
        - RATES
      summary: Get Offramp Exchange rate
      description: >-
        An integrator can use this endpoint to get the exchange rate between two
        currencies
      operationId: RateController_getOffRampRates_api/v3
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OfframpRateRequest'
      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:
    OfframpRateRequest:
      type: object
      properties:
        from:
          type: string
          enum:
            - CUSD
            - USDC
            - USDT
            - USDGLO
            - CKES
            - CGHS
            - MSAT
            - ADA
          description: The stablecoin being sold.
          example: USDC
        to:
          type: string
          description: The fiat currency to pay out in.
          example: EUR
        cryptoAmount:
          type: number
          description: >-
            How much to convert. Holds the crypto amount by default; if you set
            source to fiat it holds the net payout you want the recipient to
            receive, and we work backwards to the crypto needed.
          example: 10
        source:
          type: string
          enum:
            - fiat
            - crypto
          description: >-
            Which currency cryptoAmount holds. Defaults to crypto, set fiat to
            pass the net payout.
          example: crypto
      required:
        - from
        - to
        - cryptoAmount
    OnchainRateResponseDto:
      type: object
      properties:
        from:
          type: string
          description: The currency being converted from — the one you hold.
          example: USD
        to:
          type: string
          description: The currency being converted to — the one you want.
          example: KES
        value:
          type: string
          description: >-
            How many units of `to` one unit of `from` buys. Multiply your `from`
            amount by this to get the `to` amount: 10 USD at 130.5 is 1305 KES.
            Divide to go the other way. Rates move, so re-read this before
            quoting a customer rather than caching it.
          example: '130.5'
        id:
          type: string
          description: >-
            Identifier for this quote. Pass it on the transaction to be charged
            the rate you were quoted rather than the rate at the time you
            submit.
          example: '1234567890'
        fiatAmount:
          type: number
          description: >-
            The fiat side of the conversion, before any fee. On an offramp this
            is what the crypto is worth; the recipient gets transactionAmount.
          example: '1305'
        cryptoAmount:
          type: number
          description: The crypto side of the conversion.
          example: '10'
        transactionAmount:
          type: number
          description: >-
            The settlement amount — what actually reaches the recipient. Whether
            the fee has been taken out of it depends on who pays the fee on your
            account.
          example: '1279'
        fee:
          type: number
          description: >-
            Our fee on this transaction, in the fiat currency. Already rounded
            to the currency's precision — whole units for KES and similar, two
            decimals for USD — so use this figure rather than recalculating it.
          example: '26'
        walletDebitAmount:
          type: number
          description: >-
            OFFRAMP only. What actually leaves your wallet, fee included where
            you pay it. This is the figure to reconcile your balance against —
            not transactionAmount, which is what the recipient receives.
          example: '1331'
      required:
        - from
        - to
        - value
        - id
        - fiatAmount
        - cryptoAmount
        - transactionAmount
        - fee
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http

````