Skip to main content
GET
/
orders
Fetch orders by filters.
curl --request GET \
  --url https://sandbox.api.btdx.io/orders \
  --header 'authorization: <authorization>'
{
  "_meta": {
    "_count": 123,
    "_page": {
      "_pageNumber": 123,
      "_pageSize": 123,
      "_totalElements": 123,
      "_totalPages": 123
    }
  },
  "orders": [
    {
      "id": "<string>",
      "appId": "<string>",
      "market": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "walletId": "<string>",
      "outcomeId": "<string>",
      "outcomeTitle": "<string>",
      "price": 123,
      "stake": 123,
      "stakeUnmatched": 123,
      "stakeVoided": 123,
      "keepWhenInPlay": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "modifiedAt": "2023-11-07T05:31:56Z",
      "commissionRateId": "<string>",
      "reference": "<string>",
      "cancellationReason": "<string>"
    }
  ],
  "markets": [
    {
      "id": "<string>",
      "name": "<string>",
      "published": true,
      "suspended": true,
      "lockAt": "2023-11-07T05:31:56Z",
      "settledAt": "2023-11-07T05:31:56Z",
      "event": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "events": [
    {
      "id": "<string>",
      "eventGroup": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "name": "<string>",
      "code": "<string>",
      "expectedStartTime": "2023-11-07T05:31:56Z",
      "active": true
    }
  ],
  "trades": [
    {
      "order": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      },
      "id": "<string>",
      "price": 123,
      "stake": 123,
      "profitLoss": 123,
      "createdAt": "2023-11-07T05:31:56Z"
    }
  ],
  "eventGroups": [
    {
      "id": "<string>",
      "name": "<string>",
      "subcategory": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "subcategories": [
    {
      "id": "<string>",
      "name": "<string>",
      "category": {
        "_ref": "<string>",
        "_ids": [
          "<string>"
        ]
      }
    }
  ],
  "categories": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ]
}

Headers

authorization
string
required

Header with the accessToken for the current session

Query Parameters

ids
string[]

list of order ids to filter by

appIds
string[]

list of apps to filter by

eventIds
string[]

list of events to filter by

marketIds
string[]

list of markets to filter by

walletIds
string[]

list of wallets to filter by

references
string[]

list of references to filter by - requires appId to be provided also

statuses
enum<string>[]

statuses to filter by - valid values to choose are as follows:

  • Cancelled - Orders that have not matched and have been cancelled either on request or automatically
  • Matched - Orders that have been matched, either fully or partially, where the remaining unmatched stake has been cancelled, either on request or automatically
  • PartiallyMatched - Orders that have been partially matched, and the remaining unmatched portion might still be matched
  • Unmatched - Orders that have not yet been matched, and the remaining unmatched portion might still be matched
  • Won - Previously Matched orders that have been deemed to have Won at the time of market settlement
  • Lost - Previously Matched orders that have been deemed to have Lost at the time of market settlement
  • Voided - All orders belonging to markets that have been voided

The status of an order can be one of the following

  • Cancelled - The order was not matched and has been cancelled either on request or automatically
  • Failed - A pending order was persisted but then failed to be fully created
  • Matched - The order has been matched, either fully, or partially where the remaining unmatched stake has been cancelled, either on request or automatically
  • PartiallyMatched - The order has been partially matched, and the remaining unmatched portion might still be matched
  • Pending - An order has been persisted but has not yet been processed
  • Unmatched - The order has not yet been matched, and the remaining unmatched portion might still be matched
  • Won - The market has been settled and this previously Matched order has been deemed to have Won
  • Lost - The market has been settled and this previously Matched order has been deemed to have Lost
  • Voided - The market has been voided so this order has been voided
Available options:
Cancelled,
Failed,
Matched,
PartiallyMatched,
Pending,
Unmatched,
Won,
Lost,
Voided
fromStake
number

beginning of the stake range filter (inclusive)

toStake
number

end of the stake range filter (inclusive)

fromCreatedAt
string<date-time>

beginning of the creation date range filter (inclusive)

toCreatedAt
string<date-time>

end of the creation date range filter (inclusive)

matchBehavior
enum<string>

Optional - How any unmatched portion of an order is treated:

  • RetainUnmatched - unmatched portion persists as an offer (default)
  • CancelUnmatched - unmatched portion is cancelled
Available options:
RetainUnmatched,
CancelUnmatched
page
integer
default:0

Zero-based page index (0..N)

size
integer
default:20

The size of the page to be returned

sort
string[]

Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

Response

OK

_meta
object
orders
object[]
markets
object[]
events
object[]
trades
object[]
eventGroups
object[]
subcategories
object[]
categories
object[]