> ## 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.

# Create Offramp Request

> This endpoint will create a offramp request for a customer. If the fiat transfer fails after successful crypto receipt, an automatic refund will be initiated after 5 minutes. Use the refund-status endpoint to check refund status.

This endpoint will create an offramp request for a customer to convert crypto to fiat.


## OpenAPI

````yaml POST /api/v3/offramp
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/offramp:
    post:
      tags:
        - OFFRAMP
      summary: Offramp Request
      description: >-
        This endpoint will create a offramp request for a customer. If the fiat
        transfer fails after successful crypto receipt, an automatic refund will
        be initiated after 5 minutes. Use the refund-status endpoint to check
        refund status.
      operationId: OffRampController_createOfframp_api/v3
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OfframpDto'
      responses:
        '200':
          description: Offramp Response
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Offramp has been successfully created
                  data:
                    $ref: '#/components/schemas/OfframpResponseDto'
                    type: object
        '400':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  data:
                    type: object
                    example: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
                  data:
                    type: object
                    example: {}
      security:
        - JWT: []
components:
  schemas:
    OfframpDto:
      type: object
      properties:
        mobileMoneyReceiver:
          description: Mobile Money receiver details
          allOf:
            - $ref: '#/components/schemas/MobileMoneyReceiverDto'
        bankReceiver:
          description: Bank receiver details
          allOf:
            - $ref: '#/components/schemas/BankDto'
        cryptoAmount:
          type: number
          description: The crypto amount
        currency:
          description: Fiat currency
          allOf:
            - $ref: '#/components/schemas/CURRENCY'
        chain:
          description: Chain
          allOf:
            - $ref: '#/components/schemas/Chain'
        token:
          description: Stable Coin or Token
          allOf:
            - $ref: '#/components/schemas/StableCoin'
        referenceId:
          type: string
          description: Reference ID
        senderAddress:
          type: string
          description: >-
            Sender address (optional - if not provided, will use integrator
            crypto wallet)
        callbackUrl:
          type: string
          description: Callback Url
        rateId:
          type: string
          description: Rate ID
        refundInitiated:
          type: boolean
          description: Whether refund has been initiated
        refundStatus:
          type: string
          description: Refund status
        refundTransactionHash:
          type: string
          description: Refund transaction hash
        refundAmount:
          type: number
          description: Refund amount
      required:
        - cryptoAmount
        - currency
        - chain
        - token
        - referenceId
    OfframpResponseDto:
      type: object
      properties:
        referenceId:
          type: string
          description: Reference ID
        fiatAmount:
          type: number
          description: Fiat amount
        fiatTransactionAmount:
          type: number
          description: Fiat transaction amount
        cryptoAmount:
          type: number
          description: Crypto amount
        fiatCurrency:
          description: Fiat currency
          allOf:
            - $ref: '#/components/schemas/CURRENCY'
        customerKey:
          type: string
          description: Customer key
        fiatWalletId:
          type: string
          description: Fiat wallet ID
        senderAddress:
          type: string
          description: Sender address
        transactionHash:
          type: string
          description: Transaction hash
        transactionHashAmount:
          type: number
          description: Transaction hash amount
        status:
          type: string
          description: Status
        onchainStatus:
          type: string
          description: Onchain status
        rate:
          type: object
          description: Rate
        escrowAddress:
          type: string
          description: Escrow address
        usingIntegratedWallet:
          type: boolean
          description: Whether using integrated crypto wallet flow
        created_at:
          format: date-time
          type: string
          description: Creation timestamp
        updated_at:
          format: date-time
          type: string
          description: Last update timestamp
        onchainError:
          type: object
          description: Onchain error details if the transaction failed
        transactionError:
          type: object
          description: Transaction error details if the transaction failed
      required:
        - referenceId
        - fiatAmount
        - fiatTransactionAmount
        - cryptoAmount
        - fiatCurrency
        - customerKey
        - fiatWalletId
        - senderAddress
        - transactionHash
        - transactionHashAmount
        - status
        - onchainStatus
        - rate
        - escrowAddress
    MobileMoneyReceiverDto:
      type: object
      properties:
        phoneNumber:
          type: string
          description: Phone number
        accountName:
          type: string
          description: Account name
        networkProvider:
          type: string
          description: >-
            Provider network (Check Payment Providers API for available
            networks)
          example: MTN, VODAFONE, AIRTEL, MPESA
      required:
        - phoneNumber
        - accountName
        - networkProvider
    BankDto:
      type: object
      properties:
        name:
          type: string
          description: Full name
        address:
          type: string
          description: Address
        phoneNumber:
          type: string
          description: Phone number
        bankCode:
          type: number
          description: Bank code
        accountNumber:
          type: string
          description: Account number
        country:
          type: string
          description: Country code (ISO-2 like KE, GH, NG or ISO-3 like KEN, GHA, NGA)
          example: KE
      required:
        - name
        - address
        - phoneNumber
        - bankCode
        - accountNumber
        - country
    CURRENCY:
      type: string
      enum:
        - KES
        - GHS
        - TZS
        - UGX
        - ZMW
        - XAF
        - XOF
        - CDF
        - RWF
        - ETB
        - ZAR
      description: Currency
    Chain:
      type: string
      enum:
        - ETHEREUM
        - CELO
        - AVALANCHE
        - POLYGON
        - ARBITRUM
        - OPTIMISM
        - STELLAR
        - TRON
        - FUSE
        - LIGHTNING
        - SOLANA
        - PROVENANCE
        - CARDANO
        - HEDERA
        - BASE
        - LISK
        - VICTION
        - SCROLL
      description: The chain of the wallet.Its required if the wallet is a crypto wallet
    StableCoin:
      type: string
      enum:
        - CUSD
        - USDC
        - USDT
        - USDT0
        - SAT
        - BTC
        - HASH
        - FUSE
        - HBAR
        - USDGLO
        - CKES
        - CGHS
        - MSAT
        - XLM
        - ADA
      description: The currency of the wallet
  securitySchemes:
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http

````