{ "openapi": "3.1.0", "info": { "title": "ABP v2 - Automated Bet Placing API", "description": "\nPlace bets across 36 bookmakers through a single API.\n\n## Authentication\n\nAll endpoints require the `x-api-key` header (except `/health`, `/ready`, `/status`, `/metrics`).\n\n**Swagger UI**: Click the **Authorize** button (lock icon) at the top right, enter your API key, and click **Authorize**.\n\n## Two surfaces: fixtures and futures\n\nSelections come in two kinds and each has its own path prefix, so no endpoint has to guess which identifiers it was given:\n\n| | Fixtures | Futures (outrights) |\n|---|---|---|\n| Prefix | `/fixtures/*` | `/futures/*` |\n| Selection | `fixtureId` + `outcomeId` + `playerId` | `futureId` + `futureOutcomeId` + `participantId` |\n| Status | fully live | reads live; placement and order/bet reads answer `501` |\n\nEach surface **rejects the other's identifiers** with `422`. The pre-split unprefixed paths (`/betslip`, `/place-orders`, `/orders`, `/bets`, `/markets`, …) still work unchanged and are listed here as deprecated aliases of their `/fixtures/*` equivalents.\n\n`/accounts`, `/bookmakers`, `/positions` and `/pnl` name no selection and stay unprefixed.\n\n## Quick Start\n\n1. **List your accounts**: `GET /accounts`\n2. **Get live odds**: `GET /fixtures/betslip?fixtureId=...&outcomeId=...&playerId=0`\n3. **Place an order**: `POST /fixtures/place-orders`\n4. **Track results**: `GET /fixtures/orders` or subscribe to WebSocket updates\n\n## WebSocket\n\nConnect to `/ws` for real-time order, bet, and settlement updates.\n\n```json\n{\"type\": \"login\", \"apiKey\": \"your-api-key\", \"channels\": []}\n```\n\nSend an empty `channels` array to receive all updates. Available channels: `orders`, `bets`, `settlements`, `accounts`, `balance`, `betslip`, `fixtures`, `currencies`, `status`, `emergency`.\n\nSend `{\"type\": \"ping\"}` every 30 seconds to keep the connection alive.\n", "version": "2.0" }, "servers": [ { "url": "https://v2.55-tech.com", "description": "Production" } ], "paths": { "/fixtures/betslip": { "get": { "tags": [ "Betslip" ], "summary": "Get live odds and betslip metadata for a fixture", "description": "Get current odds and metadata for a **fixture** selection: `fixtureId` + `outcomeId` + `playerId` (use `playerId=0` for non-player markets).\n\nFutures live on their own surface — **`GET /futures/betslip`**. `futureId`, `futureOutcomeId` and `participantId` are not accepted here.\n\n**Response includes:**\n- `fixtureInfo` — Fixture details (teams, sport, tournament, start time, scores)\n- `outcomeInfo` — Market and outcome details (market name, type, handicap)\n- `playerInfo` — Player details (for player prop markets, null otherwise)\n- `odds` — Live odds keyed by bookmaker, each entry keyed `{fixtureId}:{bookmaker}:{outcomeId}:{playerId}` and containing:\n - `price` — Current decimal odds\n - `limit` / `limitMin` — Max/min stake in account currency\n - `limitUsd` / `limitMinUsd` — Limits converted to USD\n - `limitCurrency` — Account currency for limits\n - `active` — Whether odds are currently available\n - `account` — Account username for this bookmaker\n - `currencyInfo` — Currency exchange rate details\n - `bookmakerFixtureId/MarketId/OutcomeId` — Bookmaker's internal IDs\n - `meta` — Exchange orderbook data (for Betfair, Polymarket, etc.)\n\n**Limit cascade:** account.minStake/maxStake > bookmaker.minStake/maxStake > odds.limitMin/limit", "operationId": "get_betslip_fixtures", "parameters": [ { "name": "fixtureId", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Fixture identifier (e.g., 'id1000004461512432').", "example": "id1000004461512432" }, { "name": "outcomeId", "in": "query", "required": true, "schema": { "type": "integer" }, "description": "Outcome identifier (e.g., 103 for Match Winner Away)", "example": 103 }, { "name": "playerId", "in": "query", "required": true, "schema": { "type": "integer" }, "description": "Player ID. Use 0 for non-player prop markets.", "example": 0 }, { "name": "bookmakers", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated bookmaker slugs (e.g., 'pinnacle,betfair-ex'). If omitted, uses all client's configured bookmakers.", "example": "pinnacle,sharpbet" } ], "responses": { "200": { "description": "Current odds and betslip metadata for a fixture", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetslipResponse" }, "example": { "fixtureId": "id1000002361061419", "outcomeId": 101, "playerId": 0, "client": "demo", "userRef": null, "fixtureInfo": { "fixtureId": "id1000002361061419", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 23, "tournamentName": "Serie A", "categoryName": "Italy" }, "season": { "seasonId": 130971, "seasonName": "Serie A 25/26" }, "startTime": 1770666300, "participants": { "participant1Id": 2702, "participant1Name": "AS Roma", "participant2Id": 2719, "participant2Name": "Cagliari Calcio" }, "externalProviders": { "betgeniusId": 12418676, "betradarId": 61061419, "flashscoreId": "QRHiwdZQ", "mollybetId": "2026-02-09,240,227", "pinnacleId": 1623026170, "sofascoreId": 13981664 } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 101, "outcomeName": "1" }, "playerInfo": null, "odds": { "polymarket": { "id1000002361061419:polymarket:101:0": { "price": 1.55, "limit": 0, "limitMin": 1, "limitCurrency": "USD", "limitUsd": 0, "limitMinUsd": 1, "active": true, "account": "0xAe58B89E84a625C8D0b7E630f40Cb163fcA73F01", "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "47560474994564756084533131483151433692089461304045858881876576415056110461089", "meta": { "lay": 2.817, "bookmakerLayOutcomeId": "68720233493513315549726110228454980604765404427736533364284705967981292940643" } } }, "pinnacle": { "id1000002361061419:pinnacle:101:0": { "price": 1.5, "limit": 15000, "limitMin": 5, "limitCurrency": "USD", "limitUsd": 15000, "limitMinUsd": 5, "active": true, "account": "PWFSE02PP1", "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "home", "meta": null } }, "sharpbet": { "id1000002361061419:sharpbet:101:0": { "price": 1.52, "limit": 751.343, "limitMin": 1, "limitCurrency": "EUR", "limitUsd": 886.13, "limitMinUsd": 1.18, "active": true, "account": "devsb01", "currencyInfo": { "currency": "EUR", "currencyValue": 0.84788876, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "7", "meta": null } } } } } } }, "400": { "description": "Invalid request parameters", "content": { "application/json": { "example": { "detail": "fixtureId, outcomeId, and playerId are required. Futures selections go to /futures/betslip." } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — no accounts for requested bookmaker(s) or sport not allowed", "content": { "application/json": { "example": { "detail": "No accounts configured for bookmaker(s): pinnacle" } } } }, "404": { "description": "No odds found for the given fixture/outcome/player combination", "content": { "application/json": { "example": { "detail": "No odds found for given parameters" } } } }, "500": { "description": "Internal server error" } } } }, "/fixtures/orders": { "get": { "tags": [ "Orders" ], "summary": "Get orders", "description": "Retrieve orders with keyset pagination. At least one filter must be provided.\n\n**Filters (OR logic):**\n- `orderIds` — Comma-separated list of order IDs\n- `requestUuids` — Comma-separated list of request UUIDs\n- `userRef` — User reference string\n\n**Pagination:**\n- Results are ordered by orderId descending (newest first)\n- Use `afterOrderId` from `nextCursor` in the response to fetch the next page\n- `hasMore` indicates if more results are available\n\nReturns enriched order details including bets and fixture/outcome/player metadata.\n\n**Order Status Values:** PENDING, PROCESSING, FILLED, PARTIALLY_FILLED, CANCELLED, REJECTED, EXPIRED, FAILED", "operationId": "get_orders_fixtures", "parameters": [ { "name": "orderIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated order IDs (e.g., '123,456,789')", "example": "123,456" }, { "name": "requestUuids", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated request UUIDs", "example": "eb45b192-317b-42d5-9f65-af497b9fa8c1" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "User reference to filter by", "example": "bettor1234" }, { "name": "afterOrderId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Cursor for pagination: fetch orders with orderId less than this value", "example": 1000 }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 1000 }, "description": "Maximum number of orders to return per page" } ], "responses": { "200": { "description": "Successfully retrieved matching orders with enriched metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrdersResponse" }, "example": { "orders": [ { "orderId": 371, "requestUuid": "9eb7d99a-ab9b-41f3-9a06-23e70006bbe5", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 50.0, "filledStake": 0.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T16:15:53.270816+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "PENDING", "createdAt": "2026-02-07T16:15:48.270816+00:00", "updatedAt": "2026-02-07T16:15:48.270816+00:00", "meta": null, "bets": [], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } }, { "orderId": 372, "requestUuid": "be81ba8f-55f4-48ed-a6f9-69b8d920263b", "allowedBookmakers": "sharpbet", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 2.65, "orderStake": 10.0, "filledStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T16:18:34.366795+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "FILLED", "createdAt": "2026-02-07T16:18:29.366795+00:00", "updatedAt": "2026-02-07T16:18:29.366795+00:00", "meta": null, "bets": [ { "betId": 91, "orderId": 372, "bookmaker": "sharpbet", "bookmakerBetId": "63aeba8d-a2d6-49ba-a6cd-7ce70bb17701", "placedPrice": 2.65, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T16:18:29.300906+00:00", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "userRef": "bettor1234", "requestUuid": "be81ba8f-55f4-48ed-a6f9-69b8d920263b", "declineReason": null } ], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "count": 2, "hasMore": false, "nextCursor": null } } } }, "400": { "description": "Missing required query parameter (at least one of orderIds, requestUuids, or userRef required)" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "404": { "description": "No orders found matching the filters" }, "500": { "description": "Internal server error" } } } }, "/fixtures/place-orders": { "post": { "tags": [ "Orders" ], "summary": "Place betting orders", "description": "Submit one or more betting orders for placement with bookmakers.\n\n**Required fields per order:** `requestUuid`, `outcomeId`, `playerId`, `orderPrice`, `orderStake`, `userRef`, `testOrder`, `fixtureId`\n\n**Optional fields:** `bookmakers`, `participantId` (futures only), `orderCurrency`, `back`, `expiresAt`, `acceptBetterOdds`, `acceptPartialStake`, `meta`\n\n**Key behavior:**\n- `requestUuid` must be a valid UUID format (used for idempotency — a duplicate within 30 minutes is skipped; if ALL orders in the request are duplicates the request returns 409)\n- `fixtureId` and `futureId` are mutually exclusive — provide one or the other\n- Orders with `futureId` currently return `501 Not Implemented` (coming soon)\n- Server automatically selects the best bookmaker by odds/limits unless `bookmakers` is specified\n- `clientName` is set automatically from your API key\n- Orders expire after `expiresAt` (default: 5 seconds from now, capped at 24 hours maximum)\n- Maximum 100 orders per request\n\n**Response:**\n- `status`: \"accepted\" (all accepted), \"partial-success\" (some declined), or \"declined\" (all declined)\n- `acceptedOrders`: Orders that passed validation with their current status and any placed bets\n- `declinedOrders`: Orders that failed validation with `declineReason`\n\n**Fixtures only.** `futureId`, `futureOutcomeId` and `participantId` are rejected with `422` — post futures orders to `POST /futures/place-orders`.", "operationId": "place_orders_fixtures", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrdersRequest" }, "example": { "orders": [ { "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "userRef": "bettor1234", "testOrder": false }, { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "fixtureId": "id1000000758265385", "outcomeId": 101, "playerId": 0, "orderPrice": 1.88, "orderStake": 250.25, "userRef": "bettor1234", "testOrder": false, "bookmakers": "pinnacle,vertex", "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T22:26:05Z", "acceptBetterOdds": true, "acceptPartialStake": true, "meta": { "strategy": "value", "source": "api" } } ] } } } }, "responses": { "200": { "description": "Order placement results with accepted and declined orders", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrdersResponse" }, "example": { "status": "partial-success", "acceptedOrders": [ { "orderId": 327, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "filledStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T17:29:37.311377+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "FILLED", "createdAt": "2026-02-07T17:29:32.265368+00:00", "updatedAt": "2026-02-07T17:29:32.265368+00:00", "meta": null, "bets": [ { "betId": 73, "orderId": 327, "bookmaker": "pinnacle", "bookmakerBetId": "3332684214", "placedPrice": 1.98, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "userRef": "bettor1234", "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "declineReason": null } ], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "declinedOrders": [ { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "allowedBookmakers": "vertex", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "clientName": "demo", "declineReason": "Odds temporarily unavailable; please retry", "bets": [] } ] } } } }, "400": { "description": "Validation error or all orders declined", "content": { "application/json": { "example": { "status": "declined", "acceptedOrders": [], "declinedOrders": [ { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "fixtureId": "id1000004461512432", "outcomeId": 103, "declineReason": "Order stake 100.00 USD exceeds available limit 50.00 USD", "bets": [] } ] } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "409": { "description": "Returned only when EVERY order in the request is a duplicate (each requestUuid already processed or in progress within the last 30 minutes). If only some orders are duplicates, the duplicates are skipped and the rest are processed normally.", "content": { "application/json": { "example": { "detail": { "error": "All orders are duplicates", "duplicateUuids": [ "eb45b192-317b-42d5-9f65-af497b9fa8c1" ], "inProgressUuids": [] } } } } }, "422": { "description": "Request body validation error (invalid field values)" }, "500": { "description": "Internal server error" } } } }, "/fixtures/cancel-orders": { "post": { "tags": [ "Orders" ], "summary": "Cancel specific orders", "description": "Cancel one or more orders by filter. At least one filter must be provided. Multiple filters are combined with OR logic.\n\n**Filters:**\n- `orderIds` — List of numeric order IDs\n- `requestUuids` — List of request UUID strings\n- `userRef` — Cancel all orders matching this user reference\n\n**Behavior:**\n- Only orders in PENDING or PARTIALLY_FILLED status can be cancelled\n- Orders with confirmed bets cannot be fully cancelled\n- Cancelled orders are marked in the database and signaled to stop retry loops", "operationId": "cancel_orders_fixtures", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersRequest" }, "example": { "requestUuids": [ "ee9f4007-e5ab-4085-bffb-8d938e4cad5f", "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d" ] } } } }, "responses": { "200": { "description": "Cancellation result with enriched order details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersResponse" }, "example": { "status": "cancelled", "cancelledCount": 1, "cancelled": [ { "orderId": 327, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "filledStake": 0.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T12:20:06.302841+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "CANCELLED", "createdAt": "2026-02-07T12:20:01.302841+00:00", "updatedAt": "2026-02-07T12:20:01.302841+00:00", "meta": null, "bets": [], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "outcomeId": 103, "outcomeName": "2" } } ], "notCancelled": { "reason": "Order not cancellable", "orders": [] } } } } }, "400": { "description": "Missing required filter parameter (at least one of orderIds, requestUuids, or userRef required)" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "404": { "description": "No matching orders found" }, "500": { "description": "Internal server error" } } } }, "/fixtures/cancel-all-orders": { "post": { "tags": [ "Orders" ], "summary": "Cancel all pending orders", "description": "Cancel ALL pending and partially-placed orders for the authenticated client.\n\n**Behavior:**\n- Cancels orders in PENDING or PARTIALLY_FILLED status\n- Only cancels orders without already-placed bets\n- Orders with confirmed bets are returned in `notCancelled`\n- No request body required", "operationId": "cancel_all_orders_fixtures", "responses": { "200": { "description": "Cancellation result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "500": { "description": "Internal server error" } } } }, "/fixtures/bets": { "get": { "tags": [ "Bets" ], "summary": "Get bets", "description": "Retrieve bets by various filters with keyset pagination. At least one filter must be provided.\n\n**Filters (OR logic):**\n- `betIds` — Comma-separated list of bet IDs\n- `orderIds` — Comma-separated list of order IDs\n- `userRef` — User reference string\n\n**Pagination:**\n- Results are ordered by betId descending (newest first)\n- Use `afterBetId` from `nextCursor` in the response to fetch the next page\n- `hasMore` indicates if more results are available\n\n**Bet Status Values:** PENDING, PLACED, CONFIRMED, REJECTED, CANCELLED, FAILED, VOID\n\n**Settlement Status Values:** UNSETTLED, WON, LOST, VOID, HALF_WON, HALF_LOST, PUSH, CASHOUT", "operationId": "get_bets_fixtures", "parameters": [ { "name": "betIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated bet IDs", "example": "1,2,3" }, { "name": "orderIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated order IDs", "example": "100,101,102" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "User reference to filter by", "example": "bettor1234" }, { "name": "afterBetId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Cursor for pagination: fetch bets with betId less than this value", "example": 1000 }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 1000 }, "description": "Maximum number of bets to return per page" } ], "responses": { "200": { "description": "Successfully retrieved bets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetsResponse" }, "example": { "status": "success", "bets": [ { "betId": 67890, "orderId": 12345, "bookmaker": "pinnacle", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "bookmakerBetId": "3332684214", "placedPrice": 1.97, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "userRef": "bettor1234", "account": "pinnacle_main", "sentData": { "stake": 10.0, "price": 1.95 }, "receivedData": { "betId": "3332684214", "status": "accepted", "price": 1.97 }, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } }, { "betId": 67889, "orderId": 12344, "bookmaker": "betfair-ex", "betStatus": "CONFIRMED", "settlementStatus": "WON", "clientName": "demo", "testBet": false, "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "bookmakerBetId": "234567890", "placedPrice": 1.94, "placedStake": 50.0, "placedCurrency": "GBP", "placedAt": "2026-02-07T16:00:00+00:00", "settledAt": "2026-02-07T18:30:00+00:00", "userRef": "bettor1234", "account": "betfair_user", "currencyInfo": { "currency": "GBP", "currencyValue": 0.73, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "count": 2, "hasMore": true, "nextCursor": 67889 } } } }, "400": { "description": "Invalid filter parameters or missing required filter" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "503": { "description": "Database unavailable" } } } }, "/fixtures/bets/{bet_id}": { "get": { "tags": [ "Bets" ], "summary": "Get a single bet", "description": "Retrieve a single bet by its ID. The bet must belong to the authenticated client.", "operationId": "get_bet_by_id_fixtures", "parameters": [ { "name": "bet_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Bet ID" } ], "responses": { "200": { "description": "Successfully retrieved bet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetResponse" }, "example": { "betId": 67890, "orderId": 12345, "bookmaker": "pinnacle", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "bookmakerBetId": "3332684214", "placedPrice": 1.97, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "userRef": "bettor1234", "account": "pinnacle_main", "sentData": { "stake": 10.0, "price": 1.95 }, "receivedData": { "betId": "3332684214", "status": "accepted", "price": 1.97 }, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "404": { "description": "Bet not found or not owned by client" }, "503": { "description": "Database unavailable" } } } }, "/fixtures/markets": { "get": { "tags": [ "Markets" ], "summary": "Get all markets with odds types", "description": "Returns all available markets and their outcome types. Optionally filter by sportId. Markets are sorted by sportId then marketId.", "operationId": "get_markets_fixtures", "parameters": [ { "name": "sportId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter markets by sport ID (e.g., 10 for Soccer)", "example": 10 } ], "responses": { "200": { "description": "List of markets with odds types", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MarketResponse" } }, "example": [ { "marketId": 101, "marketLength": 3, "sportId": 10, "playerProp": false, "handicap": 0, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "oddsTypes": [ { "outcomeId": 101, "outcomeName": "1" }, { "outcomeId": 102, "outcomeName": "X" }, { "outcomeId": 103, "outcomeName": "2" } ] }, { "marketId": 201, "marketLength": 2, "sportId": 10, "playerProp": false, "handicap": -1.5, "marketName": "Asian Handicap -1.5", "marketNameShort": "AH -1.5", "marketType": "asian_handicap", "period": "fulltime", "oddsTypes": [ { "outcomeId": 201, "outcomeName": "1" }, { "outcomeId": 202, "outcomeName": "2" } ] } ] } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "500": { "description": "Internal server error or market cache not loaded" } } } }, "/futures/betslip": { "get": { "tags": [ "Futures" ], "summary": "Get live odds and betslip metadata for a future (not yet available)", "operationId": "get_futures_betslip", "description": "Get current odds and metadata for a **futures** (outright) selection.\n\nProvide `futureId` plus the selection:\n\n- **Participant-keyed** markets (outright winner, topscorer, relegation, mvp) carry the sentinel `futureOutcomeId=0` — the participant IS the selection, so `participantId` must be a real id.\n- **Decomposed** markets (prediction Yes/No, season totals Over/Under) carry a real `futureOutcomeId` (>= 100001) and may leave `participantId=0`.\n\nThere is **no `playerId`** on futures — `participantId` names a team or a player alike — and **no period**: a future resolves when its season does.\n\nFixtures live on **`GET /fixtures/betslip`**.\n\n**Feed-authoritative.** Futures odds come from the OddsPAPI cache only — no bookmaker integration implements a futures betslip fetch, so `verifyBetslip` on an account has no effect here.\n\n**Limit cascade:** account.minStake/maxStake > bookmaker.minStake/maxStake > odds.limitMin/limit — same as fixtures.\n\n**WebSocket integration:** each poll registers (or refreshes) a 60-second subscription on the `betslip` channel for this selection, the snapshot is broadcast immediately, and deltas follow as prices change. Futures payloads carry `futureId`/`futureOutcomeId`/`participantId` instead of `fixtureId`/`outcomeId`/`playerId`.\n\n> **Returns HTTP 501 today.** ABP implements the OddsPAPI **db-v2** futures identifier scheme only, and the feed still publishes the current-state one, so futures ingest is switched off and nothing is cached. This endpoint answers `501` rather than an empty `200` that would read as \"no odds\" — and your request is **validated first**, so a malformed `futureId` (a bare integer from the current feed is refused) or a selection pair that names nothing is still a `400` even today. The response shape below is what it serves the day futures turn on (expected late 2026-10).", "parameters": [ { "name": "futureId", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Future identifier in OddsPAPI's db-v2 form (e.g., 'id1012639310001'). A bare-integer id from the current feed is refused with a 400.", "example": "id1012639310001" }, { "name": "futureOutcomeId", "in": "query", "required": false, "schema": { "type": "integer", "default": 0 }, "description": "0 (default) for a participant-keyed market where the participant IS the selection; a real id (>= 100001) for a decomposed market (Yes/No, Over/Under).", "example": 0 }, { "name": "participantId", "in": "query", "required": false, "schema": { "type": "integer", "default": 0 }, "description": "The team or player you back (participant-keyed), or the entity a line is about (decomposed). Required (non-zero) when futureOutcomeId is 0.", "example": 7193 }, { "name": "bookmakers", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated bookmaker slugs. If omitted, uses all the client's configured bookmakers.", "example": "polymarket,kalshi" } ], "responses": { "200": { "description": "Current odds and betslip metadata for a future — the shape served once futures are enabled; today this endpoint answers 501", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FuturesBetslipResponse" }, "example": { "futureId": "id1012639310001", "futureOutcomeId": 0, "participantId": 7193, "client": "demo", "userRef": null, "futureInfo": { "futureId": "id1012639310001", "sportId": 10, "seasonId": 126393, "tournamentId": 17, "statusId": 0, "startTime": 1760000000, "endTime": null }, "outcomeInfo": null, "odds": { "polymarket": { "id1012639310001:polymarket:0:7193": { "price": 4.2, "limit": 2500, "limitMin": 1, "limitCurrency": "USD", "limitUsd": 2500, "limitMinUsd": 1, "active": true, "account": "0xAe58B89E84a625C8D0b7E630f40Cb163fcA73F01", "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-10-09T09:12:04+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "10001", "bookmakerOutcomeId": "475604749945647560845331314831514336920894613040458588818765764150561104610", "meta": null } } } } } } }, "400": { "description": "Malformed futureId, or a selection pair that names nothing", "content": { "application/json": { "example": { "detail": "futureOutcomeId 0 with participantId 0 names no selection" } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — no accounts for the requested bookmaker(s), or the future's sport is not allowed for this API key", "content": { "application/json": { "example": { "detail": "SportId '10' not allowed" } } } }, "404": { "description": "No odds found for the given futures selection", "content": { "application/json": { "example": { "detail": "No odds found for given parameters" } } } }, "500": { "description": "Internal server error" }, "501": { "description": "Not implemented — futures ingest is off until OddsPAPI db-v2 is live", "content": { "application/json": { "example": { "detail": "Futures betslip is not yet available. ABP implements the OddsPAPI db-v2 futures identifier scheme only, and the feed still publishes the current-state one, so futures ingest is disabled (ODDSPAPI_FUTURES_ENABLED=false) and nothing is cached. This endpoint answers 501 rather than an empty 200 that would read as 'no odds'. Futures identifiers ARE validated here: a malformed request is a 400/422 even today." } } } } } } }, "/futures/markets": { "get": { "tags": [ "Futures" ], "summary": "Get all futures markets (not yet available)", "operationId": "get_futures_markets", "description": "Returns the futures markets present in the OddsPAPI metadata cache, grouped by `(sportId, futureMarketId)`, each with the futures (season × market) that carry it. Sorted by `sportId`, then `futureMarketId`.\n\nThis is the futures counterpart of `GET /fixtures/markets`, but it is **derived from the cached futures themselves** — OddsPAPI publishes no separate futures-market catalogue. Consequences worth knowing:\n\n- It lists what is currently cached, not every market that has ever existed.\n- `marketName` / `marketType` are `null` unless OddsPAPI puts them on the future row. They are read, never inferred.\n- It does **not** list outcomes. A futures selection is `(futureOutcomeId, participantId)`, and the available pairs come from the odds on `GET /futures/betslip`, not from a market definition: on a participant-keyed market the outcome id is always the sentinel `0` and the *participants* are the selections.\n\n> **Returns HTTP 501 today.** ABP implements the OddsPAPI **db-v2** futures identifier scheme only, and the feed still publishes the current-state one, so futures ingest is switched off and nothing is cached. This endpoint answers `501` rather than an empty `200` that would read as \"no odds\" — and your request is **validated first**, so a malformed `futureId` (a bare integer from the current feed is refused) or a selection pair that names nothing is still a `400` even today. The response shape below is what it serves the day futures turn on (expected late 2026-10).", "parameters": [ { "name": "sportId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by sport ID (e.g., 10 for Soccer)", "example": 10 }, { "name": "tournamentId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by tournament ID", "example": 17 } ], "responses": { "200": { "description": "List of futures markets — the shape served once futures are enabled; today this endpoint answers 501", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FutureMarketResponse" } }, "example": [ { "futureMarketId": 10001, "sportId": 10, "marketName": "Winner", "marketType": null, "futureCount": 1, "futures": [ { "futureId": "id1012639310001", "seasonId": 126393, "tournamentId": 17, "startTime": 1760000000, "endTime": null, "statusId": 0, "reissuedFutureId": null } ] } ] } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "500": { "description": "Internal server error" }, "501": { "description": "Not implemented — futures ingest is off until OddsPAPI db-v2 is live", "content": { "application/json": { "example": { "detail": "Futures market listing is not yet available. ABP implements the OddsPAPI db-v2 futures identifier scheme only, and the feed still publishes the current-state one, so futures ingest is disabled (ODDSPAPI_FUTURES_ENABLED=false) and nothing is cached. This endpoint answers 501 rather than an empty 200 that would read as 'no odds'. Futures identifiers ARE validated here: a malformed request is a 400/422 even today." } } } } } } }, "/futures/place-orders": { "post": { "tags": [ "Futures" ], "summary": "Place futures orders (not yet implemented)", "operationId": "place_future_orders", "description": "Place one or more **futures** orders. **Returns HTTP 501** — see below.\n\nThe payload is the fixtures payload with the selection swapped: `futureId` + `futureOutcomeId` + `participantId` instead of `fixtureId` + `outcomeId` + `playerId`. Everything else (`requestUuid`, `orderPrice`, `orderStake`, `userRef`, `testOrder`, `bookmakers`, `orderCurrency`, `back`, `expiresAt`, `acceptBetterOdds`, `acceptPartialStake`, `meta`) is identical, including the `requestUuid` idempotency rule.\n\n**The body is fully validated before the 501.** A malformed `futureId`, a selection pair that names nothing (`futureOutcomeId=0` with `participantId=0`), a duplicate `requestUuid` within the batch, or a fixture key (`fixtureId`/`outcomeId`/`playerId`) sent here all answer **422** — so you can integrate against this endpoint today and only the 501 will change.\n\n**Why 501:** the `orders` table has no futures identity columns (`orders.fixtureId` is `TEXT NOT NULL`, and a futureId is not a fixtureId). Writing a futures selection into a fixture's column is exactly the conflation this surface split removes, so placement waits for the migration.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceFutureOrdersRequest" }, "example": { "orders": [ { "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "futureId": "id1012639310001", "futureOutcomeId": 0, "participantId": 7193, "orderPrice": 4.0, "orderStake": 25.0, "userRef": "bettor1234", "testOrder": false, "bookmakers": "polymarket,kalshi" } ] } } } }, "responses": { "401": { "description": "Unauthorized — missing or invalid API key" }, "422": { "description": "Invalid payload — malformed futureId, a selection pair that names nothing, fixture keys present, or a duplicate requestUuid in the batch", "content": { "application/json": { "example": { "detail": [ { "loc": [ "body", "orders", 0 ], "msg": "Value error, fixtureId, outcomeId belong to fixtures, not futures. Post fixture orders to /fixtures/place-orders.", "type": "value_error" } ] } } } }, "501": { "description": "Not implemented — futures placement awaits futures identity columns on `orders`", "content": { "application/json": { "example": { "detail": "Futures order placement is not yet implemented. The `orders` table has no futures identity columns (`orders.fixtureId` is NOT NULL and a futureId is not a fixtureId), so this endpoint answers 501 rather than storing a futures selection in a fixture's column. Futures identifiers ARE validated here: a malformed payload is a 422 even today." } } } } } } }, "/futures/cancel-orders": { "post": { "tags": [ "Futures" ], "summary": "Cancel futures orders (not yet implemented)", "operationId": "cancel_future_orders", "description": "Returns HTTP 501. Nothing can be cancelled while nothing can be placed — see `POST /futures/place-orders`.", "responses": { "401": { "description": "Unauthorized — missing or invalid API key" }, "501": { "description": "Not implemented" } } } }, "/futures/cancel-all-orders": { "post": { "tags": [ "Futures" ], "summary": "Cancel all futures orders (not yet implemented)", "operationId": "cancel_all_future_orders", "description": "Returns HTTP 501. Nothing can be cancelled while nothing can be placed — see `POST /futures/place-orders`.", "responses": { "401": { "description": "Unauthorized — missing or invalid API key" }, "501": { "description": "Not implemented" } } } }, "/futures/orders": { "get": { "tags": [ "Futures" ], "summary": "List futures orders (not yet implemented)", "operationId": "get_future_orders", "description": "Returns HTTP 501 — there are no futures orders to list, because `POST /futures/place-orders` is itself 501.\n\nFilters are validated first all the same: a malformed `futureId` or a selection pair that names nothing answers **400**. `GET /fixtures/orders` lists fixture orders and never returns a futures order, by construction — the two surfaces do not overlap.", "parameters": [ { "name": "futureId", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by future identifier", "example": "id1012639310001" }, { "name": "futureOutcomeId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by future outcome identifier" }, { "name": "participantId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by participant identifier" } ], "responses": { "400": { "description": "Malformed futureId or selection pair" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "501": { "description": "Not implemented" } } } }, "/futures/bets": { "get": { "tags": [ "Futures" ], "summary": "List futures bets (not yet implemented)", "operationId": "get_future_bets", "description": "Returns HTTP 501 — no futures bet can exist while placement is 501.\n\nFilters are validated first: a malformed `futureId` or a selection pair that names nothing answers **400**.", "parameters": [ { "name": "futureId", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by future identifier", "example": "id1012639310001" }, { "name": "futureOutcomeId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by future outcome identifier" }, { "name": "participantId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter by participant identifier" } ], "responses": { "400": { "description": "Malformed futureId or selection pair" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "501": { "description": "Not implemented" } } } }, "/futures/bets/{bet_id}": { "get": { "tags": [ "Futures" ], "summary": "Get a futures bet by id (not yet implemented)", "operationId": "get_future_bet", "description": "Returns HTTP 501 — no futures bet can exist while placement is 501.", "parameters": [ { "name": "bet_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Bet ID" } ], "responses": { "401": { "description": "Unauthorized — missing or invalid API key" }, "501": { "description": "Not implemented" } } } }, "/accounts": { "get": { "tags": [ "Accounts" ], "summary": "List accounts for client", "description": "Get all bookmaker accounts for the authenticated client. Optionally filter by bookmaker. Accounts are ordered by priority (highest first). Passwords are always masked.", "operationId": "get_accounts", "parameters": [ { "name": "bookmaker", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by bookmaker slug" } ], "responses": { "200": { "description": "List of accounts for the authenticated client", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AccountResponse" } }, "example": [ { "bookmaker": "pinnacle", "username": "pinnacle_main", "client": "demo", "password": "***", "balance": 5000.0, "active": true, "priority": 10, "maxStake": 1000.0, "minStake": 5.0, "currencyId": "USD", "verifyBetslip": false, "meta": {}, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-02-01T12:00:00Z", "multiLimitAllowed": true, "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" } }, { "bookmaker": "betfair-ex", "username": "betfair_user", "client": "demo", "password": "***", "balance": 2500.0, "active": true, "priority": 5, "maxStake": null, "minStake": 2.0, "currencyId": "GBP", "verifyBetslip": true, "meta": { "appKey": "***" }, "createdAt": "2026-01-05T00:00:00Z", "updatedAt": "2026-02-05T12:00:00Z", "multiLimitAllowed": false, "currencyInfo": { "currency": "GBP", "currencyValue": 0.73, "updatedAt": "2026-02-07T17:29:32+00:00" } } ] } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "500": { "description": "Internal server error" } } }, "post": { "tags": [ "Accounts" ], "summary": "Create account", "description": "Create a new bookmaker account for the authenticated client. Each client can have multiple accounts per bookmaker. Use `priority` to control which account is selected first.", "operationId": "create_account", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountCreateRequest" }, "example": { "bookmaker": "pinnacle", "username": "my_account", "password": "secret123", "balance": 1000.0, "active": true, "priority": 10, "maxStake": 500.0, "minStake": 1.0, "currencyId": "USD", "meta": { "affiliate": "xyz" } } } } }, "responses": { "201": { "description": "Account created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountResponse" }, "example": { "bookmaker": "pinnacle", "username": "my_account", "client": "demo", "password": "***", "balance": 1000.0, "active": true, "priority": 10, "maxStake": 500.0, "minStake": 1.0, "currencyId": "USD", "verifyBetslip": false, "meta": { "affiliate": "xyz" }, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-15T12:00:00Z", "multiLimitAllowed": true, "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" } } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "409": { "description": "Account already exists (bookmaker + username must be unique)" }, "500": { "description": "Internal server error" } } } }, "/accounts/{bookmaker}/{username}": { "get": { "tags": [ "Accounts" ], "summary": "Get account by key", "description": "Get a specific account by its primary key (bookmaker, username). Only returns the account if it belongs to the authenticated client.", "operationId": "get_account", "parameters": [ { "name": "bookmaker", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Bookmaker slug (e.g., 'pinnacle')" }, { "name": "username", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Account username" } ], "responses": { "200": { "description": "Account details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountResponse" }, "example": { "bookmaker": "pinnacle", "username": "my_account", "client": "demo", "password": "***", "balance": 1000.0, "active": true, "priority": 10, "maxStake": 500.0, "minStake": 1.0, "currencyId": "USD", "verifyBetslip": false, "meta": { "affiliate": "xyz" }, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-15T12:00:00Z", "multiLimitAllowed": true, "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" } } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — account belongs to different client" }, "404": { "description": "Account not found" }, "500": { "description": "Internal server error" } } }, "patch": { "tags": [ "Accounts" ], "summary": "Update account", "description": "Update an existing bookmaker account. Only provided fields are updated. Only the account owner (client) can update their accounts.", "operationId": "update_account", "parameters": [ { "name": "bookmaker", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Bookmaker slug" }, { "name": "username", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Account username" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountUpdateRequest" }, "example": { "balance": 2000.0, "active": true, "priority": 15, "maxStake": 750.0 } } } }, "responses": { "200": { "description": "Account updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — account belongs to different client" }, "404": { "description": "Account not found" }, "500": { "description": "Internal server error" } } }, "delete": { "tags": [ "Accounts" ], "summary": "Delete account", "description": "Delete a bookmaker account. Only the account owner (client) can delete their accounts.", "operationId": "delete_account", "parameters": [ { "name": "bookmaker", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Bookmaker slug" }, { "name": "username", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Account username" } ], "responses": { "204": { "description": "Account deleted successfully" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — account belongs to different client" }, "404": { "description": "Account not found" }, "500": { "description": "Internal server error" } } } }, "/bookmakers": { "get": { "tags": [ "Bookmakers" ], "summary": "List all bookmakers", "description": "Returns all supported bookmakers with their stake limits. Results are cached for 60 seconds.", "operationId": "get_bookmakers", "responses": { "200": { "description": "List of supported bookmakers", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BookmakerResponse" } }, "example": [ { "bookmakerId": 1, "bookmaker": "pinnacle", "bookmakerName": "Pinnacle", "active": true, "maxStake": 10000.0, "minStake": 1.0 }, { "bookmakerId": 2, "bookmaker": "betfair-ex", "bookmakerName": "Betfair Exchange", "active": true, "maxStake": null, "minStake": 2.0 }, { "bookmakerId": 3, "bookmaker": "polymarket", "bookmakerName": "Polymarket", "active": true, "maxStake": null, "minStake": 1.0 } ] } } }, "404": { "description": "No bookmakers found" }, "500": { "description": "Internal server error" } } } }, "/positions": { "get": { "tags": [ "Analytics" ], "summary": "Get open positions", "description": "Retrieve aggregated open (unsettled) positions grouped by bookmaker, account, or userRef.\n\nReturns the number of open bets, total stake, and average price for each group.\nOnly includes bets with `betStatus` in (PLACED, CONFIRMED) and `settlementStatus` = UNSETTLED.\n\n**Group by options:**\n- `bookmaker` (default) — Group by bookmaker\n- `account` — Group by bookmaker account\n- `userRef` — Group by user reference\n\n**Filters:**\n- `bookmaker` — Filter to a specific bookmaker\n- `userRef` — Filter to a specific user reference\n- `account` — Filter to a specific account", "operationId": "get_positions", "parameters": [ { "name": "groupBy", "in": "query", "required": false, "schema": { "type": "string", "default": "bookmaker", "enum": [ "bookmaker", "account", "userRef" ] }, "description": "Group positions by: bookmaker, account, or userRef" }, { "name": "bookmaker", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by bookmaker slug" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by user reference" }, { "name": "account", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by account username" } ], "responses": { "200": { "description": "Successfully retrieved positions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PositionsResponse" }, "example": { "status": "success", "groupBy": "bookmaker", "positions": [ { "bookmaker": "pinnacle", "openBets": 5, "totalStake": 250.0, "avgPrice": 1.92, "fixtureIds": 3 }, { "bookmaker": "sharpbet", "openBets": 2, "totalStake": 80.0, "avgPrice": 2.15, "fixtureIds": 2 } ], "count": 2, "totalStake": 330.0, "totalOpenBets": 7 } } } }, "400": { "description": "Invalid parameters" }, "401": { "description": "Unauthorized" }, "503": { "description": "Database unavailable" } } } }, "/pnl": { "get": { "tags": [ "Analytics" ], "summary": "Get profit and loss", "description": "Retrieve aggregated PnL (profit and loss) grouped by bookmaker, account, or userRef.\n\nOnly includes settled bets (`settlementStatus` NOT in UNSETTLED).\n\n**Group by options:**\n- `bookmaker` (default) — Group by bookmaker\n- `account` — Group by bookmaker account\n- `userRef` — Group by user reference\n\n**Filters:**\n- `bookmaker` — Filter to a specific bookmaker\n- `userRef` — Filter to a specific user reference\n- `account` — Filter to a specific account", "operationId": "get_pnl", "parameters": [ { "name": "groupBy", "in": "query", "required": false, "schema": { "type": "string", "default": "bookmaker", "enum": [ "bookmaker", "account", "userRef" ] }, "description": "Group PnL by: bookmaker, account, or userRef" }, { "name": "bookmaker", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by bookmaker slug" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by user reference" }, { "name": "account", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Filter by account username" } ], "responses": { "200": { "description": "Successfully retrieved PnL", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PnlResponse" }, "example": { "status": "success", "groupBy": "bookmaker", "pnl": [ { "bookmaker": "pinnacle", "settledBets": 42, "wins": 23, "losses": 17, "voids": 1, "pushes": 1, "totalStaked": 2100.0, "totalWon": 2350.0, "totalLost": 850.0, "netPnl": 250.0, "winRate": 54.8 }, { "bookmaker": "sharpbet", "settledBets": 15, "wins": 9, "losses": 5, "voids": 1, "pushes": 0, "totalStaked": 750.0, "totalWon": 900.0, "totalLost": 250.0, "netPnl": 150.0, "winRate": 60.0 } ], "count": 2, "totalNetPnl": 400.0, "totalStaked": 2850.0, "totalSettledBets": 57 } } } }, "400": { "description": "Invalid parameters" }, "401": { "description": "Unauthorized" }, "503": { "description": "Database unavailable" } } } }, "/betslip": { "get": { "tags": [ "Betslip" ], "summary": "Get live odds and betslip metadata for a fixture (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/betslip` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/betslip`; futures have their own surface under `/futures/*`.\n\nGet current odds and metadata for a **fixture** selection: `fixtureId` + `outcomeId` + `playerId` (use `playerId=0` for non-player markets).\n\nFutures live on their own surface — **`GET /futures/betslip`**. `futureId`, `futureOutcomeId` and `participantId` are not accepted here.\n\n**Response includes:**\n- `fixtureInfo` — Fixture details (teams, sport, tournament, start time, scores)\n- `outcomeInfo` — Market and outcome details (market name, type, handicap)\n- `playerInfo` — Player details (for player prop markets, null otherwise)\n- `odds` — Live odds keyed by bookmaker, each entry keyed `{fixtureId}:{bookmaker}:{outcomeId}:{playerId}` and containing:\n - `price` — Current decimal odds\n - `limit` / `limitMin` — Max/min stake in account currency\n - `limitUsd` / `limitMinUsd` — Limits converted to USD\n - `limitCurrency` — Account currency for limits\n - `active` — Whether odds are currently available\n - `account` — Account username for this bookmaker\n - `currencyInfo` — Currency exchange rate details\n - `bookmakerFixtureId/MarketId/OutcomeId` — Bookmaker's internal IDs\n - `meta` — Exchange orderbook data (for Betfair, Polymarket, etc.)\n\n**Limit cascade:** account.minStake/maxStake > bookmaker.minStake/maxStake > odds.limitMin/limit", "operationId": "get_betslip_legacy", "parameters": [ { "name": "fixtureId", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Fixture identifier (e.g., 'id1000004461512432').", "example": "id1000004461512432" }, { "name": "outcomeId", "in": "query", "required": true, "schema": { "type": "integer" }, "description": "Outcome identifier (e.g., 103 for Match Winner Away)", "example": 103 }, { "name": "playerId", "in": "query", "required": true, "schema": { "type": "integer" }, "description": "Player ID. Use 0 for non-player prop markets.", "example": 0 }, { "name": "bookmakers", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated bookmaker slugs (e.g., 'pinnacle,betfair-ex'). If omitted, uses all client's configured bookmakers.", "example": "pinnacle,sharpbet" } ], "responses": { "200": { "description": "Current odds and betslip metadata for a fixture", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetslipResponse" }, "example": { "fixtureId": "id1000002361061419", "outcomeId": 101, "playerId": 0, "client": "demo", "userRef": null, "fixtureInfo": { "fixtureId": "id1000002361061419", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 23, "tournamentName": "Serie A", "categoryName": "Italy" }, "season": { "seasonId": 130971, "seasonName": "Serie A 25/26" }, "startTime": 1770666300, "participants": { "participant1Id": 2702, "participant1Name": "AS Roma", "participant2Id": 2719, "participant2Name": "Cagliari Calcio" }, "externalProviders": { "betgeniusId": 12418676, "betradarId": 61061419, "flashscoreId": "QRHiwdZQ", "mollybetId": "2026-02-09,240,227", "pinnacleId": 1623026170, "sofascoreId": 13981664 } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 101, "outcomeName": "1" }, "playerInfo": null, "odds": { "polymarket": { "id1000002361061419:polymarket:101:0": { "price": 1.55, "limit": 0, "limitMin": 1, "limitCurrency": "USD", "limitUsd": 0, "limitMinUsd": 1, "active": true, "account": "0xAe58B89E84a625C8D0b7E630f40Cb163fcA73F01", "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "47560474994564756084533131483151433692089461304045858881876576415056110461089", "meta": { "lay": 2.817, "bookmakerLayOutcomeId": "68720233493513315549726110228454980604765404427736533364284705967981292940643" } } }, "pinnacle": { "id1000002361061419:pinnacle:101:0": { "price": 1.5, "limit": 15000, "limitMin": 5, "limitCurrency": "USD", "limitUsd": 15000, "limitMinUsd": 5, "active": true, "account": "PWFSE02PP1", "currencyInfo": { "currency": "USD", "currencyValue": 1, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "home", "meta": null } }, "sharpbet": { "id1000002361061419:sharpbet:101:0": { "price": 1.52, "limit": 751.343, "limitMin": 1, "limitCurrency": "EUR", "limitUsd": 886.13, "limitMinUsd": 1.18, "active": true, "account": "devsb01", "currencyInfo": { "currency": "EUR", "currencyValue": 0.84788876, "updatedAt": "2026-02-07T17:29:32+00:00" }, "bookmakerFixtureId": null, "bookmakerMarketId": "101", "bookmakerOutcomeId": "7", "meta": null } } } } } } }, "400": { "description": "Invalid request parameters", "content": { "application/json": { "example": { "detail": "fixtureId, outcomeId, and playerId are required. Futures selections go to /futures/betslip." } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — no accounts for requested bookmaker(s) or sport not allowed", "content": { "application/json": { "example": { "detail": "No accounts configured for bookmaker(s): pinnacle" } } } }, "404": { "description": "No odds found for the given fixture/outcome/player combination", "content": { "application/json": { "example": { "detail": "No odds found for given parameters" } } } }, "500": { "description": "Internal server error" } }, "deprecated": true } }, "/orders": { "get": { "tags": [ "Orders" ], "summary": "Get orders (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/orders` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/orders`; futures have their own surface under `/futures/*`.\n\nRetrieve orders with keyset pagination. At least one filter must be provided.\n\n**Filters (OR logic):**\n- `orderIds` — Comma-separated list of order IDs\n- `requestUuids` — Comma-separated list of request UUIDs\n- `userRef` — User reference string\n\n**Pagination:**\n- Results are ordered by orderId descending (newest first)\n- Use `afterOrderId` from `nextCursor` in the response to fetch the next page\n- `hasMore` indicates if more results are available\n\nReturns enriched order details including bets and fixture/outcome/player metadata.\n\n**Order Status Values:** PENDING, PROCESSING, FILLED, PARTIALLY_FILLED, CANCELLED, REJECTED, EXPIRED, FAILED", "operationId": "get_orders_legacy", "parameters": [ { "name": "orderIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated order IDs (e.g., '123,456,789')", "example": "123,456" }, { "name": "requestUuids", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated request UUIDs", "example": "eb45b192-317b-42d5-9f65-af497b9fa8c1" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "User reference to filter by", "example": "bettor1234" }, { "name": "afterOrderId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Cursor for pagination: fetch orders with orderId less than this value", "example": 1000 }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 1000 }, "description": "Maximum number of orders to return per page" } ], "responses": { "200": { "description": "Successfully retrieved matching orders with enriched metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetOrdersResponse" }, "example": { "orders": [ { "orderId": 371, "requestUuid": "9eb7d99a-ab9b-41f3-9a06-23e70006bbe5", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 50.0, "filledStake": 0.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T16:15:53.270816+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "PENDING", "createdAt": "2026-02-07T16:15:48.270816+00:00", "updatedAt": "2026-02-07T16:15:48.270816+00:00", "meta": null, "bets": [], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } }, { "orderId": 372, "requestUuid": "be81ba8f-55f4-48ed-a6f9-69b8d920263b", "allowedBookmakers": "sharpbet", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 2.65, "orderStake": 10.0, "filledStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T16:18:34.366795+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "FILLED", "createdAt": "2026-02-07T16:18:29.366795+00:00", "updatedAt": "2026-02-07T16:18:29.366795+00:00", "meta": null, "bets": [ { "betId": 91, "orderId": 372, "bookmaker": "sharpbet", "bookmakerBetId": "63aeba8d-a2d6-49ba-a6cd-7ce70bb17701", "placedPrice": 2.65, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T16:18:29.300906+00:00", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "userRef": "bettor1234", "requestUuid": "be81ba8f-55f4-48ed-a6f9-69b8d920263b", "declineReason": null } ], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "count": 2, "hasMore": false, "nextCursor": null } } } }, "400": { "description": "Missing required query parameter (at least one of orderIds, requestUuids, or userRef required)" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "404": { "description": "No orders found matching the filters" }, "500": { "description": "Internal server error" } }, "deprecated": true } }, "/place-orders": { "post": { "tags": [ "Orders" ], "summary": "Place betting orders (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/place-orders` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/place-orders`; futures have their own surface under `/futures/*`.\n\nSubmit one or more betting orders for placement with bookmakers.\n\n**Required fields per order:** `requestUuid`, `outcomeId`, `playerId`, `orderPrice`, `orderStake`, `userRef`, `testOrder`, `fixtureId`\n\n**Optional fields:** `bookmakers`, `participantId` (futures only), `orderCurrency`, `back`, `expiresAt`, `acceptBetterOdds`, `acceptPartialStake`, `meta`\n\n**Key behavior:**\n- `requestUuid` must be a valid UUID format (used for idempotency — a duplicate within 30 minutes is skipped; if ALL orders in the request are duplicates the request returns 409)\n- `fixtureId` and `futureId` are mutually exclusive — provide one or the other\n- Orders with `futureId` currently return `501 Not Implemented` (coming soon)\n- Server automatically selects the best bookmaker by odds/limits unless `bookmakers` is specified\n- `clientName` is set automatically from your API key\n- Orders expire after `expiresAt` (default: 5 seconds from now, capped at 24 hours maximum)\n- Maximum 100 orders per request\n\n**Response:**\n- `status`: \"accepted\" (all accepted), \"partial-success\" (some declined), or \"declined\" (all declined)\n- `acceptedOrders`: Orders that passed validation with their current status and any placed bets\n- `declinedOrders`: Orders that failed validation with `declineReason`\n\n**Fixtures only.** `futureId`, `futureOutcomeId` and `participantId` are rejected with `422` — post futures orders to `POST /futures/place-orders`.", "operationId": "place_orders_legacy", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrdersRequest" }, "example": { "orders": [ { "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "userRef": "bettor1234", "testOrder": false }, { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "fixtureId": "id1000000758265385", "outcomeId": 101, "playerId": 0, "orderPrice": 1.88, "orderStake": 250.25, "userRef": "bettor1234", "testOrder": false, "bookmakers": "pinnacle,vertex", "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T22:26:05Z", "acceptBetterOdds": true, "acceptPartialStake": true, "meta": { "strategy": "value", "source": "api" } } ] } } } }, "responses": { "200": { "description": "Order placement results with accepted and declined orders", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrdersResponse" }, "example": { "status": "partial-success", "acceptedOrders": [ { "orderId": 327, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "filledStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T17:29:37.311377+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "FILLED", "createdAt": "2026-02-07T17:29:32.265368+00:00", "updatedAt": "2026-02-07T17:29:32.265368+00:00", "meta": null, "bets": [ { "betId": 73, "orderId": 327, "bookmaker": "pinnacle", "bookmakerBetId": "3332684214", "placedPrice": 1.98, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "userRef": "bettor1234", "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "declineReason": null } ], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" }, "startTime": 1754159400, "participants": { "participant1Id": 2540, "participant1Name": "Arminia Bielefeld", "participant2Id": 2588, "participant2Name": "Fortuna Dusseldorf" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "playerProp": false, "handicap": 0, "outcomeId": 103, "outcomeName": "2" }, "playerInfo": null, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "declinedOrders": [ { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "allowedBookmakers": "vertex", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "clientName": "demo", "declineReason": "Odds temporarily unavailable; please retry", "bets": [] } ] } } } }, "400": { "description": "Validation error or all orders declined", "content": { "application/json": { "example": { "status": "declined", "acceptedOrders": [], "declinedOrders": [ { "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "fixtureId": "id1000004461512432", "outcomeId": 103, "declineReason": "Order stake 100.00 USD exceeds available limit 50.00 USD", "bets": [] } ] } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "409": { "description": "Returned only when EVERY order in the request is a duplicate (each requestUuid already processed or in progress within the last 30 minutes). If only some orders are duplicates, the duplicates are skipped and the rest are processed normally.", "content": { "application/json": { "example": { "detail": { "error": "All orders are duplicates", "duplicateUuids": [ "eb45b192-317b-42d5-9f65-af497b9fa8c1" ], "inProgressUuids": [] } } } } }, "422": { "description": "Request body validation error (invalid field values)" }, "500": { "description": "Internal server error" } }, "deprecated": true } }, "/cancel-orders": { "post": { "tags": [ "Orders" ], "summary": "Cancel specific orders (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/cancel-orders` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/cancel-orders`; futures have their own surface under `/futures/*`.\n\nCancel one or more orders by filter. At least one filter must be provided. Multiple filters are combined with OR logic.\n\n**Filters:**\n- `orderIds` — List of numeric order IDs\n- `requestUuids` — List of request UUID strings\n- `userRef` — Cancel all orders matching this user reference\n\n**Behavior:**\n- Only orders in PENDING or PARTIALLY_FILLED status can be cancelled\n- Orders with confirmed bets cannot be fully cancelled\n- Cancelled orders are marked in the database and signaled to stop retry loops", "operationId": "cancel_orders_legacy", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersRequest" }, "example": { "requestUuids": [ "ee9f4007-e5ab-4085-bffb-8d938e4cad5f", "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d" ] } } } }, "responses": { "200": { "description": "Cancellation result with enriched order details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersResponse" }, "example": { "status": "cancelled", "cancelledCount": 1, "cancelled": [ { "orderId": 327, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "allowedBookmakers": "*", "fixtureId": "id1000004461512432", "outcomeId": 103, "playerId": 0, "orderPrice": 1.95, "orderStake": 10.0, "filledStake": 0.0, "userRef": "bettor1234", "testOrder": false, "orderCurrency": "USD", "back": true, "expiresAt": "2026-02-07T12:20:06.302841+00:00", "acceptBetterOdds": true, "acceptPartialStake": true, "clientName": "demo", "orderStatus": "CANCELLED", "createdAt": "2026-02-07T12:20:01.302841+00:00", "updatedAt": "2026-02-07T12:20:01.302841+00:00", "meta": null, "bets": [], "fixtureInfo": { "fixtureId": "id1000004461512432", "status": { "live": false, "statusId": 0, "statusName": "Pre-Game" }, "sport": { "sportId": 10, "sportName": "Soccer" }, "tournament": { "tournamentId": 44, "tournamentName": "2. Bundesliga", "categoryName": "Germany" } }, "outcomeInfo": { "marketId": 101, "marketName": "Full Time Result", "outcomeId": 103, "outcomeName": "2" } } ], "notCancelled": { "reason": "Order not cancellable", "orders": [] } } } } }, "400": { "description": "Missing required filter parameter (at least one of orderIds, requestUuids, or userRef required)" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "404": { "description": "No matching orders found" }, "500": { "description": "Internal server error" } }, "deprecated": true } }, "/cancel-all-orders": { "post": { "tags": [ "Orders" ], "summary": "Cancel all pending orders (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/cancel-all-orders` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/cancel-all-orders`; futures have their own surface under `/futures/*`.\n\nCancel ALL pending and partially-placed orders for the authenticated client.\n\n**Behavior:**\n- Cancels orders in PENDING or PARTIALLY_FILLED status\n- Only cancels orders without already-placed bets\n- Orders with confirmed bets are returned in `notCancelled`\n- No request body required", "operationId": "cancel_all_orders_legacy", "responses": { "200": { "description": "Cancellation result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersResponse" } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "403": { "description": "Access denied — client not resolved from API key" }, "500": { "description": "Internal server error" } }, "deprecated": true } }, "/bets": { "get": { "tags": [ "Bets" ], "summary": "Get bets (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/bets` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/bets`; futures have their own surface under `/futures/*`.\n\nRetrieve bets by various filters with keyset pagination. At least one filter must be provided.\n\n**Filters (OR logic):**\n- `betIds` — Comma-separated list of bet IDs\n- `orderIds` — Comma-separated list of order IDs\n- `userRef` — User reference string\n\n**Pagination:**\n- Results are ordered by betId descending (newest first)\n- Use `afterBetId` from `nextCursor` in the response to fetch the next page\n- `hasMore` indicates if more results are available\n\n**Bet Status Values:** PENDING, PLACED, CONFIRMED, REJECTED, CANCELLED, FAILED, VOID\n\n**Settlement Status Values:** UNSETTLED, WON, LOST, VOID, HALF_WON, HALF_LOST, PUSH, CASHOUT", "operationId": "get_bets_legacy", "parameters": [ { "name": "betIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated bet IDs", "example": "1,2,3" }, { "name": "orderIds", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "Comma-separated order IDs", "example": "100,101,102" }, { "name": "userRef", "in": "query", "required": false, "schema": { "type": "string", "nullable": true }, "description": "User reference to filter by", "example": "bettor1234" }, { "name": "afterBetId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Cursor for pagination: fetch bets with betId less than this value", "example": 1000 }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 1000 }, "description": "Maximum number of bets to return per page" } ], "responses": { "200": { "description": "Successfully retrieved bets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetsResponse" }, "example": { "status": "success", "bets": [ { "betId": 67890, "orderId": 12345, "bookmaker": "pinnacle", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "bookmakerBetId": "3332684214", "placedPrice": 1.97, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "userRef": "bettor1234", "account": "pinnacle_main", "sentData": { "stake": 10.0, "price": 1.95 }, "receivedData": { "betId": "3332684214", "status": "accepted", "price": 1.97 }, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } }, { "betId": 67889, "orderId": 12344, "bookmaker": "betfair-ex", "betStatus": "CONFIRMED", "settlementStatus": "WON", "clientName": "demo", "testBet": false, "requestUuid": "fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d", "bookmakerBetId": "234567890", "placedPrice": 1.94, "placedStake": 50.0, "placedCurrency": "GBP", "placedAt": "2026-02-07T16:00:00+00:00", "settledAt": "2026-02-07T18:30:00+00:00", "userRef": "bettor1234", "account": "betfair_user", "currencyInfo": { "currency": "GBP", "currencyValue": 0.73, "updatedAt": "2026-02-07T17:29:32+00:00" } } ], "count": 2, "hasMore": true, "nextCursor": 67889 } } } }, "400": { "description": "Invalid filter parameters or missing required filter" }, "401": { "description": "Unauthorized — missing or invalid API key" }, "503": { "description": "Database unavailable" } }, "deprecated": true } }, "/bets/{bet_id}": { "get": { "tags": [ "Bets" ], "summary": "Get a single bet (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/bets/{bet_id}` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/bets/{bet_id}`; futures have their own surface under `/futures/*`.\n\nRetrieve a single bet by its ID. The bet must belong to the authenticated client.", "operationId": "get_bet_by_id_legacy", "parameters": [ { "name": "bet_id", "in": "path", "required": true, "schema": { "type": "integer" }, "description": "Bet ID" } ], "responses": { "200": { "description": "Successfully retrieved bet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BetResponse" }, "example": { "betId": 67890, "orderId": 12345, "bookmaker": "pinnacle", "betStatus": "CONFIRMED", "settlementStatus": "UNSETTLED", "clientName": "demo", "testBet": false, "requestUuid": "eb45b192-317b-42d5-9f65-af497b9fa8c1", "bookmakerBetId": "3332684214", "placedPrice": 1.97, "placedStake": 10.0, "placedCurrency": "USD", "placedAt": "2026-02-07T17:29:32+00:00", "userRef": "bettor1234", "account": "pinnacle_main", "sentData": { "stake": 10.0, "price": 1.95 }, "receivedData": { "betId": "3332684214", "status": "accepted", "price": 1.97 }, "currencyInfo": { "currency": "USD", "currencyValue": 1.0, "updatedAt": "2026-02-07T17:29:32+00:00" } } } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "404": { "description": "Bet not found or not owned by client" }, "503": { "description": "Database unavailable" } }, "deprecated": true } }, "/markets": { "get": { "tags": [ "Markets" ], "summary": "Get all markets with odds types (deprecated path)", "description": "> **Deprecated path.** This is the pre-split alias of `/fixtures/markets` and keeps working unchanged — same handler, same request, same response. New integrations should use `/fixtures/markets`; futures have their own surface under `/futures/*`.\n\nReturns all available markets and their outcome types. Optionally filter by sportId. Markets are sorted by sportId then marketId.", "operationId": "get_markets_legacy", "parameters": [ { "name": "sportId", "in": "query", "required": false, "schema": { "type": "integer", "nullable": true }, "description": "Filter markets by sport ID (e.g., 10 for Soccer)", "example": 10 } ], "responses": { "200": { "description": "List of markets with odds types", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MarketResponse" } }, "example": [ { "marketId": 101, "marketLength": 3, "sportId": 10, "playerProp": false, "handicap": 0, "marketName": "Full Time Result", "marketNameShort": "1X2", "marketType": "1x2", "period": "fulltime", "oddsTypes": [ { "outcomeId": 101, "outcomeName": "1" }, { "outcomeId": 102, "outcomeName": "X" }, { "outcomeId": 103, "outcomeName": "2" } ] }, { "marketId": 201, "marketLength": 2, "sportId": 10, "playerProp": false, "handicap": -1.5, "marketName": "Asian Handicap -1.5", "marketNameShort": "AH -1.5", "marketType": "asian_handicap", "period": "fulltime", "oddsTypes": [ { "outcomeId": 201, "outcomeName": "1" }, { "outcomeId": 202, "outcomeName": "2" } ] } ] } } }, "401": { "description": "Unauthorized — missing or invalid API key" }, "500": { "description": "Internal server error or market cache not loaded" } }, "deprecated": true } } }, "components": { "securitySchemes": { "apiKey": { "type": "apiKey", "in": "header", "name": "x-api-key", "description": "API key for authentication. Contact contact@55-tech.com to obtain a key." } }, "schemas": { "AccountCreateRequest": { "type": "object", "required": [ "bookmaker", "username" ], "properties": { "bookmaker": { "type": "string", "description": "Bookmaker slug (e.g., 'pinnacle')" }, "username": { "type": "string", "description": "Account username" }, "password": { "type": "string", "nullable": true, "description": "Account password" }, "balance": { "type": "number", "default": 0.0, "description": "Initial balance" }, "active": { "type": "boolean", "default": true, "description": "Whether account is active" }, "priority": { "type": "integer", "default": 0, "description": "Priority for account selection (higher = preferred)" }, "maxStake": { "type": "number", "nullable": true, "description": "Maximum stake override" }, "minStake": { "type": "number", "nullable": true, "description": "Minimum stake override" }, "currencyId": { "type": "string", "default": "USD", "description": "Account's trading currency (e.g., 'USD', 'EUR')" }, "meta": { "type": "object", "default": {}, "description": "Additional metadata" } } }, "AccountUpdateRequest": { "type": "object", "properties": { "password": { "type": "string", "nullable": true, "description": "New account password" }, "balance": { "type": "number", "nullable": true, "description": "Updated balance" }, "active": { "type": "boolean", "nullable": true, "description": "Enable or disable the account" }, "priority": { "type": "integer", "nullable": true, "description": "Priority for account selection (higher = preferred)" }, "maxStake": { "type": "number", "nullable": true, "description": "Maximum stake override" }, "minStake": { "type": "number", "nullable": true, "description": "Minimum stake override" }, "currencyId": { "type": "string", "nullable": true, "description": "Account's trading currency (e.g., 'USD', 'EUR')" }, "meta": { "type": "object", "nullable": true, "description": "Additional metadata (replaces existing meta)" } } }, "AccountResponse": { "type": "object", "properties": { "bookmaker": { "type": "string", "description": "Bookmaker slug" }, "username": { "type": "string", "description": "Account username" }, "client": { "type": "string", "description": "Client name that owns this account" }, "password": { "type": "string", "nullable": true, "description": "Always masked as '***'" }, "balance": { "type": "number", "description": "Current balance" }, "active": { "type": "boolean", "description": "Whether account is active" }, "priority": { "type": "integer", "description": "Priority for account selection (higher = preferred)" }, "maxStake": { "type": "number", "nullable": true, "description": "Maximum stake override" }, "minStake": { "type": "number", "nullable": true, "description": "Minimum stake override" }, "currencyId": { "type": "string", "description": "Account's trading currency" }, "verifyBetslip": { "type": "boolean", "description": "Force live odds fetch from bookmaker API" }, "meta": { "type": "object", "description": "Additional metadata" }, "createdAt": { "type": "string", "nullable": true, "description": "Creation timestamp (ISO 8601)" }, "updatedAt": { "type": "string", "nullable": true, "description": "Last update timestamp (ISO 8601)" }, "multiLimitAllowed": { "type": "boolean", "description": "Whether the account permits splitting a stake across multiple bets" }, "currencyInfo": { "type": "object", "nullable": true, "description": "Exchange rate snapshot for currencyId: { currency, currencyValue, updatedAt }. Null when no rate is available.", "properties": { "currency": { "type": "string" }, "currencyValue": { "type": "number" }, "updatedAt": { "type": "string" } } } } }, "PlaceOrderRequest": { "type": "object", "required": [ "requestUuid", "fixtureId", "outcomeId", "playerId", "orderPrice", "orderStake", "userRef", "testOrder" ], "description": "A **fixture** order. `fixtureId`, `outcomeId` and `playerId` are all required (`playerId=0` for non-player markets). The futures keys `futureId`, `futureOutcomeId` and `participantId` are rejected with `422`; futures orders go to `POST /futures/place-orders`.", "properties": { "requestUuid": { "type": "string", "description": "Unique idempotency key (UUID format). Normalised to the canonical lower-case hyphenated form, so the value echoed back may differ in spelling from the one you sent (`{braces}`, upper-case and un-hyphenated forms all land on the same key). A duplicate within 30 minutes is skipped; the request returns 409 only if every order is a duplicate.", "example": "eb45b192-317b-42d5-9f65-af497b9fa8c1" }, "fixtureId": { "type": "string", "nullable": false, "description": "OddsPAPI fixture identifier (e.g., 'id1000004461512432').", "example": "id1000004461512432" }, "outcomeId": { "type": "integer", "description": "Outcome/market ID from OddsPAPI (e.g., 103 for Match Winner Away)", "example": 103 }, "playerId": { "type": "integer", "description": "Player ID for player prop markets. Use 0 for non-player markets.", "example": 0 }, "orderPrice": { "type": "number", "exclusiveMinimum": 0, "description": "Minimum acceptable decimal odds. Bets will only be placed at this price or better.", "example": 1.95 }, "orderStake": { "type": "number", "exclusiveMinimum": 0, "description": "Stake amount in orderCurrency. Must be within bookmaker min/max limits.", "example": 10.0 }, "userRef": { "type": "string", "minLength": 1, "description": "Your reference string for grouping/filtering orders (e.g., user ID, session ID)", "example": "bettor1234" }, "testOrder": { "type": "boolean", "description": "If true, order is validated and persisted but NOT placed with bookmaker. Use for testing.", "example": false }, "bookmakers": { "type": "string", "nullable": true, "description": "Comma-separated bookmaker slugs to target (e.g., 'pinnacle,bet365'). Use '*' or omit for automatic selection.", "example": "pinnacle,vertex" }, "orderCurrency": { "type": "string", "default": "USD", "description": "ISO 4217 currency code for orderStake. Converted to bookmaker currency at placement.", "example": "USD" }, "back": { "type": "boolean", "default": true, "description": "Bet direction. true = back (win if selection wins), false = lay (win if selection loses).", "example": true }, "expiresAt": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp when order expires. Defaults to 5 seconds from now. Capped at 24 hours maximum.", "example": "2026-01-15T12:00:05Z" }, "acceptBetterOdds": { "type": "boolean", "default": true, "description": "Accept odds better than orderPrice.", "example": true }, "acceptPartialStake": { "type": "boolean", "default": true, "description": "Allow partial stake fills when full stake exceeds bookmaker limit.", "example": true }, "meta": { "type": "object", "nullable": true, "description": "Custom metadata object. Stored with order but not sent to bookmaker.", "example": { "strategy": "value" } } } }, "PlaceOrdersRequest": { "type": "object", "required": [ "orders" ], "properties": { "orders": { "type": "array", "items": { "$ref": "#/components/schemas/PlaceOrderRequest" }, "minItems": 1, "maxItems": 100, "description": "List of orders to place (max 100 per request)" } } }, "PlaceOrdersResponse": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "accepted", "partial-success", "declined" ], "description": "Overall result: accepted (all OK), partial-success (some declined), declined (all failed)" }, "acceptedOrders": { "type": "array", "items": { "type": "object" }, "description": "Enriched orders that passed validation" }, "declinedOrders": { "type": "array", "items": { "type": "object" }, "description": "Orders that failed validation with declineReason" } } }, "CancelOrdersRequest": { "type": "object", "description": "At least one filter must be provided. Multiple filters are combined with OR logic.", "properties": { "orderIds": { "type": "array", "items": { "type": "integer" }, "nullable": true, "description": "List of numeric order IDs to cancel" }, "requestUuids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "nullable": true, "description": "List of request UUIDs to cancel" }, "userRef": { "type": "string", "nullable": true, "description": "Cancel all orders matching this user reference" } } }, "CancelOrdersResponse": { "type": "object", "properties": { "status": { "type": "string", "description": "'cancelled'" }, "cancelledCount": { "type": "integer", "description": "Number of orders cancelled" }, "cancelled": { "type": "array", "items": { "type": "object" }, "description": "Cancelled orders with enriched details" }, "notCancelled": { "type": "object", "properties": { "reason": { "type": "string" }, "orders": { "type": "array", "items": { "type": "object" } } }, "description": "Orders that could not be cancelled" } } }, "GetOrdersResponse": { "type": "object", "properties": { "orders": { "type": "array", "items": { "type": "object" }, "description": "List of enriched orders with bets and metadata" }, "count": { "type": "integer", "description": "Number of orders in this response" }, "hasMore": { "type": "boolean", "description": "Whether more orders are available" }, "nextCursor": { "type": "integer", "nullable": true, "description": "Pass as afterOrderId to fetch the next page" } } }, "BetResponse": { "type": "object", "properties": { "betId": { "type": "integer", "description": "Bet ID" }, "orderId": { "type": "integer", "description": "Parent order ID" }, "bookmaker": { "type": "string", "description": "Bookmaker slug" }, "betStatus": { "type": "string", "enum": [ "PENDING", "PLACED", "CONFIRMED", "REJECTED", "CANCELLED", "FAILED", "VOID" ], "description": "Bet status" }, "settlementStatus": { "type": "string", "enum": [ "UNSETTLED", "WON", "LOST", "VOID", "HALF_WON", "HALF_LOST", "PUSH", "CASHOUT" ], "description": "Settlement status" }, "clientName": { "type": "string", "description": "Client name" }, "testBet": { "type": "boolean", "description": "Whether this is a test bet" }, "requestUuid": { "type": "string", "description": "UUID from parent order" }, "bookmakerBetId": { "type": "string", "nullable": true, "description": "Bet ID returned by the bookmaker" }, "betRequestId": { "type": "string", "nullable": true, "description": "Internal bet request tracking ID" }, "placedPrice": { "type": "number", "nullable": true, "description": "Actual odds the bet was placed at" }, "placedStake": { "type": "number", "nullable": true, "description": "Stake sent to bookmaker" }, "placedCurrency": { "type": "string", "nullable": true, "description": "Currency the bet was placed in" }, "placedAt": { "type": "string", "nullable": true, "description": "ISO 8601 placement timestamp" }, "declineReason": { "type": "string", "nullable": true, "description": "Reason if bet was declined" }, "userRef": { "type": "string", "nullable": true, "description": "User reference from parent order" }, "account": { "type": "string", "nullable": true, "description": "Account username used for this bet" }, "sentData": { "type": "object", "nullable": true, "description": "Full request payload sent to the bookmaker" }, "receivedData": { "type": "object", "nullable": true, "description": "Full response received from the bookmaker" }, "currencyInfo": { "type": "object", "nullable": true, "description": "Exchange rate snapshot for placedCurrency: { currency, currencyValue, updatedAt }. Null when no rate is available.", "properties": { "currency": { "type": "string" }, "currencyValue": { "type": "number" }, "updatedAt": { "type": "string" } } }, "settledAt": { "type": "string", "nullable": true, "description": "ISO 8601 settlement timestamp" }, "settlementAmount": { "type": "number", "nullable": true, "description": "Settlement payout amount" }, "settlementReason": { "type": "string", "nullable": true, "description": "Reason for settlement" }, "oddsInfo": { "type": "object", "nullable": true, "description": "Odds snapshot at bet time" } } }, "BetsResponse": { "type": "object", "properties": { "status": { "type": "string", "description": "Always 'success'" }, "bets": { "type": "array", "items": { "$ref": "#/components/schemas/BetResponse" } }, "count": { "type": "integer", "description": "Number of bets in this response" }, "hasMore": { "type": "boolean", "description": "Whether more bets are available" }, "nextCursor": { "type": "integer", "nullable": true, "description": "Pass as afterBetId to fetch the next page" } } }, "BetslipResponse": { "type": "object", "properties": { "fixtureId": { "type": "string" }, "outcomeId": { "type": "integer" }, "playerId": { "type": "integer" }, "client": { "type": "string" }, "userRef": { "type": "string", "nullable": true }, "fixtureInfo": { "type": "object", "nullable": true, "description": "Fixture details (teams, sport, tournament, start time, scores)" }, "outcomeInfo": { "type": "object", "nullable": true, "description": "Market and outcome details" }, "playerInfo": { "type": "object", "nullable": true, "description": "Player details for player prop markets" }, "odds": { "type": "object", "description": "Odds keyed by bookmaker slug, each containing odds entries keyed by oddsId (fixtureId:bookmaker:outcomeId:playerId)" } } }, "BookmakerResponse": { "type": "object", "properties": { "bookmakerId": { "type": "integer", "description": "Numeric bookmaker identifier" }, "bookmaker": { "type": "string", "description": "Bookmaker slug (e.g., 'pinnacle')" }, "bookmakerName": { "type": "string", "nullable": true, "description": "Display name" }, "active": { "type": "boolean", "description": "Whether bookmaker is currently active" }, "maxStake": { "type": "number", "nullable": true, "description": "Global max stake for this bookmaker" }, "minStake": { "type": "number", "nullable": true, "description": "Global min stake for this bookmaker" } } }, "MarketResponse": { "type": "object", "properties": { "marketId": { "type": "integer", "description": "Market identifier" }, "marketLength": { "type": "integer", "description": "Number of outcomes" }, "sportId": { "type": "integer", "description": "Sport identifier" }, "playerProp": { "type": "boolean", "description": "Whether this is a player prop market" }, "handicap": { "type": "number", "description": "Handicap value (0 for non-handicap)" }, "marketName": { "type": "string", "description": "Full market name (e.g., 'Full Time Result')" }, "marketNameShort": { "type": "string", "description": "Short market name (e.g., '1X2')" }, "marketType": { "type": "string", "description": "Market type slug (e.g., '1x2', 'asian_handicap')" }, "period": { "type": "string", "description": "Period (e.g., 'fulltime', 'firsthalf')" }, "oddsTypes": { "type": "array", "items": { "$ref": "#/components/schemas/OddsTypeResponse" }, "description": "Outcomes in this market" } } }, "OddsTypeResponse": { "type": "object", "properties": { "outcomeId": { "type": "integer", "description": "Outcome identifier" }, "outcomeName": { "type": "string", "description": "Outcome display name (e.g., '1', 'X', '2')" } } }, "PositionsResponse": { "type": "object", "properties": { "status": { "type": "string" }, "groupBy": { "type": "string" }, "positions": { "type": "array", "items": { "$ref": "#/components/schemas/PositionEntry" } }, "count": { "type": "integer" }, "totalStake": { "type": "number" }, "totalOpenBets": { "type": "integer" } } }, "PositionEntry": { "type": "object", "properties": { "bookmaker": { "type": "string", "nullable": true }, "account": { "type": "string", "nullable": true }, "userRef": { "type": "string", "nullable": true }, "openBets": { "type": "integer", "description": "Number of open bets" }, "totalStake": { "type": "number", "description": "Total stake amount" }, "avgPrice": { "type": "number", "nullable": true, "description": "Average placed price" }, "fixtureIds": { "type": "integer", "nullable": true, "description": "Number of distinct orders" } } }, "PnlResponse": { "type": "object", "properties": { "status": { "type": "string" }, "groupBy": { "type": "string" }, "pnl": { "type": "array", "items": { "$ref": "#/components/schemas/PnlEntry" } }, "count": { "type": "integer" }, "totalNetPnl": { "type": "number" }, "totalStaked": { "type": "number" }, "totalSettledBets": { "type": "integer" } } }, "PnlEntry": { "type": "object", "properties": { "bookmaker": { "type": "string", "nullable": true }, "account": { "type": "string", "nullable": true }, "userRef": { "type": "string", "nullable": true }, "settledBets": { "type": "integer" }, "wins": { "type": "integer" }, "losses": { "type": "integer" }, "voids": { "type": "integer" }, "pushes": { "type": "integer" }, "totalStaked": { "type": "number" }, "totalWon": { "type": "number" }, "totalLost": { "type": "number" }, "netPnl": { "type": "number", "description": "Net profit/loss" }, "winRate": { "type": "number", "nullable": true, "description": "Win rate percentage" } } }, "PlaceFutureOrderRequest": { "type": "object", "required": [ "requestUuid", "futureId", "orderPrice", "orderStake", "userRef", "testOrder" ], "description": "A **futures** order. The fixtures payload with the selection swapped: `futureId` + `futureOutcomeId` + `participantId` instead of `fixtureId` + `outcomeId` + `playerId`. Everything else is identical, including the `requestUuid` idempotency rule. There is **no `playerId`** on futures — `participantId` names a team or a player alike — and no period. The fixture keys `fixtureId`, `outcomeId` and `playerId` are rejected with `422`.", "properties": { "requestUuid": { "type": "string", "description": "Unique idempotency key (UUID format). Normalised to the canonical lower-case hyphenated form, so the value echoed back may differ in spelling from the one you sent (`{braces}`, upper-case and un-hyphenated forms all land on the same key). A duplicate within 30 minutes is skipped; the request returns 409 only if every order is a duplicate.", "example": "eb45b192-317b-42d5-9f65-af497b9fa8c1" }, "futureId": { "type": "string", "description": "Future identifier (e.g., 'id1012639310001').", "example": "id1012639310001" }, "futureOutcomeId": { "type": "integer", "default": 0, "description": "`0` (the default) is the **participant-keyed** sentinel — the participant IS the selection (outright winner, topscorer, relegation, mvp) — and then `participantId` must be a real id. A real id (>= 100001) means a **decomposed** market (prediction Yes/No, season totals Over/Under), where `participantId` may stay `0`.", "example": 0 }, "participantId": { "type": "integer", "default": 0, "description": "The team or player you back (participant-keyed), or the entity a line is about (decomposed). Required (non-zero) when `futureOutcomeId` is 0.", "example": 7193 }, "orderPrice": { "type": "number", "exclusiveMinimum": 0, "description": "Minimum acceptable decimal odds. Bets will only be placed at this price or better.", "example": 1.95 }, "orderStake": { "type": "number", "exclusiveMinimum": 0, "description": "Stake amount in orderCurrency. Must be within bookmaker min/max limits.", "example": 10.0 }, "userRef": { "type": "string", "minLength": 1, "description": "Your reference string for grouping/filtering orders (e.g., user ID, session ID)", "example": "bettor1234" }, "testOrder": { "type": "boolean", "description": "If true, order is validated and persisted but NOT placed with bookmaker. Use for testing.", "example": false }, "bookmakers": { "type": "string", "nullable": true, "description": "Comma-separated bookmaker slugs to target (e.g., 'pinnacle,bet365'). Use '*' or omit for automatic selection.", "example": "pinnacle,vertex" }, "orderCurrency": { "type": "string", "default": "USD", "description": "ISO 4217 currency code for orderStake. Converted to bookmaker currency at placement.", "example": "USD" }, "back": { "type": "boolean", "default": true, "description": "Bet direction. true = back (win if selection wins), false = lay (win if selection loses).", "example": true }, "expiresAt": { "type": "string", "nullable": true, "description": "ISO 8601 timestamp when order expires. Defaults to 5 seconds from now. Capped at 24 hours maximum.", "example": "2026-01-15T12:00:05Z" }, "acceptBetterOdds": { "type": "boolean", "default": true, "description": "Accept odds better than orderPrice.", "example": true }, "acceptPartialStake": { "type": "boolean", "default": true, "description": "Allow partial stake fills when full stake exceeds bookmaker limit.", "example": true }, "meta": { "type": "object", "nullable": true, "description": "Custom metadata object. Stored with order but not sent to bookmaker.", "example": { "strategy": "value" } } } }, "PlaceFutureOrdersRequest": { "type": "object", "required": [ "orders" ], "description": "A batch of futures orders. Every `requestUuid` must be unique within the batch.", "properties": { "orders": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/PlaceFutureOrderRequest" } } } }, "FutureSeasonEntry": { "type": "object", "required": [ "futureId" ], "description": "One future — a season × market pair — under a futures market.", "properties": { "futureId": { "type": "string", "description": "Future identifier — use this on `GET /futures/betslip`.", "example": "id1012639310001" }, "seasonId": { "type": "integer", "nullable": true, "description": "Season identifier." }, "tournamentId": { "type": "integer", "nullable": true, "description": "Tournament identifier. A **field**, not a segment of the id — which is what lets a futureId stay stable when a provider re-parents a season." }, "startTime": { "type": "integer", "nullable": true, "description": "Unix seconds." }, "endTime": { "type": "integer", "nullable": true, "description": "Unix seconds." }, "statusId": { "type": "integer", "nullable": true, "description": "0 upcoming/open, 1 in progress, 2 finished, 3 cancelled, 4 removed. **0 and 1 are both tradeable** for an outright — 1 means the competition is running, not that the market is in-play." }, "reissuedFutureId": { "type": "string", "nullable": true, "description": "Replacement id for a cancelled (`statusId 3`) future that has been re-listed. `null` means no replacement **yet** — the value can appear after you first saw the future cancelled. One hop only; not resolved for you." } } }, "FutureMarketResponse": { "type": "object", "required": [ "futureMarketId", "sportId", "futureCount", "futures" ], "description": "A futures market, with the futures currently carrying it.", "properties": { "futureMarketId": { "type": "integer", "description": "Future market identifier (the futureId's 5-digit tail).", "example": 10001 }, "sportId": { "type": "integer", "description": "Sport identifier.", "example": 10 }, "marketName": { "type": "string", "nullable": true, "description": "Market display name when OddsPAPI publishes one on the future row; `null` otherwise. Read, never inferred." }, "marketType": { "type": "string", "nullable": true, "description": "Market type slug when OddsPAPI publishes one on the future row; `null` otherwise." }, "futureCount": { "type": "integer", "description": "How many cached futures carry this market." }, "futures": { "type": "array", "items": { "$ref": "#/components/schemas/FutureSeasonEntry" }, "description": "The futures carrying this market, newest start time first." } } }, "FuturesBetslipResponse": { "type": "object", "description": "The betslip response for a futures selection. Same shape as `BetslipResponse` with the selection swapped: `futureId` / `futureOutcomeId` / `participantId` and `futureInfo` instead of `fixtureId` / `outcomeId` / `playerId` and `fixtureInfo`. There is **no `playerId`** and no `playerInfo`.", "properties": { "futureId": { "type": "string", "example": "id1012639310001" }, "futureOutcomeId": { "type": "integer", "example": 0 }, "participantId": { "type": "integer", "example": 7193 }, "client": { "type": "string", "example": "demo" }, "userRef": { "type": "string", "nullable": true }, "futureInfo": { "type": "object", "nullable": true, "description": "Future details (season, tournament, status, start/end time)." }, "outcomeInfo": { "type": "object", "nullable": true, "description": "Outcome details. `null` for a participant-keyed market, which has no outcome row." }, "odds": { "type": "object", "description": "Live odds keyed by bookmaker, then by oddsId. Treat the oddsId as **opaque** — store it, do not parse it." } } } } }, "security": [ { "apiKey": [] } ], "tags": [ { "name": "Orders", "description": "Place, retrieve, and cancel betting orders on fixtures" }, { "name": "Bets", "description": "Query individual bets placed with bookmakers" }, { "name": "Betslip", "description": "Get live odds and metadata for fixtures" }, { "name": "Markets", "description": "Get available markets and odds types" }, { "name": "Futures", "description": "Outright markets, keyed by futureId + (futureOutcomeId, participantId). Reads are live; placement and order/bet reads answer 501 for now." }, { "name": "Accounts", "description": "Manage bookmaker accounts" }, { "name": "Bookmakers", "description": "List supported bookmakers" }, { "name": "Analytics", "description": "Positions and profit/loss analytics" } ] }