> ## 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 Crypto Bridge Rate

> Get a rate quote for crypto bridge transactions (fiat to crypto conversion). This endpoint generates a rate_id that must be used in the crypto bridge deposit request. Rate is valid for 60 seconds and can only be used once. Currently supports: KES -> Lightning (MSAT)

Get an exchange rate quote for a crypto bridge transaction before initiating the deposit. Use this to display the estimated source fiat amount, crypto amount, and destination fiat amount to the customer.


## OpenAPI

````yaml POST /api/v3/rate/crypto-bridge
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/crypto-bridge:
    post:
      tags:
        - RATES
      summary: Get Crypto Bridge rate quote
      description: >-
        Get a rate quote for crypto bridge transactions (fiat to crypto
        conversion). This endpoint generates a rate_id that must be used in the
        crypto bridge deposit request. Rate is valid for 60 seconds and can only
        be used once. Currently supports: KES -> Lightning (MSAT)
      operationId: RateController_getCryptoBridgeRate_api/v3
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoBridgeRateRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Crypto bridge rate quote generated successfully.
                  data:
                    $ref: '#/components/schemas/CryptoBridgeRateResponseDto'
                    type: object
        '400':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid request parameters
                  data:
                    type: object
                    example: {}
        '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:
    CryptoBridgeRateRequestDto:
      type: object
      properties:
        source_currency:
          description: Source fiat currency
          example: KES
          allOf:
            - $ref: '#/components/schemas/Currency'
        source_amount:
          type: number
          description: Source fiat amount customer will pay
          example: 1000
        crypto_chain:
          description: Blockchain/network to use
          example: LIGHTNING
          allOf:
            - $ref: '#/components/schemas/CHAIN'
        crypto_token:
          description: Crypto token to use
          example: MSAT
          allOf:
            - $ref: '#/components/schemas/TOKEN'
        requested_crypto_amount:
          type: number
          description: Requested crypto amount (optional - for validation)
          example: 150000000
      required:
        - source_currency
        - source_amount
        - crypto_chain
        - crypto_token
    CryptoBridgeRateResponseDto:
      type: object
      properties:
        rate_id:
          type: string
          description: Rate ID - use this in crypto bridge deposit request
          example: RATE-CB-1732454321-XYZ123
        source_amount:
          type: number
          description: Source fiat amount
          example: 1000
        source_currency:
          type: string
          description: Source currency
          example: KES
        crypto_amount:
          type: number
          description: >-
            Crypto amount in smallest unit (e.g., msats for Lightning, wei for
            ETH)
          example: 150000000
        crypto_unit:
          type: string
          description: Crypto amount unit
          example: msat
        chain:
          type: string
          description: Blockchain chain
          example: LIGHTNING
        token:
          type: string
          description: Crypto token
          example: MSAT
        exchange_rate:
          type: object
          description: Exchange rate details
          example:
            fiat_to_btc: '0.00000015'
            btc_to_msat: 100000000
            exchange_rate_source: COINBASE
        fees:
          type: object
          description: Kotani fee breakdown
          example:
            fiat_fee: 15
            fiat_fee_currency: KES
            crypto_fee: 1000
            crypto_fee_unit: sats
            fee_percentage: 1.5
        total_cost:
          type: number
          description: Total cost in source currency including all fees
          example: 1015
        net_crypto_amount:
          type: number
          description: Net crypto amount after fees
          example: 149000000
        expires_at:
          type: string
          description: Rate expiration timestamp (ISO 8601) - 60 seconds from creation
          example: '2024-11-24T12:01:00Z'
        created_at:
          type: string
          description: Rate creation timestamp (ISO 8601)
          example: '2024-11-24T12:00:00Z'
      required:
        - rate_id
        - source_amount
        - source_currency
        - crypto_amount
        - crypto_unit
        - chain
        - token
        - exchange_rate
        - fees
        - total_cost
        - net_crypto_amount
        - expires_at
        - created_at
    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
    CHAIN:
      type: string
      enum:
        - CELO
        - ETHEREUM
        - ARBITRUM
        - AVALANCHE
        - BINANCE
        - POLYGON
        - OPTIMISM
        - FUSE
        - TRON
        - PROVENANCE
        - SOLANA
        - HEDERA
        - STELLAR
        - BASE
        - LISK
        - VICTION
        - SCROLL
        - LIGHTNING
      description: Blockchain/network to use
    TOKEN:
      type: string
      enum:
        - CUSD
        - USDC
        - USDT
        - BUSD
        - HASH
        - HBAR
        - USDGLO
        - CKES
        - CGHS
        - MSAT
      description: Crypto token to use
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http

````