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

# Confirm quote

> Confirm an accepted quote to lock in the trade and begin vault settlement.

Confirm an accepted quote to lock in the trade. Confirming triggers an atomic Solana transaction that locks the user's stake and your collateral in their respective vaults.

When a user commits your quote, you receive a `quote:accepted` WebSocket event. Confirm before its `confirmation_deadline`. The window is 5 seconds from acceptance by default, but it is configurable server-side, so honor the timestamp rather than a fixed duration.

You may also receive `mm_quote:accepted` on the same `mm:quotes:{mm_id}` channel. It adds richer quote economics and `exposure_legs`, for local risk reservation or analytics. Both events carry the same `quote_id`, and either is valid for confirmation. Their delivery order isn't guaranteed.

If you miss the deadline, the trade unwinds: the RFQ and your accepted quote both become `expired`, with reason `mm_confirmation_timeout`.

**Base URL:** `https://api.totalis.trade`

## Authentication

API key required. Pass your API key in the `X-API-Key` header.

```
X-API-Key: <key>
```

## Path parameters

<ParamField path="quoteId" type="string" required>
  The accepted quote ID (UUID): the `quote_id` from the `quote:accepted` WebSocket event. It also matches `quote_id` on the optional `mm_quote:accepted` event.
</ParamField>

## Request body

No request body required.

## Response

<ResponseField name="data" type="object">
  <Expandable title="data">
    <ResponseField name="status" type="string">`"confirmed"`</ResponseField>
    <ResponseField name="quote_id" type="string">The confirmed quote ID.</ResponseField>
    <ResponseField name="execution_id" type="string">Execution ID for tracking the vault settlement.</ResponseField>
  </Expandable>
</ResponseField>

## Errors

| Status | Code | Description |
| - | - | - |
| 401 | `UNAUTHORIZED` | Missing or invalid API key. |
| 403 | `FORBIDDEN` | You do not own this quote. |
| 404 | `NOT_FOUND` | Quote not found. |
| 409 | `CONFLICT` | Quote is not in `accepted` status (already confirmed, expired, or cancelled). |
| 409 | `CONFLICT` | Insufficient balance. Your aggregate risk across pending positions exceeds your available USDC (wallet + vault free balance). |
| 503 | `SERVICE_UNAVAILABLE` | Unable to verify your balance. Retry after a short delay. |

<RequestExample>
  ```bash theme={null}
  curl -X POST https://api.totalis.trade/v1/mm/quotes/d4e5f6a7-8901-bcde-f234-567890abcdef/confirm \
    -H "X-API-Key: $API_KEY"
  ```

  ```javascript JavaScript theme={null}
  // After receiving a quote:accepted WebSocket event
  ws.on('message', async (msg) => {
    const event = JSON.parse(msg);
    if (event.type === 'quote:accepted') {
      const res = await fetch(
        `https://api.totalis.trade/v1/mm/quotes/${event.data.quote_id}/confirm`,
        {
          method: 'POST',
          headers: { 'X-API-Key': API_KEY },
        }
      );
      const { data } = await res.json();
      console.log('Confirmed:', data.execution_id);
    }
  });
  ```

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

  # After receiving a quote:accepted WebSocket event
  quote_id = "d4e5f6a7-8901-bcde-f234-567890abcdef"

  resp = requests.post(
      f"https://api.totalis.trade/v1/mm/quotes/{quote_id}/confirm",
      headers={"X-API-Key": API_KEY},
  )
  data = resp.json()["data"]
  print(f"Confirmed: {data['execution_id']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "status": "confirmed",
      "quote_id": "d4e5f6a7-8901-bcde-f234-567890abcdef",
      "execution_id": "exec-a1b2c3d4e5f6"
    }
  }
  ```
</ResponseExample>


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