Skip to main content
POST
/
session
/
cancelByReference
Cancel orders by user reference
curl --request POST \
  --url https://api.4casters.io/session/cancelByReference \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "gameID": "6924f82640a7e89c3d3acc41",
  "userReferences": [
    "my-order-1",
    "my-order-2"
  ]
}
'
{
  "data": [
    {
      "success": true,
      "reason": "<string>",
      "sessionID": "<string>",
      "description": "<string>",
      "odds": 123,
      "filled": 123,
      "offered": 123,
      "remaining": 123,
      "gameID": "<string>",
      "userReference": "<string>"
    }
  ]
}

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.

Cancel every open order in the given game whose userReference matches one of the supplied references. Useful when you’ve tagged orders with your own ids and want to cancel by those instead of tracking 4casters order ids.

Request

POST /session/cancelByReference
gameID
string
required
Scope the search to a single game.
userReferences
array
required
Array of userReference strings. Every open order in gameID whose userReference is in this array is cancelled.
curl -X POST https://api.4casters.io/session/cancelByReference \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "gameID": "6924f82640a7e89c3d3acc41",
    "userReferences": ["my-order-1", "my-order-2"]
  }'

Response

data
array
Per-order cancel results. Same shape as Cancel an order.

Errors

StatusMeaning
400userReferences missing or not an array.

Authorizations

Authorization
string
header
required

Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.

Body

application/json
userReferences
string[]
required
gameID
string
required

Response

Per-order cancel results

data
object[]