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

# Quotes

> Lock a fiat→crypto rate before creating a session

A quote is a **price lock**. It pins the fiat→crypto exchange rate for a chosen chain and asset, with its own short expiry — but it derives no deposit address and starts no payment watcher. That only happens when you create a [checkout session](/api/reference/checkout-sessions) from the quote.

Use quotes when you want to show a customer exactly how much crypto they'll pay (coin, chain, amount, and how long that price is good for) **before** committing to a session. When the customer proceeds, create a session from the quote and the checkout opens on the pay step with the coin already selected.

## The quote object

| Field               | Type           | Description                                                          |
| ------------------- | -------------- | -------------------------------------------------------------------- |
| `id`                | uuid           | Unique identifier                                                    |
| `object`            | string         | Always `"quote"`                                                     |
| `linkId`            | uuid \| null   | The payment link this quote was derived from, if any                 |
| `chainId`           | integer        | Chain the price is locked for                                        |
| `asset`             | string         | Asset symbol, e.g. `"ETH"`, `"USDC"`                                 |
| `tokenAddress`      | string \| null | ERC-20 contract address; `null` for the chain's native coin          |
| `amount.base`       | string         | Amount owed in the asset's smallest unit                             |
| `amount.formatted`  | string         | Human-readable amount, e.g. `"0.0192"`                               |
| `amount.decimals`   | integer        | Decimals for the asset                                               |
| `fiat.amount`       | string         | Fiat amount, e.g. `"100.00"`                                         |
| `fiat.currency`     | string         | e.g. `"USD"`                                                         |
| `unitPriceUsd`      | string         | USD unit price locked at quote time (`1` for USD-pegged stablecoins) |
| `expiresAt`         | datetime       | When the locked price expires                                        |
| `consumed`          | boolean        | `true` once a session has been created from this quote               |
| `checkoutSessionId` | uuid \| null   | The session created from this quote, if any                          |
| `livemode`          | boolean        |                                                                      |
| `createdAt`         | datetime       |                                                                      |

## Two modes

**Link mode** — quote an existing payment link. The fiat amount and currency come from the link.

```json theme={null}
{ "linkId": "pl_...", "chainId": 8453, "asset": "USDC" }
```

**Ad-hoc mode** — quote a custom amount.

```json theme={null}
{ "amount": { "value": "100.00", "currency": "USD" }, "chainId": 1, "asset": "ETH" }
```

`chainId` and `asset` are optional; omit them to use the merchant's default network and asset.

## Lifecycle

1. `POST /quotes` → you receive a quote with a locked `amount` and `expiresAt`.
2. Show the customer the coin, chain, amount and countdown.
3. `POST /checkout_sessions` with `{ "quoteId": "..." }` before it expires.
4. The session is created with the quote's locked price; the quote is marked `consumed` and cannot be reused.

A quote that expires or is never consumed simply falls away — nothing is charged and no address is derived.

<api-reference openapi="POST /quotes" />

<api-reference openapi="GET /quotes/{id}" />
