Skip to content

Create markets

Creates player-prop markets on a scheduled event. Needs an OAuth app token (client credentials) carrying the markets.write scope, which STX grants on request, sent from an address on the client’s IP allow-list; an API key is refused. Describe each market with stat_detail: a player_id and a stat from GET /api/v1/events/{event_id}/players, prop_type ou and a positive half line. STX builds the title, rules and max price. Up to 100 markets per call. markets in the response has one outcome per entry, in request order: created or exists with the market_id, or rejected with a reason. Resending a market answers exists and never creates a duplicate.

POST
/api/v1/markets
Field Type Required Description
event_id string (uuid) yes The event to create the markets on, from GET /api/v1/events.
markets object[] yes 1 to 100 markets.
Status Description Schema
200 Success object
400 A parameter was missing or invalid. Error
401 Missing or invalid OAuth access token. Body: {“error”:“Missing or invalid OAuth access token”} Error
403 Not an OAuth app token carrying the markets.write scope (an API key or a member token included), or a call from outside the client’s IP allow-list ({"error":"ip_not_allowed"}). Error
404 No such event. Error
422 The whole request was refused: the event is not open for new markets (event_not_open: not scheduled, or already started), its type offers no player props (unsupported_event) or its rosters are not published yet (roster_unavailable). Body: {“error”:“<reason>”} Error

Request:

curl --request POST \
--url 'https://demo.stxapp.io/api/v1/markets' \
--header 'Authorization: Bearer <app-access-token>' \
--header 'Content-Type: application/json' \
--data '{
"event_id": "6f1c2e4a-9b3d-4c8e-a2f1-0d5e7b9c3a10",
"markets": [
{
"stat_detail": {
"line": 19.5,
"player_id": "1234567",
"prop_type": "ou",
"stat": "RUSH_YDS"
}
}
]
}'

Response 200:

{
"event_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"markets": [
{
"market_id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"reason": "invalid_market",
"stat_detail": {},
"status": "created"
}
]
}
Field Type Description
event_id uuid The event.
market_id uuid The market, for created and exists.
reason string Why the market was rejected: a malformed entry (invalid_market), not a player stat line (unsupported_market_type), a prop_type other than ou (unsupported_prop_type), a stat not on offer (unsupported_stat), a line that is not a positive half (invalid_line), a player_id not on the event’s rosters (unknown_player), the event started while the request ran (event_not_open), or refused when created (not_created).
stat_detail object The stat_detail as sent.
status string created, exists (already listed, so nothing new was created) or rejected.
v1.5.9Changelogllms.txtllms-full.txt