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

# On-Ramp Integration

> Integrate the On-Ramp widget to let users buy crypto on your application.

This example shows you how to integrate the Busha On-Ramp widget to let users buy cryptocurrency directly in your application.

## Use Cases

* E-commerce site accepting crypto payments
* Wallet app letting users buy crypto
* Gaming platform selling in-game crypto assets

## Basic Integration

### Simple Button Integration

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

```html theme={null}
<button
  onclick="window.open('https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY', '_blank')"
>
  Buy Crypto with Busha
</button>
```

***

## Live Demo

Try the On-Ramp widget below to see how it works in action:

> [tab] Nigeria (NGN)
>
> [Busha On-Ramp Widget - Nigeria](https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY\&side=buy\&fiatCurrency=NGN\&cryptoAsset=BTC\&fiatAmount=50000)

> [tab] Kenya (KES)
>
> [Busha On-Ramp Widget - Kenya](https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY\&side=buy\&fiatCurrency=KES\&cryptoAsset=BTC\&fiatAmount=5000)

> [!NOTE]
>
> **Demo Note:** This is a live sandbox widget. You can interact with it to see
> the complete user flow, but no real money will be processed.

***

### Iframe Integration

For a more embedded experience, use an iframe:

```html theme={null}
<iframe
  src="https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY"
  width="100%"
  height="700px"
  style="border: 1px solid #e5e7eb; border-radius: 8px;"
  title="Busha On-Ramp Widget"
></iframe>
```

***

## Pre-filled Integration Examples

> [tab] Nigeria (NGN)
>
> ### Buy Bitcoin with 50,000 NGN
>
> ```html theme={null}
>     <button
>       onclick="window.open('https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=buy&cryptoAsset=BTC&fiatCurrency=NGN&fiatAmount=50000&redirectUrl=https://your-app.com/success', '_blank')"
>     >
>       Buy Bitcoin with NGN
>     </button>
> ```
>
> ### Buy to Specific Wallet Address
>
> ```html theme={null}
> <button
>   onclick="window.open('https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY&cryptoAsset=BTC&address=bc1qyourbitcoinaddress&network=BTC&fiatCurrency=NGN&redirectUrl=https://your-app.com/success', '_blank')"
> >
>   Buy Bitcoin to My Wallet
> </button>
> ```

> [tab] Kenya (KES)
>
> ### Buy Bitcoin with 5,000 KES
>
> ```html theme={null}
>     <button
>       onclick="window.open('https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY&side=buy&cryptoAsset=BTC&fiatCurrency=KES&fiatAmount=5000&redirectUrl=https://your-app.com/success', '_blank')"
>     >
>       Buy Bitcoin with KES
>     </button>
> ```
>
> ### Buy USDT with M-Pesa
>
> ```html theme={null}
> <button
>   onclick="window.open('https://sandbox.buy.busha.io/?publicKey=YOUR_PUBLIC_KEY&cryptoAsset=USDT&network=TRX&fiatCurrency=KES&fiatAmount=10000&redirectUrl=https://your-app.com/success', '_blank')"
> >
>   Buy USDT with M-Pesa
> </button>
> ```

***

## Configuration Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>publicKey</td>
      <td>Yes</td>
      <td>Your Busha Public API Key</td>
    </tr>

    <tr>
      <td>cryptoAsset</td>
      <td>No</td>

      <td>
        Cryptocurrency to buy (e.g., BTC, ETH, USDT)
      </td>
    </tr>

    <tr>
      <td>network</td>
      <td>No</td>

      <td>
        Blockchain network (e.g., BTC, ERC20, POLYGON)
      </td>
    </tr>

    <tr>
      <td>address</td>
      <td>No</td>
      <td>Pre-fill destination wallet address</td>
    </tr>

    <tr>
      <td>fiatCurrency</td>
      <td>No</td>

      <td>
        Fiat currency (NGN for Nigeria, KES for Kenya)
      </td>
    </tr>

    <tr>
      <td>fiatAmount</td>
      <td>No</td>
      <td>Amount in fiat currency</td>
    </tr>

    <tr>
      <td>cryptoAmount</td>
      <td>No</td>

      <td>
        Amount in crypto (ignored if fiatAmount is set)
      </td>
    </tr>

    <tr>
      <td>redirectUrl</td>
      <td>No</td>

      <td>
        URL to redirect after transaction completion
      </td>
    </tr>
  </tbody>
</table>

***

## React Component Examples

> [tab] Nigeria (NGN)
>
> ```jsx theme={null}
>     import React from "react";
>
>     function BuyBitcoinButton() {
>       const openOnRamp = () => {
>         const params = new URLSearchParams({
>           publicKey: "YOUR_PUBLIC_KEY",
>           cryptoAsset: "BTC",
>           fiatCurrency: "NGN",
>           fiatAmount: "50000",
>           redirectUrl: "https://your-app.com/success",
>         });
>
>         window.open(`https://sandbox.buy.busha.io/?${params.toString()}`, "_blank");
>       };
>
>       return <button onClick={openOnRamp}>Buy Bitcoin with Naira</button>;
>     }
>
>     export default BuyBitcoinButton;
>
> ```

> [tab] Kenya (KES)
>
> ```jsx theme={null}
>     import React from "react";
>
>     function BuyBitcoinButton() {
>       const openOnRamp = () => {
>         const params = new URLSearchParams({
>           publicKey: "YOUR_PUBLIC_KEY",
>           cryptoAsset: "BTC",
>           fiatCurrency: "KES",
>           fiatAmount: "5000",
>           redirectUrl: "https://your-app.com/success",
>         });
>
>         window.open(`https://sandbox.buy.busha.io/?${params.toString()}`, "_blank");
>       };
>
>       return <button onClick={openOnRamp}>Buy Bitcoin with KES</button>;
>     }
>
>     export default BuyBitcoinButton;
> ```

***

## Complete Integration Flow

**1. User Initiates Purchase**

User clicks "Buy Crypto" button in your app

**2. Redirect to On-Ramp Widget**

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

**3. User Authentication**

User logs in to Busha (or signs up), completes KYC if needed

**4. User Reviews and Confirms**

User reviews transaction details including rate and fees, then confirms the
purchase

**5. User Selects Payment Method**

User chooses their preferred payment method: - **Nigeria**: Bank transfer -
**Kenya**: M-Pesa or mobile money

**6. User Completes Payment**

User completes the payment through their selected method

**7. Busha Processes Purchase**

Once payment is confirmed, Busha processes the crypto purchase and sends it
to the user's wallet

## Learn More

* [On-Ramp Widget Overview](https://docs.busha.io/overview/on-ramp-widget.md) - Understand how the widget works
* [Integration Guide](https://docs.busha.io/guides/widgets/integrate-on-ramp.md) - Detailed integration steps
* [Supported Currencies](https://docs.busha.io/guides/reference/supported-currencies.md) - See all supported assets
* [Webhooks Setup](https://docs.busha.io/guides/webhooks/setup.md) - Monitor transactions in real-time


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.