# On-Ramping: Buying Crypto with Fiat

To make depositing as frictionless as possible, Pay.io offers On-Ramping functionality.

{% hint style="info" %}
**What is On-Ramping?**

**On-Ramping** is the process of **exchanging** **fiat** **money** (traditional currencies like EUR, USD, or GBP) for **cryptocurrency**.&#x20;
{% endhint %}

In the context of **Pay.io**, we provide **functionality** for your **players** to **purchase** **crypto** **directly** using their credit cards, debit cards, or services like Apple Pay, and have those funds automatically deposited into their casino wallet as a standard deposit.

This drastically **lowers** the **barrier** **to** **entry** for users who do not already hold cryptocurrency or are unfamiliar with managing external wallets.

#### How Does It Work?  — The User Flow

From the player's perspective, buying crypto is seamlessly integrated into your existing Cashier UI.

1. **Initiation**: The user navigates to your Cashier UI and clicks a custom “Buy Crypto” button (which your frontend will need to provide).
2. **Wallet Detection**: Our system automatically picks up the user's generated wallet address for the transaction from Pay.io data.&#x20;
3. **The Iframe Modal**: An iframe opens, displaying the on ramp provider's modal. The available cryptocurrencies and networks shown here are directly mapped from the [**assets** you have enabled in your Hot Wallet within the Merchant Console](/assets/asset-management-add-edit-disable.md).
4. **Payment and KYC**: The user selects their preferred fiat payment method (options like Visa, Mastercard, or Apple Pay will vary depending on their geographical location).
   * **First-time users** will be prompted to complete a quick KYC (Know Your Customer) verification within the widget before purchasing.
5. **Completion**: Once successful, the purchased crypto is routed to the user's wallet, and the funds will appear on your casino interface just like a regular crypto deposit.

{% hint style="info" %}
Note that the on ramp provider's modal may display both "**Buy**" and "**Sell**" tabs. \
Please note that **Pay.io** currently only **supports** the **BUY** **option**. Users should not attempt to use the "Sell" functionality through this specific iframe.
{% endhint %}

#### Integration Flow&#x20;

The integration relies on a single backend API call to generate a unique URL, which is then rendered on your frontend within an iframe.&#x20;

```mermaid
sequenceDiagram
    participant User as End User
    participant Frontend as Merchant Cashier UI
    participant Backend as Merchant Backend
    participant PayIO as Pay.io API
    participant Provider as Onramp Provider (MELD)

    User->>Frontend: Clicks "Buy Crypto" button
    Frontend->>Backend: Request onramp session
    Backend->>PayIO: POST /v1/user/onramp/get_url
    PayIO-->>Backend: Returns secure URL (link)
    Backend-->>Frontend: Passes URL to UI
    Frontend->>Frontend: Renders URL inside iFrame
    User->>Provider: Completes KYC & buys crypto via Fiat
    Provider-->>PayIO: Executes crypto transfer to user wallet
    PayIO-->>Frontend: Balance updated (Standard Deposit)
```

{% hint style="success" %}
**See full guide** on how to implement the on-ramping functionality in our [**API Reference guides**](/api-reference/user-payment-api/create-onramp-url/add-on-ramping-to-your-site.md)**.**&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pay.io/on-ramping-buying-crypto-with-fiat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
