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

# Off-Ramp Integration

> Integrate the Off-Ramp widget to let users sell crypto on your application.

This example shows you how to integrate the Busha Off-Ramp widget to let users sell cryptocurrency and receive fiat directly in your application.

## Use Cases

* Wallet app letting users cash out crypto
* Marketplace vendor payouts
* P2P trading platform
* Gaming platform withdrawals to local currency

## Basic Integration

### Simple Button Integration

The quickest way to integrate the Off-Ramp widget is with a button that opens the widget in a new window:

```html theme={null}
<button
  onclick="window.open('https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&redirectUrl=https://your-app.com/handle-deposit', '_blank')"
>
  Sell Crypto with Busha
</button>
```

### Iframe Integration

For a more embedded experience, use an iframe:

```html theme={null}
<iframe
  src="https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&redirectUrl=https://your-app.com/handle-deposit"
  width="100%"
  height="700px"
  style="border: 1px solid #e5e7eb; border-radius: 8px;"
  title="Busha Off-Ramp Widget"
></iframe>
```

***

## Pre-filled Integration Examples

<Tabs>
  <Tab title="Nigeria (NGN)">
    ### Sell 0.005 ETH for NGN

    ```html theme={null}
        <button
          onclick="window.open('https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&cryptoAsset=ETH&network=ETH&fiatCurrency=NGN&cryptoAmount=0.005&redirectUrl=https://your-app.com/handle-deposit', '_blank')"
        >
          Sell ETH for Naira
        </button>
    ```

    ### Sell USDT for NGN Bank Payout

    ```html theme={null}
    <button
      onclick="window.open('https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&cryptoAsset=USDT&network=TRX&fiatCurrency=NGN&cryptoAmount=100&redirectUrl=https://your-app.com/handle-deposit', '_blank')"
    >
      Cash Out USDT to Bank
    </button>
    ```
  </Tab>

  <Tab title="Kenya (KES)">
    ### Sell Bitcoin for KES

    ```html theme={null}
        <button
          onclick="window.open('https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&cryptoAsset=BTC&network=BTC&fiatCurrency=KES&cryptoAmount=0.001&redirectUrl=https://your-app.com/handle-deposit', '_blank')"
        >
          Sell Bitcoin for KES
        </button>
    ```

    ### Sell USDT for M-Pesa Payout

    ```html theme={null}
    <button
      onclick="window.open('https://sandbox.sell.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=sell&cryptoAsset=USDT&network=TRX&fiatCurrency=KES&cryptoAmount=50&redirectUrl=https://your-app.com/handle-deposit', '_blank')"
    >
      Cash Out to M-Pesa
    </button>
    ```
  </Tab>
</Tabs>

***

## Configuration Parameters

<table style={{ width: "100%", borderCollapse: "collapse" }}>
  <thead>
    <tr>
      <th style={{ width: "25%", textAlign: "left", padding: "12px" }}>
        Parameter
      </th>

      <th style={{ width: "25%", textAlign: "left", padding: "12px" }}>
        Required
      </th>

      <th style={{ width: "60%", textAlign: "left", padding: "12px" }}>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{ padding: "12px" }}>publicKey</td>
      <td style={{ padding: "12px" }}>Yes</td>
      <td style={{ padding: "12px" }}>Your Busha Public API Key</td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>side</td>
      <td style={{ padding: "12px" }}>Yes</td>
      <td style={{ padding: "12px" }}>Must be "sell" for off-ramp</td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>redirectUrl</td>
      <td style={{ padding: "12px" }}>Yes</td>

      <td style={{ padding: "12px" }}>
        URL to redirect after transaction setup
      </td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>cryptoAsset</td>
      <td style={{ padding: "12px" }}>No</td>

      <td style={{ padding: "12px" }}>
        Cryptocurrency to sell (e.g., BTC, ETH, USDT)
      </td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>network</td>
      <td style={{ padding: "12px" }}>No</td>

      <td style={{ padding: "12px" }}>
        Blockchain network (e.g., BTC, ETH, POLYGON)
      </td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>fiatCurrency</td>
      <td style={{ padding: "12px" }}>No</td>

      <td style={{ padding: "12px" }}>
        Target fiat currency (NGN for Nigeria, KES for Kenya)
      </td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>cryptoAmount</td>
      <td style={{ padding: "12px" }}>No</td>
      <td style={{ padding: "12px" }}>Amount of crypto to sell</td>
    </tr>

    <tr>
      <td style={{ padding: "12px" }}>fiatAmount</td>
      <td style={{ padding: "12px" }}>No</td>

      <td style={{ padding: "12px" }}>
        Target fiat amount (ignores cryptoAmount if set)
      </td>
    </tr>
  </tbody>
</table>

***

## React Component Examples

<Tabs>
  <Tab title="Nigeria (NGN)">
    ```jsx theme={null}
        import React from "react";

        function SellEthereumButton() {
          const openOffRamp = () => {
            const params = new URLSearchParams({
              publicKey: "YOUR_PUBLIC_KEY",
              side: "sell",
              cryptoAsset: "ETH",
              network: "ETH",
              fiatCurrency: "NGN",
              cryptoAmount: "0.005",
              redirectUrl: "https://your-app.com/handle-deposit",
            });

            window.open(
              `https://sandbox.sell.busha.io/?${params.toString()}`,
              "_blank"
            );
          };

          return <button onClick={openOffRamp}>Sell Ethereum for Naira</button>;
        }

        export default SellEthereumButton;

    ```
  </Tab>

  <Tab title="Kenya (KES)">
    ```jsx theme={null}
        import React from "react";

        function SellBitcoinButton() {
          const openOffRamp = () => {
            const params = new URLSearchParams({
              publicKey: "YOUR_PUBLIC_KEY",
              side: "sell",
              cryptoAsset: "BTC",
              network: "BTC",
              fiatCurrency: "KES",
              cryptoAmount: "0.001",
              redirectUrl: "https://your-app.com/handle-deposit",
            });

            window.open(
              `https://sandbox.sell.busha.io/?${params.toString()}`,
              "_blank"
            );
          };

          return <button onClick={openOffRamp}>Sell Bitcoin for KES</button>;
        }

        export default SellBitcoinButton;
    ```
  </Tab>
</Tabs>

***

## Complete Integration Flow

<Steps>
  <Step title="User Initiates Sell">
    User clicks "Sell Crypto" button in your app
  </Step>

  <Step title="Redirect to Off-Ramp Widget">
    Your app opens the Busha Off-Ramp widget with pre-filled parameters
  </Step>

  <Step title="User Configures Payout">
    User logs in to Busha, completes KYC if needed, and selects their payout
    method: - **Nigeria**: Bank account - **Kenya**: M-Pesa or bank account
  </Step>

  <Step title="Redirect Back with Deposit Instructions">
    Busha redirects user back to your app with deposit address and amount
  </Step>

  <Step title="User Confirms and Sends Crypto">
    Your app displays the deposit instructions. User confirms and sends crypto
    to the provided address
  </Step>

  <Step title="Busha Processes Payout">
    Once crypto is received, Busha processes the payout to the user's selected
    method
  </Step>
</Steps>

## Learn More

* [Off-Ramp Widget Overview](/overview/off-ramp-widget) - Understand how the widget works
* [Integration Guide](/guides/widgets/integrate-off-ramp) - Detailed integration steps
* [Supported Currencies](/guides/reference/supported-currencies) - See all supported assets
* [Webhooks Setup](/guides/webhooks/setup) - Monitor transactions in real-time
* [Test Addresses](/guides/reference/test-addresses) - Get test crypto addresses for sandbox testing
