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

# Create a quote

> Lock a price and get a payment ID.

Converts a cart total into a token amount at the current rate and locks it for a short window.

## Request

<ParamField path="body.merchantId" type="string" required>
  Your merchant ID.
</ParamField>

<ParamField path="body.cart" type="object" required>
  <Expandable title="cart">
    <ResponseField name="total" type="number" required>
      Order total in the display currency, e.g. `49.00`.
    </ResponseField>

    <ResponseField name="currency" type="string" required>
      `EUR` or `USD`.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField path="body.token" type="string" required>
  Settlement token: `USDC`, `USDT`, or `EURC`. Must be enabled for the chain.
</ParamField>

<ParamField path="body.chainId" type="number" required>
  Numeric chain ID. Must be enabled on your account.
</ParamField>

## Response

<ResponseField name="quoteId" type="string">Unique quote identifier.</ResponseField>
<ResponseField name="paymentId" type="string">Payment identifier — carry this through to payment creation and reconciliation.</ResponseField>
<ResponseField name="orderId" type="string">Your order reference, if supplied.</ResponseField>
<ResponseField name="stablecoinAmount" type="string">Amount to collect, in token base units.</ResponseField>
<ResponseField name="token" type="string">Settlement token.</ResponseField>
<ResponseField name="network" type="string">Human-readable network name.</ResponseField>
<ResponseField name="chainId" type="number">Numeric chain ID.</ResponseField>
<ResponseField name="fiatCurrency" type="string">Display currency.</ResponseField>
<ResponseField name="fiatTotal" type="number">Original cart total.</ResponseField>
<ResponseField name="usdEquivalent" type="number">USD equivalent, for reporting.</ResponseField>
<ResponseField name="fxRate" type="number">Rate used. Sourced on-chain, never from a third-party FX API.</ResponseField>
<ResponseField name="spreadPercent" type="number">Spread applied.</ResponseField>
<ResponseField name="tolerancePercent" type="number">Band within which a payment settles as exact.</ResponseField>
<ResponseField name="expiresAt" type="string">When the locked price lapses. The address stays valid afterwards.</ResponseField>
<ResponseField name="createdAt" type="string">Creation timestamp.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST $CC_API_BASE/create-quote \
    -H "apikey: $CC_PUBLISHABLE_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "merchantId": "your-merchant-id",
      "cart": { "total": 49.00, "currency": "EUR" },
      "token": "EURC",
      "chainId": 8453
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch(
    `${process.env.CC_API_BASE}/create-quote`,
    {
      method: "POST",
      headers: {
        apikey: process.env.CC_PUBLISHABLE_KEY,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        merchantId: process.env.CC_MERCHANT_ID,
        cart: { total: 49.0, currency: "EUR" },
        token: "EURC",
        chainId: 8453,
      }),
    }
  );

  const { quote } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "quote": {
      "quoteId": "q_8f2a…",
      "paymentId": "0x9c1b…",
      "orderId": "order-1042",
      "stablecoinAmount": "49000000",
      "token": "EURC",
      "network": "Base",
      "chainId": 8453,
      "fiatCurrency": "EUR",
      "fiatTotal": 49.0,
      "usdEquivalent": 53.17,
      "fxRate": 1.085,
      "spreadPercent": 0.0,
      "tolerancePercent": 0.5,
      "expiresAt": "2026-08-09T15:02:11.204Z",
      "createdAt": "2026-08-09T14:32:11.204Z"
    }
  }
  ```
</ResponseExample>

## Notes

<AccordionGroup>
  <Accordion title="Expiry locks the price, not the address" icon="clock">
    After `expiresAt` the quote is stale, but a payment address issued from it keeps working. Late payments arrive and are credited. [Finality](/concepts/finality).
  </Accordion>

  <Accordion title="Rates come from on-chain sources" icon="link">
    EUR/USD is derived from an on-chain liquidity pool rather than a third-party FX API, so the rate you're quoted is one anyone can verify.
  </Accordion>

  <Accordion title="Minimums apply per chain" icon="ruler">
    Very small orders on expensive chains are rejected for the deposit rail. The connect rail has no minimum. [Limits](/reference/limits).
  </Accordion>
</AccordionGroup>

## Errors

| Status | Meaning                                            |
| ------ | -------------------------------------------------- |
| `400`  | Missing or malformed field                         |
| `403`  | Token or chain not enabled for your account        |
| `404`  | Merchant not found                                 |
| `422`  | Amount below minimum, or merchant setup incomplete |
| `429`  | Rate limited — respect `Retry-After`               |
| `502`  | Upstream chain data unavailable — retry            |

[Full error reference](/api/errors).
