# Public Statistics Selections

Per-request selection-accuracy and processing-time statistics.
Returns the same raw data as the in-app "Exported requests overview"
dashboard: for each request in the range, how its positions'
selections were resolved — `auto_selected` (resolved without prediction
ranking), `prediction_correct` (chosen article was among Mercura's
predictions), or `manual` (chosen article not predicted). The three counts
sum to `selection_count`. Each row also carries the request `status`, the true
handling time `active_seconds` (engaged working time from usage telemetry;
tenders only), and the `first_opened_at` / `exported_at` /
`completed_at` lifecycle timestamps. Divide `active_seconds` by
`position_count` / `selection_count` for a per-position / per-selection
figure. Rows are newest-first by request creation time. Compute hit-rate /
accuracy percentages client-side from the raw counts. By default only
exported requests are returned; pass `include_unexported=true` to also see
requests still in progress.

Endpoint: GET /statistics/selections
Version: 1.33.0

## Query parameters:

  - `start_date` (string, required)
    Inclusive start of the range (YYYY-MM-DD), anchored to the request creation date.

  - `end_date` (string, required)
    Inclusive end of the range (YYYY-MM-DD). The window is capped at 400 days.

  - `cursor` (string | null)
    Opaque cursor from a prior page's ``next_cursor``. Keep ``start_date`` / ``end_date`` present on every page; the cursor resumes strictly after the last row already returned.

  - `limit` (integer | null)
    Maximum rows per page (default 100).

  - `include_unexported` (boolean)
    By default only exported requests are returned (the in-app dashboard universe). Set to ``true`` to also include requests still in progress (never exported), so you can compare how many were uploaded vs. successfully exported. Each row's ``status`` and ``exported_at`` distinguish the two.

## Header parameters:

  - `authorization` (string | null)
    Bearer <mrc_live_…> API key

## Response 200 fields (application/json):

  - `data` (array, required)

  - `data.request_id` (string, required)
    Mercura request id. Resolve the full record via `GET /tenders/{request_id}` when `request_type` is `TENDER`, or `GET /orders/{request_id}` when `ORDER`.

  - `data.request_type` (string, required)
    Which resource a statistics row's `request_id` resolves against.
    Enum: "TENDER", "ORDER"

  - `data.request_name` (string, required)
    Request name / title (e.g. the LV subject line).

  - `data.status` (string, required)
    Mercura-side processing lifecycle of a request.
A request is uploaded as `NEW`, moves through `IN_PROGRESS` while it is
being worked, and becomes `DONE` once completed/exported. `PARSING` /
`PARSING_FAILED` are transient intake states; `CANCELLED` is a request
that was abandoned. Pair this with `exported_at` to tell an exported
request apart from one that is still open (uploaded but not yet exported).
    Enum: "NEW", "IN_PROGRESS", "DONE", "CANCELLED", "PARSING", "PARSING_FAILED"

  - `data.created_on` (string, required)
    Date the request was created (UTC).

  - `data.first_opened_at` (string | null)
    UTC timestamp a user first opened the request — the start of active handling. `null` if it was never opened. The handling time of a request is `exported_at - first_opened_at`.

  - `data.exported_at` (string | null)
    UTC timestamp the request was first exported to the partner system, or `null` if it has not been exported yet (only ever `null` when `include_unexported=true`).

  - `data.completed_at` (string | null)
    UTC timestamp of the most recent completion / re-export. Unlike `exported_at` (set once, on the first export) this advances on every re-export. `null` until the request is completed.

  - `data.active_seconds` (integer | null)
    True handling time: the total **active** (engaged) seconds a user spent working on this request before it was exported — the exact per-request figure behind the in-app 'time per position' metric, summed from usage telemetry. Counts only time the request was actively being worked, so unlike `exported_at - first_opened_at` (wall-clock, includes idle gaps) it reflects real effort. Divide by `position_count` / `selection_count` for a per-position / per-selection figure. Defined for **exported tenders** only: `null` for orders, for requests not yet exported, and for exported requests with no recorded active time (telemetry unavailable).

  - `data.position_count` (integer, required)
    Number of relevant positions on the request.

  - `data.positions_with_selection` (integer, required)
    Number of relevant positions that carry at least one selection — i.e. the positions that were actually resolved. Always `<= position_count` (a relevant position may end up with no selection), and not interchangeable with `selection_count`, which counts *selections* rather than positions (one position can carry several: alternatives, accessories). **This is the denominator behind the in-app time-per-position metric**: divide `active_seconds` by it, and aggregate as a pooled `SUM(active_seconds) / SUM(positions_with_selection)` to match what the dashboard reports.

  - `data.selection_count` (integer, required)
    Total surviving selections on relevant positions — the sum of the three outcome counts below.

  - `data.auto_selected_count` (integer, required)
    Selections resolved by a mechanism that bypasses prediction ranking (article-number match, master / historic / cluster / duplicate / equivalent-position propagation, parts-list lookup, default article, or an auto-selection the order-entry agent makes on its own).

  - `data.prediction_correct_count` (integer, required)
    Prediction-driven selections where the chosen article was among Mercura's predictions for that position (predicted vs. not-predicted; the earlier top-10 rank cut has been removed, as the order-entry agent surfaces only a handful of candidates per position).

  - `data.manual_selection_count` (integer, required)
    Prediction-driven selections where the chosen article was NOT among Mercura's predictions for that position (shown as "Manual selections" in the dashboard).

  - `next_cursor` (string | null)

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array, required)

  - `detail.msg` (string, required)

  - `detail.type` (string, required)

  - `detail.input` (any)

  - `detail.ctx` (object)

