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

# Get a Crypto/Fiat Quote

> Fetch a real-time crypto-to-fiat or fiat-to-crypto price quote. Optionally reserve the rate with a quoteId for order creation.

Use the **GET** `/v2/user/crypto-quote` endpoint to retrieve a real-time conversion rate between a cryptocurrency and a fiat currency. The `price` is always expressed in units of fiat per 1 unit of crypto. Use `from` and `to` to choose the side: when `from` is a fiat currency of the given `country`, you get the buy rate used for on-ramp (`fiat_to_crypto`) orders; otherwise `from` is treated as the crypto and you get the sell rate used for off-ramp (`crypto_to_fiat`) orders. When you set `createQuoteId=true`, the API also returns a `quoteId` you can attach to an order to lock in that price. By default, this endpoint is limited to 500 requests per minute per account.

> [!WARNING]
>
> By default, a `quoteId` is valid for **10 seconds** in production and **300 seconds** in the sandbox, and is single-use. It is bound to your account and to the `country`, crypto, and fiat it was issued for; an order that uses it for a different combination, or after it expires, is rejected. An order-create request can consume a `quoteId` even if that request is then rejected.

## Request

```text theme={null}
GET /v2/user/crypto-quote
```

### Headers

| Header | Value | Required |
| - | - | - |
| `X-BH-TOKEN` | Your token from `GET /v2/token/generate` | ✓ |

### Query Parameters

**country** `string` *required*

Name of the country for which the quote is requested (e.g., `"Mexico"`).

**from** `string` *required*

The source currency symbol. Use a crypto ticker for a crypto-to-fiat quote (e.g., `"USDT"`) or a fiat code for a fiat-to-crypto quote (e.g., `"MXN"`).

**to** `string` *required*

The destination currency symbol. Use a fiat code for a crypto-to-fiat quote (e.g., `"MXN"`) or a crypto ticker for a fiat-to-crypto quote (e.g., `"USDT"`).

**createQuoteId** `boolean`

When `true`, reserves the quoted rate and returns a `quoteId`. Pass this `quoteId` when creating your order to lock in the price. Defaults to `false`.

## Response Fields

**code** `number`

HTTP-style status code. `200` indicates success.

**msg** `string`

Human-readable status message, e.g. `"SUCCESS"`.

**data** `object`

Object containing the quoted rate and optional quote reservation.

**data**

**price** `string`

Rate in units of fiat per 1 unit of crypto (e.g., `"21.3707"` MXN per USDT), whichever way `from` and `to` are set. When `from` is the fiat currency this is the buy rate; when `from` is the crypto it is the sell rate. Without a `quoteId`, the rate is for reference only and the order is priced when it is created.

**quoteId** `string`

Unique identifier for the reserved rate (e.g., `"e46836d68a4a4a6f8f2f609352cffb2f"`). Only present when `createQuoteId=true`. Valid for 10 seconds in production and 300 seconds in the sandbox; single-use by default.

## Examples

> [tab] Crypto → Fiat (price only)
>
> Fetch the current rate for USDT to Mexican Pesos without reserving a price.
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://api.velafi.com/v2/user/crypto-quote?country=Mexico&from=USDT&to=MXN' \
>   --header 'X-BH-TOKEN: YOUR_TOKEN'
> ```
>
> ```json Response theme={null}
> {
>   "code": 200,
>   "msg": "SUCCESS",
>   "data": {
>     "price": "21.3707"
>   }
> }
> ```

> [tab] Fiat → Crypto (with quoteId)
>
> Fetch the buy rate for USDT paid in Mexican Pesos and reserve it with a `quoteId`. The price is still MXN per USDT.
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://api.velafi.com/v2/user/crypto-quote?country=Mexico&from=MXN&to=USDT&createQuoteId=true' \
>   --header 'X-BH-TOKEN: YOUR_TOKEN'
> ```
>
> ```json Response theme={null}
> {
>   "code": 200,
>   "msg": "SUCCESS",
>   "data": {
>     "price": "21.4104",
>     "quoteId": "e46836d68a4a4a6f8f2f609352cffb2f"
>   }
> }
> ```

> [!NOTE]
>
> The `price` field is a reference rate. It reflects the current market price but does not guarantee execution at that rate unless you have a valid `quoteId` and submit your order within the reservation window.

> [!TIP]
>
> To maximise the chance of using a `quoteId` before it expires, request the quote immediately before submitting the order — not during user input flows.


## Related topics

- [Pay Out Local Currency Funded by Stablecoins](https://docs.velafi.com/docs/use-cases/payouts-funded-by-stablecoins.md)
- [Convert Local Currency to Stablecoins](https://docs.velafi.com/docs/use-cases/convert-to-stablecoins.md)
- [Get a Fiat/Fiat Quote](https://docs.velafi.com/api-reference/quote/get-user-quote-for-fiat-fiat.md)
- [Off-Ramp (Crypto to Fiat)](https://docs.velafi.com/docs/guides/off-ramp.md)
- [On-Ramp (Fiat to Crypto)](https://docs.velafi.com/docs/guides/on-ramp.md)


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