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

# SportsX C# SDK API reference: services overview

> Every public service in STX.Sdk at a glance — method signatures, lifetimes, and real-time channels, with links to per-category detail pages.

The SportsX C# SDK exposes its functionality through a set of focused service classes that you register with the .NET dependency-injection container. Each service is transient unless otherwise noted, meaning the container creates a new instance per resolution. The sections below list every service and channel shipped in `STX.Sdk`, with one-line descriptions and links to the detailed reference pages. For task-oriented walkthroughs, see the [authentication](/sdks/csharp/authentication), [markets](/sdks/csharp/markets), and [trading](/sdks/csharp/trading) guides.

<CardGroup cols={2}>
  <Card title="Market data" icon="chart-line" href="/sdks/csharp/reference/market-data">
    `STXMarketService`, `STXEventService` — list, filter, and fetch markets and events.
  </Card>

  <Card title="Trading" icon="arrows-rotate" href="/sdks/csharp/reference/trading">
    `STXOrderService`, `STXTradeService` — place and cancel orders, query fills.
  </Card>

  <Card title="Account" icon="user" href="/sdks/csharp/reference/account">
    `STXProfileService`, `STXSettlementService`, `STXTermsAndConditionsService`.
  </Card>

  <Card title="Auth & 2FA" icon="key" href="/sdks/csharp/reference/auth-2fa">
    `STXLoginService`, `STXTokenService`, session lifecycle.
  </Card>
</CardGroup>

## Services

### IAuthService — `STXLoginService`

| Method                                                          | Description                                                                                           |
| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [`LoginAsync`](/sdks/csharp/reference/auth-2fa#stxloginservice) | Authenticates with email and password, optionally starts session keep-alive and checks pending T\&Cs. |

### IAuthService — `STXTokenService`

| Method                                                                 | Description                                                                                                             |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| [`LoginAsync`](/sdks/csharp/reference/auth-2fa#stxtokenservice)        | Low-level login — use directly when you need fine-grained control over the login/2FA/T\&C flow.                         |
| [`Confirm2FAAsync`](/sdks/csharp/reference/auth-2fa#stxtokenservice)   | Completes a two-factor authentication challenge using the OTP code and the `SessionId` from the initial login response. |
| [`RefreshTokenAsync`](/sdks/csharp/reference/auth-2fa#stxtokenservice) | Exchanges the stored refresh token for a fresh JWT. Throws `STXSessionExpiredException` when both tokens have expired.  |

### IMarketService — `STXMarketService`

| Method                                                                                                                       | Description                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [`GetMarketInfosAsync`](/sdks/csharp/reference/market-data#getmarketinfosasync)                                              | Returns a paginated list of full market objects, optionally filtered by status, sport, competition, or event. |
| [`GetMarketInfosWithCountAsync`](/sdks/csharp/reference/market-data#getmarketinfoswithcountasync)                            | Same as `GetMarketInfosAsync` but includes a total-count field for pagination UI.                             |
| [`GetMarketInfosAsync<T>`](/sdks/csharp/reference/market-data#getmarketinfosasync-generic)                                   | Generic variant — supply your own response model to project only the fields you need.                         |
| [`GetMarketInfosWithCountAsync<T>`](/sdks/csharp/reference/market-data#getmarketinfoswithcountasync-generic)                 | Generic variant with total count.                                                                             |
| [`GetShortMarketInfosAsync`](/sdks/csharp/reference/market-data#getshortmarketinfosasync)                                    | Lightweight fetch by market ID list — returns only ID, status, and title.                                     |
| [`GetShortMarketInfosWithLimitAsync`](/sdks/csharp/reference/market-data#getshortmarketinfoswithlimitasync)                  | Same as above but applies a server-side result limit.                                                         |
| [`GetShortMarketInfosWithCountAsync`](/sdks/csharp/reference/market-data#getshortmarketinfoswithcountasync)                  | Short market info plus total count.                                                                           |
| [`GetShortMarketInfosWithCountWithLimitAsync`](/sdks/csharp/reference/market-data#getshortmarketinfoswithcountwithimitasync) | Short market info with total count and server-side limit.                                                     |
| [`GetSportAndCompetitionsAsync`](/sdks/csharp/reference/market-data#getsportandcompetitionsasync)                            | Returns the full sports and competitions catalog.                                                             |

### IMarketService — `STXEventService`

| Method                                                                        | Description                                                                                        |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [`GetEventInfosAsync`](/sdks/csharp/reference/market-data#geteventinfosasync) | Returns events with their attached markets, filtered by sport, competition, status, or date range. |

### IOrderService — `STXOrderService`

| Method                                                                        | Description                                                                         |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`ConfirmOrderAsync`](/sdks/csharp/reference/trading#confirmorderasync)       | Places a single order with price, quantity, market, action, and type.               |
| [`ConfirmOrdersAsync`](/sdks/csharp/reference/trading#confirmordersasync)     | Places multiple orders in one request.                                              |
| [`CancelOrderAsync`](/sdks/csharp/reference/trading#cancelorderasync)         | Cancels a single order by ID.                                                       |
| [`CancelOrdersAsync`](/sdks/csharp/reference/trading#cancelordersasync)       | Cancels a batch of orders by ID list.                                               |
| [`CancelAllOrdersAsync`](/sdks/csharp/reference/trading#cancelallordersasync) | Cancels every open order for the authenticated user.                                |
| [`GetMyOrdersAsync`](/sdks/csharp/reference/trading#getmyordersasync)         | Retrieves order history with optional status, market, pagination, and sort filters. |

### ITradeService — `STXTradeService`

| Method                                                                                | Description                                                              |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [`GetMyTradesAsync`](/sdks/csharp/reference/trading#getmytradesasync)                 | Returns fill history with optional market, pagination, and sort filters. |
| [`GetMyTradesForOrderAsync`](/sdks/csharp/reference/trading#getmytradesfororderasync) | Returns all fills associated with a specific order ID.                   |

### ISettlementService — `STXSettlementService`

| Method                                                                          | Description                                                                                    |
| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [`GetMySettlementsAsync`](/sdks/csharp/reference/account#getmysettlementsasync) | Returns settlement history with optional filters for type, market, date range, and pagination. |

### IProfileService — `STXProfileService`

| Method                                                              | Description                                                                            |
| ------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [`GetProfileAsync`](/sdks/csharp/reference/account#getprofileasync) | Returns the authenticated user's profile, identifiers, jurisdiction, and loyalty tier. |

## All services at a glance

| Service                           | Purpose                                                 | Lifetime           |
| --------------------------------- | ------------------------------------------------------- | ------------------ |
| `STXLoginService`                 | High-level login, dispatches 2FA and T\&C checks        | Transient          |
| `STXTokenService`                 | Low-level login, `Confirm2FAAsync`, `RefreshTokenAsync` | Transient          |
| `STXSessionBackgroundService`     | Auto-refreshes JWT in the background                    | Singleton (hosted) |
| `STXProfileService`               | `GetProfileAsync`                                       | Transient          |
| `STXTermsAndConditionsService`    | Get, check, and accept terms and conditions             | Transient          |
| `STXMarketService`                | Market catalog with filtering and pagination            | Transient          |
| `STXEventService`                 | Events with attached markets                            | Transient          |
| `STXOrderService`                 | Place, cancel, and query orders                         | Transient          |
| `STXTradeService`                 | Fill history                                            | Transient          |
| `STXSettlementService`            | Settlement history                                      | Transient          |
| `STXGeoLocationService`           | Current geo token                                       | Transient          |
| `STXGeoLocationBackgroundService` | Keeps the geo token fresh                               | Singleton (hosted) |
| `STXGeoFencingLicenseService`     | GeoComply license                                       | Transient          |

## Real-time channels at a glance

The SDK ships a set of WebSocket channels for streaming updates. Subscribe to these instead of polling when you need low-latency state changes.

| Channel                              | Topic                                      | Payload                           |
| ------------------------------------ | ------------------------------------------ | --------------------------------- |
| `STXPortfolioChannel`                | `portfolio:{user_id}`                      | Balance, escrow, and P\&L summary |
| `STXActiveOrdersChannel`             | `active_orders:{user_id}`                  | Order state transitions           |
| `STXActiveTradesChannel`             | `active_trades:{user_id}`                  | New fills                         |
| `STXActiveSettlementsChannelWrapper` | `active_settlements:{user_id}`             | Settlement events                 |
| `STXPositionsChannel`                | `active_positions:{user_id}`               | Position changes                  |
| `STXUserInfoChannel`                 | `user_info:{user_id}`                      | Profile and account changes       |
| `STXMarketChannel`                   | `markets`, `market_info`, `market_updates` | Prices and market state           |
