Logo

Game Controller Endpoints

Get Created Bets

Retrieve all created bets for a user. Includes all matched and unmatched bets.

Method: GET
Path: /bets/{principal}/created


Parameters

NameTypeDescriptionOptional
principalstringThe principal/canister you wish to get bets for. Parameter should be used within the path e.g. /bets/ndsa5-maaaa-aaaan-qmmpq-cai/createdNo

Response

[
    {
        "orderId": "9",
        "canisterId": "daiu6-niaaa-aaaan-qmg6q-cai",
        "user": "mxhfi-5uixs-aaaaa-ckkkx-ppppp-raysm-eysmq-um77i-na4ok-zf2rc-6qe",
        "eventId": 1192065,
        "createdAt": "2024-06-07T15:01:35.534Z",
        "marketId": 1,
        "marketName": "Czech Republic",
        "side": "buy",
        "odds": 110000000,
        "stake": 4999999,
        "initialContracts": 5500000,
        "unmatchedContracts": 0,
        "status": "filled",
        "commission": 0,
        "nftHolder": true,
        "outcome": "win",
        "_id": "66645d2f342e2c0c1b3d3e78",
        "eventDetails": {
            "sport": "football",
            "eventType": "fixture",
            "id": 1192065,
            "leagueId": 10,
            "season": "2024",
            "eventDetails": {
                "homeTeam": {
                    "name": "Czech Republic",
                    "logo": "https://media.api-sports.io/football/teams/770.png",
                    "score": 7
                },
                "awayTeam": {
                    "name": "Malta",
                    "logo": "https://media.api-sports.io/football/teams/1112.png",
                    "score": 1
                },
                "league": {
                    "name": "Friendlies",
                    "logo": "https://media.api-sports.io/football/leagues/10.png"
                },
                "time": "2024-06-07T16:30:00+01:00"
            },
            "status": "finished",
            "markets": [
                {
                    "id": 1,
                    "name": "Czech Republic",
                    "betType": "Final Result",
                    "result": true,
                    "_id": "66645d2f342e2c0c1b3d3d2d"
                },
                {
                    "id": 2,
                    "name": "Malta",
                    "betType": "Final Result",
                    "result": false,
                    "_id": "66645d2f342e2c0c1b3d3d2e"
                },
                {
                    "id": 3,
                    "name": "Draw",
                    "betType": "Final Result",
                    "result": false,
                    "_id": "66645d2f342e2c0c1b3d3d2f"
                }
            ],
            "date": "2024-06-07T15:30:00.000Z",
            "_id": "66645d2f342e2c0c1b3d3d2c"
        }
    },
    {
        "orderId": "240d86cd31c5f09acc424d6554cd48ee5b1ed9cea76266efa3088a9b6de263ff",
        "canisterId": "j3evk-6iaaa-aaaan-qmmwa-cai",
        "user": "mxhfi-5uixs-aaaaa-ckkkx-ppppp-raysm-eysmq-um77i-na4ok-zf2rc-6qe",
        "eventId": 1125929,
        "createdAt": "2024-06-09T15:46:38.854Z",
        "marketId": 2,
        "marketName": "Ethiopia",
        "side": "buy",
        "odds": 150000000,
        "stake": 19999999,
        "initialContracts": 30000000,
        "unmatchedContracts": 30000000,
        "status": "open",
        "commission": 0,
        "nftHolder": false,
        "outcome": "loss",
        "_id": "6665ed114a5c59acc17fd239",
        "eventDetails": {
            "sport": "football",
            "eventType": "fixture",
            "id": 1169682,
            "leagueId": 10,
            "season": "2024",
            "eventDetails": {
                "homeTeam": {
                    "name": "Montenegro",
                    "logo": "https://media.api-sports.io/football/teams/1109.png",
                    "score": 1
                },
                "awayTeam": {
                    "name": "Georgia",
                    "logo": "https://media.api-sports.io/football/teams/1104.png",
                    "score": 3
                },
                "league": {
                    "name": "Friendlies",
                    "logo": "https://media.api-sports.io/football/leagues/10.png"
                },
                "time": "2024-06-09T19:45:00+01:00"
            },
            "status": "finished",
            "markets": [
                {
                    "id": 1,
                    "name": "Montenegro",
                    "betType": "Final Result",
                    "result": false,
                    "_id": "666613374a5c59acc17fdfc4"
                },
                {
                    "id": 2,
                    "name": "Georgia",
                    "betType": "Final Result",
                    "result": true,
                    "_id": "666613374a5c59acc17fdfc5"
                },
                {
                    "id": 3,
                    "name": "Draw",
                    "betType": "Final Result",
                    "result": false,
                    "_id": "666613374a5c59acc17fdfc6"
                }
            ],
            "date": "2024-06-09T18:45:00.000Z",
            "_id": "666613374a5c59acc17fdfc3"
        }
    }
]
Previous
Get Stored Events