Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.4casters.io/llms.txt

Use this file to discover all available pages before exploring further.

Four cancel variants are supported. All of them respond with the same envelope: { requestID, data: [ ...CancelResponsePayload ] }.

Cancel response payload

Every successful cancel returns one or more entries shaped like this. Note the field-name casing flips between request (orderId/gameId, lowercase d) and response (orderID/gameID, uppercase ID).
{
  "success": true,
  "orderID": "67f45377c18c6697c172afa4",
  "odds": -110,
  "filled": 0,
  "offered": 100,
  "remaining": 100,
  "side": "5c12bc1ce0daba000f47ba8b",
  "number": -3.5,
  "gameID": "688c0516fbc14da0c202d426",
  "userReference": "client-ref-001",
  "description": "Dallas Mavericks +3.5"
}
success
boolean
true when the order was cancelled.
orderID
string
ID of the cancelled order.
filled
number
Amount that was already filled before the cancel landed.
offered
number
Always 0 after a cancel — the offered side is wound down to zero.
remaining
number
Amount that was unmatched at cancel time.
odds
number
Odds of the cancelled order in American format, from the maker’s perspective.
side
string
Participant ID (moneyline/spread) or over/under (totals).
number
number
Spread or total number; null for moneylines.
gameID
string
Game the cancelled order was on.
userReference
string
The userReference you set when placing the order, if any.
description
string
Human-readable description of the bet (e.g. "Dallas Mavericks +3.5").

Cancel by ID

Cancel a single order by its order ID.

Request

[
  "cancelById",
  {
    "requestID": "YOUR_REQUEST_ID",
    "orderId": "ORDER_ID_TO_CANCEL"
  }
]

Response

{
  "requestID": "YOUR_REQUEST_ID",
  "data": [
    {
      "success": true,
      "orderID": "67f45377c18c6697c172afa4",
      "odds": -110,
      "filled": 0,
      "offered": 0,
      "remaining": 100,
      "side": "5c12bc1ce0daba000f47ba8b",
      "number": -3.5,
      "gameID": "688c0516fbc14da0c202d426",
      "userReference": "client-ref-001",
      "description": "Dallas Mavericks +3.5"
    }
  ]
}

Cancel multiple

Cancel a specific set of orders by ID.

Request

[
  "cancelMultiple",
  {
    "requestID": "YOUR_REQUEST_ID",
    "orderIDs": [
      "ORDER_ID_1",
      "ORDER_ID_2",
      "ORDER_ID_3"
    ]
  }
]

Response

data contains one entry per order ID; check each success flag.
{
  "requestID": "YOUR_REQUEST_ID",
  "data": [
    {
      "success": true,
      "orderID": "ORDER_ID_1",
      "odds": -110,
      "filled": 0,
      "offered": 0,
      "remaining": 100,
      "side": "5c12bc1ce0daba000f47ba8b",
      "number": -3.5,
      "gameID": "688c0516fbc14da0c202d426",
      "userReference": "",
      "description": "Dallas Mavericks +3.5"
    },
    {
      "success": false,
      "orderID": "ORDER_ID_2",
      "description": "order already cancelled"
    }
  ]
}

Cancel all by game

Cancel every open order you have on a single game. Optionally narrow the cancel to a specific market by passing type, side, and/or market.

Request

[
  "cancelAllByGame",
  {
    "requestID": "YOUR_REQUEST_ID",
    "gameId": "GAME_ID_TO_CANCEL",
    "type": "spread",
    "side": "5c12bc1ce0daba000f47ba8b",
    "market": "main"
  }
]
gameId
string
required
Game whose orders should be cancelled.
type
string
Optional — filter to a single market type: moneyline, spread, total, or moneyline1x2.
side
string
Optional — participant ID (moneyline/spread) or over/under (totals).
market
string
Optional — market identifier (e.g. main).

Response

{
  "requestID": "YOUR_REQUEST_ID",
  "data": [
    {
      "success": true,
      "orderID": "67f45377c18c6697c172afa4",
      "odds": -110,
      "filled": 0,
      "offered": 0,
      "remaining": 100,
      "side": "5c12bc1ce0daba000f47ba8b",
      "number": -3.5,
      "gameID": "688c0516fbc14da0c202d426",
      "userReference": "",
      "description": "Dallas Mavericks +3.5"
    }
  ]
}

Cancel all

Cancel every open order on the account.

Request

[
  "cancelAll",
  {
    "requestID": "YOUR_REQUEST_ID"
  }
]

Response

{
  "requestID": "YOUR_REQUEST_ID",
  "data": [
    {
      "success": true,
      "orderID": "67f45377c18c6697c172afa4",
      "odds": -110,
      "filled": 0,
      "offered": 0,
      "remaining": 100,
      "side": "5c12bc1ce0daba000f47ba8b",
      "number": -3.5,
      "gameID": "688c0516fbc14da0c202d426",
      "userReference": "",
      "description": "Dallas Mavericks +3.5"
    }
  ]
}

Errors

When a cancel cannot be processed, the server responds with the standard error envelope (no data field):
{
  "requestID": "YOUR_REQUEST_ID",
  "error": "order not found"
}
Common error values:
ErrorWhen
invalid order ID formatcancelById orderId is not a valid ObjectID.
order not foundThe order ID does not exist.
unauthorized: order does not belong to userYou’re trying to cancel another user’s order.
order already cancelledThe order was already cancelled.
order is expiredThe order expired before the cancel landed.
order already gradedThe order has already been graded (settled).
game not foundThe referenced game is not in the cache.
Failed to process cancelMultipleAn unexpected error processing a cancelMultiple batch.
Failed to process cancelAllAn unexpected error processing cancelAll.
Failed to process cancelAllByGameAn unexpected error processing cancelAllByGame.
For batch cancels (cancelMultiple, cancelAllByGame, cancelAll) per-order failures appear in data with success: false and a description explaining the reason — only an envelope-level error indicates the whole request failed.