Skip to main content
POST
/
orders
Create order
curl --request POST \
  --url https://sandbox.api.btdx.io/orders \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "walletId": "<string>",
  "marketId": "<string>",
  "outcomeId": "<string>",
  "price": 123,
  "stake": 123,
  "keepWhenInPlay": true,
  "reference": "<string>",
  "commissionRateId": "<string>"
}
'
{
  "_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

Body

application/json
walletId
string
required
marketId
string
required
side
enum<string>
required
Available options:
For,
Against
outcomeId
string
required
price
number
required
stake
number
required
keepWhenInPlay
boolean
required

Optional - whether to keep unmatched portion of the order when its market enters InPlay (only relevant if the market has eventStartAction: CancelUnmatchedLiquidity) - default is false

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
reference
string
commissionRateId
string

Optional - to use a different commission rate for this order than your app's default commission rate. If omitted or set to null, the app's default commission rate will be used (if it has one).

Response

OK

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