Skip to main content
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:
<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:
<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

Example: Sell 0.005 ETH for NGN

<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 0.005 ETH for NGN
</button>

Example: Sell Bitcoin for Kenyan Shillings

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

Configuration Parameters

ParameterRequiredDescription
publicKeyYesYour Busha Public API Key
sideYesMust be “sell” for off-ramp
redirectUrlYesURL to redirect after transaction setup
cryptoAssetNoCryptocurrency to sell (e.g., BTC, ETH, USDT)
networkNoBlockchain network (e.g., BTC, ETH, POLYGON)
fiatCurrencyNoTarget fiat currency (NGN, KES)
cryptoAmountNoAmount of crypto to sell
fiatAmountNoTarget fiat amount (ignores cryptoAmount if set)

React Component Example

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 with Busha</button>;
}

export default SellEthereumButton;

Dynamic URL Construction

Build the Off-Ramp URL on your server for better security:
// Server-side (Node.js example)
app.get("/api/offramp-url", (req, res) => {
  const { amount, currency, asset, network } = req.query;

  const params = new URLSearchParams({
    publicKey: process.env.BUSHA_PUBLIC_KEY,
    side: "sell",
    cryptoAsset: asset,
    network: network,
    fiatCurrency: currency,
    cryptoAmount: amount,
    redirectUrl: "https://your-app.com/handle-deposit",
  });

  const offRampUrl = `https://sandbox.sell.busha.io/?${params.toString()}`;

  res.json({ url: offRampUrl });
});

// Client-side
async function openOffRamp() {
  const response = await fetch(
    "/api/offramp-url?amount=0.005&currency=NGN&asset=ETH&network=ETH"
  );
  const { url } = await response.json();
  window.open(url, "_blank");
}

Complete Integration Flow

1

User Initiates Sell

User clicks “Sell Crypto” button in your app
2

Redirect to Off-Ramp Widget

Your app opens the Busha Off-Ramp widget with pre-filled parameters
3

User Configures Payout

User logs in to Busha, completes KYC if needed, and selects their payout method (bank account or mobile money)
4

Redirect Back with Deposit Instructions

Busha redirects user back to your app with deposit address and amount
5

User Confirms and Sends Crypto

Your app displays the deposit instructions. User confirms and sends crypto to the provided address
6

Busha Processes Payout

Once crypto is received, Busha processes the payout to the user’s selected method

Learn More