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

# Get orders for a game

> List your open orders and matched bets on a single game

For a given 4casters game id, returns the caller's open orders and matched (ungraded) bets for that game. Graded bets are not returned by this endpoint — use [Get graded wagers](/pages/rest/user/get-graded-wagers) for those.

## Request

`GET /user/getOrdersForGame`

<ParamField query="gameID" type="string" required>4casters game id.</ParamField>

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.4casters.io/user/getOrdersForGame?gameID=688c0516fbc14da0c202d426" \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```
</CodeGroup>

## Response

<ResponseField name="data.unmatched" type="array">
  Array of open orders on the game, sorted ascending by game start time. Same shape as [Get unmatched orders](/pages/rest/user/get-unmatched-orders).
</ResponseField>

<ResponseField name="data.matched" type="array">
  Array of matched (ungraded) bets on the game. Same shape as [Get matched bets](/pages/rest/user/get-matched-bets).
</ResponseField>

### Example

<CodeGroup>
  ```json JSON theme={null}
  {
    "data": {
      "unmatched": [/* UnmatchedOrder, ... */],
      "matched":   [/* MatchedBet, ...     */]
    }
  }
  ```
</CodeGroup>

## Errors

| Status | Meaning                                  |
| ------ | ---------------------------------------- |
| `404`  | `gameID` missing or not a valid game id. |


## OpenAPI

````yaml GET /user/getOrdersForGame
openapi: 3.1.0
info:
  title: 4casters REST API
  version: 1.0.0
  description: >-
    Public REST API for the 4casters peer-to-peer betting exchange. Use this API
    to manage your account, query the orderbook and games, and place / edit /
    cancel orders.


    All responses (unless noted otherwise) are JSON envelopes of the form `{
    "data": ... }`.
  contact:
    name: 4casters
    url: https://4casters.io
servers:
  - url: https://api.4casters.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Login and account session management
  - name: User
    description: Read account info, bets, and orders
  - name: Orders
    description: Place, edit, look up, and cancel orders
  - name: Markets
    description: Browse leagues, games, participants, and orderbooks
  - name: Affiliate
    description: Affiliate / referral commission
paths:
  /user/getOrdersForGame:
    get:
      tags:
        - User
      summary: Get orders for a game
      description: >-
        For a given 4casters game ID, return the caller's open (unmatched)
        orders and matched (ungraded) bets for that game. Graded bets are not
        returned by this endpoint — use `/user/getGradedWagers` for those.
      parameters:
        - $ref: '#/components/parameters/GameID'
      responses:
        '200':
          description: Orders and matched bets for the requested game
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      unmatched:
                        type: array
                        items:
                          $ref: '#/components/schemas/UnmatchedOrder'
                      matched:
                        type: array
                        items:
                          $ref: '#/components/schemas/MatchedBet'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Invalid Game ID
components:
  parameters:
    GameID:
      name: gameID
      in: query
      required: true
      schema:
        type: string
      description: >-
        A 4casters game id (`ObjectID`). Get game ids from `GET
        /exchange/v2/getGames` or `GET /exchange/v2/getOrderbook`.
  schemas:
    UnmatchedOrder:
      type: object
      description: An open order that is currently resting on the exchange.
      properties:
        id:
          type: string
        txID:
          type: string
        type:
          $ref: '#/components/schemas/MarketType'
        bet:
          type: number
        odds:
          type: integer
        spread:
          type: number
          nullable: true
        total:
          type: number
          nullable: true
        participantID:
          type: string
          description: Present for `moneyline` / `spread`.
        otherParticipantID:
          type: string
          description: The opposite participant id (the one whose side is being offered).
        expiry:
          type: string
          format: date-time
          nullable: true
        filled:
          type: number
        offered:
          type: number
        remaining:
          type: number
        takenRatio:
          type: number
        createdAt:
          type: string
          format: date-time
        origin:
          type: string
          description: '`offer` or `wager`.'
        graded:
          type: boolean
        closed:
          type: boolean
        adminRefund:
          type: boolean
        userReference:
          type: string
        wagerRequestID:
          type: string
        game:
          $ref: '#/components/schemas/GameSummary'
    MatchedBet:
      type: object
      description: A bet that has been matched but not yet graded.
      properties:
        id:
          type: string
        txID:
          type: string
        type:
          $ref: '#/components/schemas/MarketType'
        bet:
          type: number
        odds:
          type: integer
        spread:
          type: number
          nullable: true
        total:
          type: number
          nullable: true
        OU:
          type: string
          enum:
            - over
            - under
          description: Present for `total`.
        participantID:
          type: string
          description: Present for `moneyline` / `spread`.
        market:
          type: string
          description: Present for `moneyline1x2`.
        side:
          $ref: '#/components/schemas/MarketSide'
        userReference:
          type: string
        createdAt:
          type: string
          format: date-time
        matchedTime:
          type: string
          format: date-time
        graded:
          type: boolean
        closed:
          type: boolean
        origin:
          type: string
          description: '`offer` or `wager`.'
        adminRefund:
          type: boolean
        risk:
          type: string
        win:
          type: string
        fee:
          type: string
        game:
          $ref: '#/components/schemas/GameSummary'
    MarketType:
      type: string
      enum:
        - moneyline
        - spread
        - total
        - moneyline1x2
      description: >-
        Market type. `moneyline1x2` is **soccer-only** (three-way money line:
        home / away / draw).
    GameSummary:
      type: object
      properties:
        id:
          type: string
        league:
          type: string
        sport:
          type: string
        start:
          type: string
          format: date-time
        ended:
          type: boolean
        eventName:
          type: string
          nullable: true
        isFutures:
          type: boolean
        participants:
          type: array
          items:
            $ref: '#/components/schemas/Participant'
    MarketSide:
      type: string
      description: |-
        Order side. Meaning depends on `type`:

        - `moneyline`, `spread` — the participant id you are backing.
        - `total` — `"over"` or `"under"`.
        - `moneyline1x2` — `"yes"` or `"no"` on the outcome named by `market`.
    Participant:
      type: object
      properties:
        id:
          type: string
        longName:
          type: string
        shortName:
          type: string
        homeAway:
          type: string
          enum:
            - home
            - away
        mainPitcher:
          type: string
          nullable: true
        rotationNumber:
          type: string
          nullable: true
        futuresSide:
          type: string
          nullable: true
        score:
          type: number
          description: Final score; only present for ended games.
  responses:
    Unauthorized:
      description: Missing or invalid auth token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass your auth token in the `Authorization` header. The `Bearer` prefix
        is optional; the server also accepts a signed `auth` cookie or a `token`
        field in the request body.

````