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

# On-Ramp

> Convert local fiat, airtime, or mobile money into crypto tokens and gems.

# On-Ramp

Enables users to purchase on-chain crypto or in-game gems using local payment rails.

***

## Get On-Ramp Quote

Calculates the exact exchange rate, platform fee, and estimated crypto payout for a given fiat amount.

### Endpoint

```http theme={null}
POST /api/v2/payment/on-ramp/quote
```

### Headers

```http theme={null}
Authorization: Bearer <jwt_access_token>
```

### Request Body

| Field            | Type     | Required | Description                             |
| :--------------- | :------- | :------- | :-------------------------------------- |
| `fiatAmount`     | `number` | **Yes**  | Amount in local currency                |
| `fiatCurrency`   | `string` | **Yes**  | Local currency code (e.g. `NGN`, `KES`) |
| `cryptoCurrency` | `string` | **Yes**  | Target crypto token (e.g. `LISK_USDT`)  |

```json theme={null}
{
  "fiatAmount": 15000,
  "fiatCurrency": "NGN",
  "cryptoCurrency": "LISK_USDT"
}
```

### Response (200 OK)

```json theme={null}
{
  "success": true,
  "data": {
    "quoteId": "quote-98231",
    "fiatAmount": 15000,
    "fiatCurrency": "NGN",
    "cryptoAmount": 10.2,
    "cryptoCurrency": "LISK_USDT",
    "exchangeRate": 1470.58,
    "expiresAt": "2026-08-22T02:45:00.000Z"
  }
}
```

***

## Initialize On-Ramp Order

Creates the on-ramp order and returns payment checkout instructions.

### Endpoint

```http theme={null}
POST /api/v2/payment/on-ramp/initiate
```

### Request Body

```json theme={null}
{
  "quoteId": "quote-98231",
  "paymentMethod": "BANK_TRANSFER",
  "phoneNumber": "+2348012345678"
}
```

### Response (201 Created)

```json theme={null}
{
  "success": true,
  "data": {
    "orderId": "order-onramp-4412",
    "status": "PENDING_PAYMENT",
    "paymentUrl": "https://pay.fonbnk.com/checkout/4412",
    "accountDetails": {
      "bankName": "Wema Bank",
      "accountNumber": "9928371923",
      "accountName": "Fonbnk / LearnWay"
    }
  }
}
```
