> ## 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.

# Commit Quote Request

> Lock in the best available quote and create a trade.

Commit the best available quote on an active quote request. The server revalidates all markets, selects the best quote that meets your `min_payout_odds_seen` threshold, and creates the trade atomically.

The request body includes fields that tie the commit to exactly what you last saw, preventing stale-price execution.

After a successful commit, the selected market maker receives a `quote:accepted` event and must confirm the trade before the `confirmation_deadline`. It may also receive `mm_quote:accepted` on its private `mm:quotes:{mm_id}` channel, with the final quote economics and exact exposure legs for immediate local risk reservation. From there, the vault settlement flow takes over.

## Authentication

API key required. Pass your API key in the `X-API-Key` header. The key needs the `trading:write` scope.

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

A Privy JWT (`Authorization: Bearer <jwt>`) is also accepted — see [Authentication](/guides/authentication).

## Path parameters

<ParamField path="id" type="string" required>
  The quote request ID (UUID).
</ParamField>

## Request body

<ParamField body="expected_version" type="integer" required>
  The quote request `version` you are committing against. The commit is rejected if the version has changed since you last received it, indicating the request was modified.
</ParamField>

<ParamField body="displayed_quote_id" type="string" required>
  The `id` of the best quote you saw at commit time.
</ParamField>

<ParamField body="displayed_quote_book_seq" type="integer" required>
  The `book_seq` value from the SSE event that delivered the displayed quote. Proves your data was up to date.
</ParamField>

<ParamField body="min_payout_odds_seen" type="number" required>
  The minimum payout odds you were shown. Only quotes at or above this threshold are eligible. Must be at least 1.0001.
</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="data">
    <ResponseField name="status" type="string">`"committed"`</ResponseField>
    <ResponseField name="quote_request_id" type="string">The quote request ID.</ResponseField>
    <ResponseField name="rfq_id" type="string">The created RFQ ID for vault settlement.</ResponseField>
    <ResponseField name="quote_id" type="string">The selected quote ID.</ResponseField>
    <ResponseField name="selected_payout_odds" type="number">The payout odds that were locked in.</ResponseField>
    <ResponseField name="confirmation_deadline" type="string">ISO 8601 deadline by which the market maker must confirm.</ResponseField>
  </Expandable>
</ResponseField>

## Rejection reasons

When a commit is rejected with `409 Conflict`, the `error.details.reason` field explains why:

| Reason                    | Description                                                                                                        |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `QUOTE_CHANGED`           | The `expected_version` does not match. The request was updated since you last fetched it.                          |
| `MARKET_NOT_LIVE`         | One or more markets are no longer available (expired, halted, or delisted).                                        |
| `QUOTE_EXPIRED`           | No active quotes exist, or the best quote expired between selection and commit.                                    |
| `COMMIT_FAILED`           | The commit could not be completed — for example no eligible market maker had sufficient collateral. Returns `409`. |
| `COMMIT_FAILED_RETRYABLE` | Transient error. Retry after a short delay. Returns `503`.                                                         |

## Errors

| Status | Code                  | Description                                        |
| ------ | --------------------- | -------------------------------------------------- |
| 400    | `VALIDATION_ERROR`    | Missing or invalid commit fields.                  |
| 401    | `UNAUTHORIZED`        | Missing or invalid API key.                        |
| 403    | `FORBIDDEN`           | You do not own this quote request.                 |
| 404    | `NOT_FOUND`           | Quote request not found.                           |
| 409    | `CONFLICT`            | Commit rejected. See `error.details.reason` above. |
| 503    | `SERVICE_UNAVAILABLE` | Transient failure. Retry after a short delay.      |

<RequestExample>
  ```bash theme={null}
  curl -X POST https://api.totalis.trade/v1/quote-requests/1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40/commit \
    -H "X-API-Key: $TOTALIS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "expected_version": 3,
      "displayed_quote_id": "b2c3d4e5-6789-0abc-def1-234567890abc",
      "displayed_quote_book_seq": 5,
      "min_payout_odds_seen": 4.25
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "status": "committed",
      "quote_request_id": "1a6d1f06-9d4f-47cb-994b-3bdfbbef7e40",
      "rfq_id": "c3d4e5f6-7890-abcd-ef12-34567890abcd",
      "quote_id": "d4e5f6a7-8901-bcde-f234-567890abcdef",
      "selected_payout_odds": 4.25,
      "confirmation_deadline": "2026-06-01T18:45:35.000Z"
    }
  }
  ```
</ResponseExample>
