Skip to main content
GET
/
user
/
getBetByID
Get bet by ID or txID
curl --request GET \
  --url https://api.4casters.io/user/getBetByID \
  --header 'Authorization: Bearer <token>'
{
  "bet": {
    "id": "<string>",
    "txID": "<string>",
    "bet": 123,
    "odds": 123,
    "spread": 123,
    "total": 123,
    "participantID": "<string>",
    "market": "<string>",
    "side": "<string>",
    "userReference": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "matchedTime": "2023-11-07T05:31:56Z",
    "graded": true,
    "closed": true,
    "origin": "<string>",
    "adminRefund": true,
    "risk": "<string>",
    "win": "<string>",
    "fee": "<string>",
    "game": {
      "id": "<string>",
      "league": "<string>",
      "sport": "<string>",
      "start": "2023-11-07T05:31:56Z",
      "ended": true,
      "eventName": "<string>",
      "isFutures": true,
      "participants": [
        {
          "id": "<string>",
          "longName": "<string>",
          "shortName": "<string>",
          "mainPitcher": "<string>",
          "rotationNumber": "<string>",
          "futuresSide": "<string>",
          "score": 123
        }
      ]
    }
  }
}

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.

Look up a single bet (matched, graded, or open offer) belonging to the caller. Pass either id or txID, not both.

Request

GET /user/getBetByID
id
string
Bet id from a list endpoint such as /user/getMatchedBets.
txID
string
Transaction id, e.g. the wagerRequestID or txID returned by /session/v3/place.
You must pass exactly one of id or txID.
curl "https://api.4casters.io/user/getBetByID?txID=64824b329556daa319747e31" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

The shape of bet depends on the bet’s current state:
  • A graded bet returns the GradedWager shape, including risk, win, fee, and result.
  • A matched bet returns the MatchedBet shape.
  • An open offer returns the UnmatchedOrder shape.
Note that, unlike most endpoints, this one returns the bet at the top level (not under data).

Example

{
  "bet": {
    "id": "667c1e870c0d22ec36ccb438",
    "txID": "667c1e870c0d22ec36ccb439",
    "type": "moneyline",
    "bet": 222,
    "graded": false,
    "closed": false,
    "createdAt": "2024-06-26T13:58:31.224Z",
    "origin": "offer",
    "wagerRequestID": "667c1e870c...",
    "game": {
      "id": "6679ee8c9f05a804e064b6ed",
      "league": "FED-EX-500",
      "sport": "golf",
      "start": "2024-06-27T10:45:00.000Z",
      "ended": false,
      "participants": [/* ... */]
    }
  }
}

Errors

StatusMeaning
400Both id and txID missing, or no bet found for the supplied identifier.

Authorizations

Authorization
string
header
required

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.

Query Parameters

id
string

Bet id from a list endpoint.

txID
string

Transaction id (e.g. wagerRequestID or txID returned from place).

Response

The bet, in matched, graded, or open form depending on its current state.

bet
object

A bet that has been matched but not yet graded.