> ## Documentation Index
> Fetch the complete documentation index at: https://developer.me-cash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Quote (Offramp — Crypto to Fiat)

> Generate a ramp quote for converting cryptocurrency to fiat currency (e.g. USDC to NGN) for bank payout.

Use this endpoint to generate a quote for offramp transactions — converting crypto to fiat and delivering funds via bank transfer.

<Tip>
  **New to the Ramp API?** Read the [Ramp API Overview](/ramp-docs/ramp-api-overview) for the full lifecycle and all three transaction flows. See [Supported Assets & Destinations](/ramp-docs/supported-assets) for available fiat corridors.
</Tip>

## Endpoint

**POST** `{{baseURL}}/v1/ramp/quote`

***

## Request headers

| **Header**     | **Value**          | **Required** | **Description**                          |
| -------------- | ------------------ | ------------ | ---------------------------------------- |
| `Content-Type` | `application/json` | Yes          | Specifies that the request body is JSON. |
| `x-api-key`    | `YOUR_API_KEY`     | Yes          | API key for authentication.              |

***

## Request body

```json copy theme={null}
{
    "paymentChannel": "BANK_TRANSFER",
    "source": {
        "amount": 2,
        "symbol": "USDC",
        "blockchain": "MATIC"
    },
    "target": {
        "country": "NG",
        "currency": "NGN"
    }
}
```

### Body fields

| **Field**           | **Type** | **Required** | **Description**                                                     |
| ------------------- | -------- | ------------ | ------------------------------------------------------------------- |
| `paymentChannel`    | string   | Yes          | How fiat will be delivered to the recipient (e.g. `BANK_TRANSFER`). |
| `source.amount`     | number   | Yes          | Amount of crypto to convert.                                        |
| `source.symbol`     | string   | Yes          | Token symbol of the source asset (e.g. `USDC`).                     |
| `source.blockchain` | string   | Yes          | Blockchain network (e.g. `MATIC`).                                  |
| `target.country`    | string   | Yes          | ISO 3166-1 alpha-2 code for the recipient country (e.g. `NG`).      |
| `target.currency`   | string   | Yes          | ISO 4217 code for the fiat currency (e.g. `NGN`).                   |

<Note>
  **No `feeLevel` needed** — for offramp quotes, gas fees are calculated automatically and included in the quote response. You do not need to specify a fee level.
</Note>

***

## Request examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST '{{baseURL}}/v1/ramp/quote' \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "paymentChannel": "BANK_TRANSFER",
      "source": {
          "amount": 2,
          "symbol": "USDC",
          "blockchain": "MATIC"
      },
      "target": {
          "country": "NG",
          "currency": "NGN"
      }
    }'
  ```

  ```js JavaScript (fetch) theme={null}
  const payload = {
    paymentChannel: 'BANK_TRANSFER',
    source: {
      amount: 2,
      symbol: 'USDC',
      blockchain: 'MATIC'
    },
    target: {
      country: 'NG',
      currency: 'NGN'
    }
  };

  fetch('{{baseURL}}/v1/ramp/quote', {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(payload)
  })
    .then((res) => {
      if (!res.ok) throw new Error(`Request failed with status ${res.status}`);
      return res.json();
    })
    .then((body) => console.log(body))
    .catch((error) => console.error('Failed to create offramp quote', error));
  ```

  ```python Python (requests) theme={null}
  import requests

  url = "{{baseURL}}/v1/ramp/quote"
  headers = {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
  }
  payload = {
      "paymentChannel": "BANK_TRANSFER",
      "source": {
          "amount": 2,
          "symbol": "USDC",
          "blockchain": "MATIC",
      },
      "target": {
          "country": "NG",
          "currency": "NGN",
      },
  }

  response = requests.post(url, json=payload, headers=headers, timeout=30)
  response.raise_for_status()
  print(response.json())
  ```

  ```js Node.js (axios) theme={null}
  const axios = require('axios');

  axios.post('{{baseURL}}/v1/ramp/quote', {
    paymentChannel: 'BANK_TRANSFER',
    source: {
      amount: 2,
      symbol: 'USDC',
      blockchain: 'MATIC'
    },
    target: {
      country: 'NG',
      currency: 'NGN'
    }
  }, {
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    timeout: 30000
  })
    .then((response) => console.log(response.data))
    .catch((error) => {
      if (error.response) {
        console.error('API error:', error.response.data);
      } else {
        console.error('Request error:', error.message);
      }
    });
  ```
</CodeGroup>

***

## Successful response

```json copy theme={null}
{
    "message": "quote successfully created",
    "status": "success",
    "data": {
        "id": "108e2f2d-be85-4a49-93c8-333dd5746124",
        "source": {
            "currency": "USDC",
            "symbol": "USDC",
            "blockchain": "MATIC",
            "amount": 2,
            "type": "CRYPTOCURRENCY"
        },
        "target": {
            "currency": "NGN",
            "country": "NG",
            "amount": 3020,
            "type": "FIAT"
        },
        "quoteCurrency": "NGN",
        "rate": 1510,
        "fee": {
            "symbol": "USDC",
            "amount": 2,
            "gas": {}
        },
        "rules": [
            {
                "category": "LIMIT",
                "appliedCurrency": "NGN",
                "appliedCountry": "NG",
                "transaction": {
                    "minimum": 100,
                    "maximum": 1000000
                },
                "invoice": 500000
            }
        ],
        "summary": {
            "total": 2.0002
        },
        "settlement": "30 Mins"
    }
}
```

### Response field reference

| **Field**                          | **Type** | **Description**                                               |
| ---------------------------------- | -------- | ------------------------------------------------------------- |
| `data.id`                          | string   | Unique quote identifier — pass to `POST /v2/ramp/payout`.     |
| `data.source.currency`             | string   | Source currency name (e.g. `USDC`).                           |
| `data.source.symbol`               | string   | Source token symbol.                                          |
| `data.source.blockchain`           | string   | Source blockchain network.                                    |
| `data.source.amount`               | number   | Amount of crypto being converted.                             |
| `data.source.type`                 | string   | Asset type — `CRYPTOCURRENCY`.                                |
| `data.target.currency`             | string   | Fiat currency code (e.g. `NGN`).                              |
| `data.target.country`              | string   | Recipient country code (e.g. `NG`).                           |
| `data.target.amount`               | number   | Fiat amount the recipient will receive.                       |
| `data.target.type`                 | string   | Asset type — `FIAT`.                                          |
| `data.quoteCurrency`               | string   | Currency context for the quote rate.                          |
| `data.rate`                        | number   | Exchange rate applied (e.g. 1 USDC = 1510 NGN).               |
| `data.fee.symbol`                  | string   | Currency in which fees are denominated.                       |
| `data.fee.amount`                  | number   | Fee amount charged.                                           |
| `data.fee.gas`                     | object   | Gas fee details (may be empty for offramp quotes).            |
| `data.rules`                       | array    | Corridor-level transaction limits.                            |
| `data.rules[].category`            | string   | Rule category (e.g. `LIMIT`).                                 |
| `data.rules[].appliedCurrency`     | string   | Currency the limit applies to.                                |
| `data.rules[].appliedCountry`      | string   | Country the limit applies to.                                 |
| `data.rules[].transaction.minimum` | number   | Minimum transaction amount in `appliedCurrency`.              |
| `data.rules[].transaction.maximum` | number   | Maximum transaction amount in `appliedCurrency`.              |
| `data.rules[].invoice`             | number   | Invoice threshold — amounts above this require documentation. |
| `data.summary.total`               | number   | Total amount to debit from source (includes fees).            |
| `data.settlement`                  | string   | Estimated settlement time (e.g. `30 Mins`).                   |

***

## Error responses

| **Status** | **Error Code**  | **Message**                          | **Description**                                               |
| ---------- | --------------- | ------------------------------------ | ------------------------------------------------------------- |
| 400        | `INVALID_INPUT` | Invalid request payload              | One or more fields are missing or have invalid values.        |
| 400        | `INVALID_INPUT` | Invalid country or currency ISO code | Source/target country or currency combination is unsupported. |
| 401        | `UNAUTHORIZED`  | Missing or invalid API key           | The `x-api-key` header is missing or incorrect.               |
| 403        | `FORBIDDEN`     | Access denied                        | The authenticated user is not allowed to create quotes.       |
| 404        | `NOT_FOUND`     | Resource not found                   | The requested corridor does not exist.                        |
| 500        | `SERVER_ERROR`  | Internal server error                | An unexpected error occurred on the server.                   |

***

## Best practices

* Use the `rules` array to validate the target fiat amount is within corridor limits before calling payout.
* The `settlement` field indicates expected delivery time — surface this to your users.
* For offramp payouts, the recipient object requires bank account details. See [Create Ramp Payout](/ramp-docs/ramp-payout).
* Pass the `quoteId` to [`POST /v2/ramp/payout`](/ramp-docs/ramp-payout) to execute the transfer.

***

## Next steps

* [Create Ramp Payout](/ramp-docs/ramp-payout) — execute the offramp transfer with bank recipient details.
* [Create Quote (Crypto)](/ramp-docs/ramp-quote-crypto) — for crypto-to-crypto transfers.
* [Create Quote (Onramp)](/ramp-docs/ramp-quote-onramp) — for fiat-to-crypto purchases.
