# gamePickGetActiveRounds — API (GamePickRound)

> Returns every open round for a MatchX or Quiz game template, with the full event list (matches / questions) and the current user's selections per event.
> Import: `import { GamePickRound } from '@smartico/public-api'`
> Search terms: gamePickGetActiveRounds, gamepick, GamePickRound, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickEvent, SAWGPMarketType, GamePickEventMeta, QuizAnswersValueType, GamePickResolutionType, errCode, data

## Signature
```ts
_smartico.api.gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>
```

## Parameters
- `props.saw_template_id` — ID of the MatchX or Quiz game template.

## Returns — `Promise<GamesApiResponse<GamePickRound[]>>`
Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:

Array of `GamePickRound`. Each item:
- `round_id` (number) — Unique round identifier
- `round_row_id` (number) — Sequential row ID used for ordering rounds
- `round_name` (string) — Localized display name of the round
- `round_description` (string) — Localized description of the round
- `final_screen_cta_button_title` (string) — Label for the CTA button on the final/results screen
- `final_screen_message` (string) — Message displayed on the final/results screen
- `final_screen_image_desktop` (string) — URL of the final screen image (desktop)
- `final_screen_image_mobile` (string) — URL of the final screen image (mobile)
- `promo_image` (string) — URL of the promotional image for the round
- `promo_text` (string) — Promotional text displayed with the round
- `open_date` (number) — Timestamp (ms) when the round opens for participation
- `last_bet_date` (number) — Timestamp (ms) of the last moment bets are accepted
- `resolution_date` (number) — Timestamp (ms) when the round is expected to be resolved
- `score_full_win` (number) — Points awarded for a fully correct prediction
- `score_part_win` (number) — Points awarded for a partially correct prediction
- `score_lost` (number) — Points awarded (or deducted) for an incorrect prediction
- `is_active_now` (boolean) — Whether the round is currently active for participation
- `is_resolved` (boolean) — Whether the round has been fully resolved and scored
- `round_status_id` (GPRoundStatus) — Current lifecycle status of the round
- `events_total` (number) — Total number of events in the round
- `events_resolved` (number) — Number of events that have been resolved
- `score_type_id` (GamePickScoreType) — Scoring method used for this round
- `order_events` (GameRoundOrderType) — How events are ordered for display
- `board_users_count` (number) — Maximum number of users shown on the leaderboard
- `hide_users_predictions` (boolean) — Whether other users' predictions are hidden until resolution
- `public_meta` (GamePickRoundPublicMeta) — Public metadata including translations and display settings from the BackOffice
  - `round_name` (string) — Localized round name
  - `round_description` (string) — Localized round description
  - `promo_image` (string) — URL of the promotional image for the round
  - `promo_text` (string) — Promotional text displayed with the round
  - `hide_resolved_round` (boolean) — Whether to hide the round from the UI after it has been resolved
  - `final_screen_image_desktop` (string) — URL of the final screen image for desktop
  - `final_screen_image_mobile` (string) — URL of the final screen image for mobile
  - `final_screen_message` (string) — Message displayed on the final/results screen
  - `final_screen_cta_button_title` (string) — Label for the CTA button on the final screen
  - `final_screen_cta_dp` (string) — Deep link triggered by the CTA button on the final screen
  - `allow_edit_answers` (boolean) — Whether users can edit their answers after initial submission (within betting window)
  - `_translations` ({
		[key: string]: {
			round_name: string;
			round_description: string;
			promo_image: string;
			promo_text: string;
			final_screen_image_desktop: string;
			final_screen_image_mobile: string;
			final_screen_message: string;
			final_screen_cta_button_title: string;
		};
	}) — Per-language overrides for round display content
- `next_round_open_date` (number) — Timestamp (ms) when the next round opens, if available
- `show_users_preference` (boolean) — Whether to show aggregated user preference percentages for each outcome
- `events` (GamePickEvent[]) — List of events (matches/questions) in this round
  - `gp_event_id` (number) — Unique identifier of the event
  - `event_resolution_date` (string) — ISO 8601 date-time string when the event was resolved; null until resolved.
  - `match_date` (string) — ISO 8601 date-time string of the match/event start time.
  - `market_type_id` (SAWGPMarketType) — Market type defining the prediction format (e.g. two-team score, quiz question, custom)
  - `event_meta` (GamePickEventMeta) — Event metadata containing team names, images, sport type, and question details
    - `answers` ({
		/** Answer identifier value sent on submission */
		value: string;
		/** Localized display text of the answer */
		text: string;
		/** Per-language overrides for the answer text */
		_translations: {
			[key: string]: {
				text: string;
			};
		};
	}[]) — List of possible answer options for the quiz question
    - `question_image` (string) — URL of an image associated with the question
    - `result` (QuizAnswersValueType) — Correct answer value after resolution
    - `custom_question` (string) — Custom question text displayed to the user
    - `event_name` (string) — Display name of the event/match
    - `team1_name` (string) — Name of the first team (home)
    - `team1_image` (string) — URL of the first team's logo image
    - `team2_name` (string) — Name of the second team (away)
    - `team2_image` (string) — URL of the second team's logo image
    - `team1_result` (number) — Actual result score for team 1 after resolution
    - `team2_result` (number) — Actual result score for team 2 after resolution
    - `sport_type_id` (number) — Betradar sport type ID for the event
    - `is_canceled` (boolean) — Whether the event has been canceled
    - `auto_resolve_enabled` (boolean) — Whether auto-resolution from live data feed is enabled
    - `auto_resolve_date` (string) — ISO date string for when auto-resolution is expected
    - `team1_auto_result` (number) — Auto-resolved score for team 1 from live data feed
    - `team2_auto_result` (number) — Auto-resolved score for team 2 from live data feed
    - `auto_result` (string) — Auto-resolved answer value from live data feed (for quiz events)
    - `_translations` ({
		[key: string]: {
			team1_name: string;
			team2_name: string;
			event_name: string;
			custom_question: string;
		};
	}) — Per-language overrides for team names, event name, and custom question
  - `user_placed_bet` (boolean) — Whether the current user has submitted a prediction for this event
  - `team1_user_selection` (number | { from: number; to: number }) — User's predicted score for team 1 (MatchX only). Can be a number or a range object
  - `team2_user_selection` (number | { from: number; to: number }) — User's predicted score for team 2 (MatchX only). Can be a number or a range object
  - `user_selection` (QuizAnswersValueType) — User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no')
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
  - `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
  - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
  - `question_image` (string) — URL of a question-specific image (quiz events)
- `user_score` (number) — Current user's total score in this round
- `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
- `has_open_for_bet_events` (boolean) — Whether there are events still open for betting
- `has_not_submitted_changes` (boolean) — Whether the user has unsaved changes to their predictions

## Behavioral contract
**Preconditions**
- User must be authenticated.
- `saw_template_id` must reference a MatchX or Quiz game template. The SDK
 throws synchronously if it's missing.

**Transport**
Game Pick methods are HTTP REST calls to a separate Game Pick games server
(not the main WebSocket). One consequence: there is no SDK cache and no push
subscription — every call is a fresh server roundtrip.

**Round status**
Each round's `round_status_id` is a `GPRoundStatus` value. Rounds with
status `NoEventsDefined` (1) are filtered out server-side and never appear
here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),
`AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only
briefly during transition; use `gamePickGetHistory` for resolved rounds).



**Refresh**
- No cache; every call is live.
- No push subscription. Poll while the user is on the screen if you need
 live round-status changes (typically every 30–60 s is enough).

**Visitor mode**: not supported. The SDK throws synchronously on visitor
sessions.

**UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).

## Example
```ts
const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });

if (r.errCode !== 0) {
    console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);
    return;
}

for (const round of r.data ?? []) {
    console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);
}
```

### Example response (REAL shape)
> Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
```json
{
  "errCode": 0,
  "data": [
    {
      "round_id": 40920,
      "round_row_id": 1,
      "public_meta": {
        "round_name": "Final",
        "_translations": {
          "BR": {},
          "TH": {}
        },
        "allow_edit_answers": true,
        "final_screen_cta_dp": null,
        "hide_resolved_round": false
      },
      "score_type_id": 1,
      "open_date": 1780282219930,
      "last_bet_date": 1786665540000,
      "is_active_now": true,
      "is_resolved": false,
      "round_status_id": -1,
      "score_full_win": 4,
      "score_part_win": 2,
      "score_lost": 0,
      "events_total": "8",
      "events_resolved": "7",
      "show_users_preference": true,
      "order_events": 1,
      "board_users_count": 20,
      "hide_users_predictions": false,
      "round_name": "Final",
      "user_score": 0,
      "user_placed_bet": false,
      "events": [
        {
          "gp_event_id": 136181,
          "market_type_id": 1,
          "event_meta": {
            "event_name": "UEFA Super Cup",
            "team1_name": "Paris Saint-Germain FC",
            "team2_name": "Aston Villa FC",
            "is_canceled": false,
            "team1_image": "https://cdn.example/gp-images-ai/16018/1783346543507-xtewml.png",
            "team2_image": "https://cdn.example/gp-images-ai/16018/1783346545290-i42wsu.png",
            "sport_type_id": 1,
            "scores_manually_adjusted": false
          },
          "event_resolution_date": null,
          "match_date": "2026-08-12T19:00:00.000Z",
          "odds_details": {
            "odd_value": {
              "1": 1.81,
              "2": 4.43,
              "X": 3.83
            }
          },
          "user_placed_bet": false,
          "resolution_score": 0,
          "is_open_for_bets": true,
          "resolution_type_id": 0
        }
      ],
      "has_open_for_bet_events": true,
      "has_not_submitted_changes": false
    }
  ]
}
```

## Errors
**Error codes** (in `errCode`)
- `0` — success.
- `100002` — template not found (the `saw_template_id` doesn't reference a
 MatchX/Quiz game).
- `100003` — no open rounds available for this template right now.
- `100000` — auth hash invalid; SDK session needs re-initialization.
- `100004` — generic server error.

## Related
- `gamePickGetActiveRound`
- `GPRoundStatus`
- `gamePickGetHistory`
- `GamesApiResponse`
- `GamePickRound`
