Skip to main content
POST
/
orders
/
cancel-replace
Cancel and replace an order
curl --request POST \
  --url https://api-testnet.context.markets/v2/orders/cancel-replace \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cancel": {
    "trader": "<string>",
    "nonce": "<string>",
    "signature": "<string>"
  },
  "create": {
    "marketId": "<string>",
    "trader": "<string>",
    "price": "<string>",
    "size": "<string>",
    "outcomeIndex": 0,
    "side": 123,
    "nonce": "<string>",
    "expiry": "<string>",
    "maxFee": "<string>",
    "makerRoleConstraint": 1,
    "inventoryModeConstraint": 1,
    "signature": "<string>",
    "type": "<string>"
  }
}
'
{
  "cancel": {
    "trader": "<string>",
    "nonce": "<string>",
    "alreadyCancelled": true,
    "success": true
  },
  "create": {
    "success": true,
    "order": {
      "side": 123,
      "price": "<string>",
      "size": "<string>",
      "filledSize": "<string>",
      "remainingSize": "<string>",
      "percentFilled": 123,
      "insertedAt": "2023-11-07T05:31:56Z",
      "type": "limit",
      "trader": "<string>",
      "marketId": "<string>",
      "status": "open",
      "voidedAt": "2023-11-07T05:31:56Z",
      "voidReason": "UNFILLED_MARKET_ORDER",
      "outcomeIndex": 123,
      "nonce": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Body

application/json

Cancel-replace order pair

cancel
object
required
create
object
required

Response

Order replaced

cancel
object
required
create
object
required