Skip to main content
POST
/
orders
Create order
curl --request POST \
  --url https://api.context.markets/v2/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "limit",
  "marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
  "trader": "0x1111111111111111111111111111111111111111",
  "price": "510000",
  "size": "1000000",
  "outcomeIndex": 0,
  "side": 0,
  "nonce": "0xabc123",
  "expiry": "0",
  "maxFee": "0",
  "makerRoleConstraint": 0,
  "inventoryModeConstraint": 0,
  "signature": "0xabc123"
}
'
{
  "success": true,
  "order": {
    "marketId": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "trader": "0x1111111111111111111111111111111111111111",
    "nonce": "0xabc123",
    "side": 0,
    "price": "1000000",
    "size": "1000000",
    "filledSize": "1000000",
    "remainingSize": "1000000",
    "percentFilled": 123,
    "insertedAt": "2023-11-07T05:31:56Z",
    "type": "limit",
    "status": "open",
    "voidedAt": "2023-11-07T05:31:56Z",
    "voidReason": "UNFILLED_MARKET_ORDER",
    "outcomeIndex": 123,
    "expiry": "1000000",
    "settlementVersion": 1,
    "sv2OrderKind": 0,
    "sv2TimeInForce": 0,
    "sv2MinSharesOut": "1000000",
    "sv2MaxCollateralIn": "1000000",
    "sv2MinCollateralOut": "1000000"
  }
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json
type
enum<string>
required
Available options:
limit
marketId
string
required

32-byte hex hash

Pattern: ^0x[a-fA-F0-9]{64}$
Example:

"0x1111111111111111111111111111111111111111111111111111111111111111"

trader
string
required

EVM address

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0x1111111111111111111111111111111111111111"

price
string
required

Integer encoded as decimal string

Pattern: ^\d+$
Example:

"1000000"

size
string
required

Requested share size in 6-decimal fixed-point units. The API accepts this high-level limit-order shape and maps it to the current settlement model after migration.

Pattern: ^\d+$
Example:

"1000000"

outcomeIndex
integer
required
side
required
Available options:
0
nonce
string
required

Hex string

Pattern: ^0x[a-fA-F0-9]*$
Example:

"0xabc123"

expiry
string
required

Integer encoded as decimal string

Pattern: ^\d+$
Example:

"1000000"

maxFee
string
required

Integer encoded as decimal string

Pattern: ^\d+$
Example:

"1000000"

makerRoleConstraint
required

Constraint enum. 0 = any, 1 = yes, 2 = no / no-inventory depending on the field.

Available options:
0
inventoryModeConstraint
required

Constraint enum. 0 = any, 1 = yes, 2 = no / no-inventory depending on the field.

Available options:
0
signature
string
required

Hex string

Pattern: ^0x[a-fA-F0-9]*$
Example:

"0xabc123"

buyValue
string

Optional pre-fee collateral budget for buy orders, in 6-decimal fixed-point units. The normalized SettlementV2 collateral cap adds maxFee on top of this value.

Pattern: ^\d+$
Example:

"1000000"

timeInForce

Optional time-in-force override for the normalized SettlementV2 order. When omitted, the server uses good-till-cancelled (GTC).

Available options:
0
clientOrderType
enum<string>

Optional client-side intent label preserved by the API. This does not change signature verification.

Available options:
limit,
market

Response

Order created

success
enum<boolean>
required
Available options:
true
order
object
required