Skip to Content
Scalar
Trading APIs

Cancel all orders

Cancels every resting order of a user within the requested scope: `all`, a single `instrument`, or a whole `product`. Cancelling zero orders succeeds with an empty `cancelled` list. Requires an `Authorization: Bearer` SIWE token proving control of `user`; otherwise 401.

DELETE
/orders

Cancels every resting order of a user within the requested scope: all, a single instrument, or a whole product. Cancelling zero orders succeeds with an empty cancelled list. Requires an Authorization: Bearer SIWE token proving control of user; otherwise 401.

Authorization

bearer_auth
headerAuthorizationBearer <token>

Request Body

application/json
  1. body

Request body for DELETE /orders.

instrument?|

Instrument identifier in hex (required for instrument scope, rejected otherwise)

product_ptr?|

Product pointer address in hex (required for product scope, rejected otherwise)

scope*CancelAllScope

Which of the user's resting orders to cancel

Value in"all""instrument""product"
user*string

User address in hex format (0x prefix optional)

Response Body

Orders cancelled

application/json
  1. response

Reply body for DELETE /orders. Cancelling zero orders is a success with an empty cancelled list.

count is cancelled.len(). The WebSocket cancel_all_ack deliberately omits it: that frame is chunked, so a per-frame count would be ambiguous against a total.

cancelled*array<>

The cancelled orders (empty when nothing matched the scope)

count*integer

Number of orders cancelled (cancelled.len())

Range0 <= value
exchange_ts_micros*integer

Exchange timestamp in microseconds since the Unix epoch

Formatint64
scope*string

The scope that was swept

Example Request
curl -X DELETE 'https://testnet-api.scalar.market/orders' \
  -H 'Content-Type: application/json' \
  -d '{
  "scope": "all",
  "user": "string"
}'
Example Response
{
  "cancelled": [
    {
      "client_tag": "string",
      "executed_quantity": 0,
      "instrument": "string"
    }
  ],
  "count": 0,
  "exchange_ts_micros": 0,
  "scope": "string"
}