Skip to Content
Scalar
Trading APIs

Cancel an order

Cancels a resting order by user, instrument, and client tag, and returns the executed quantity if it was partially filled. Requires an `Authorization: Bearer` SIWE token proving control of `user`; otherwise 401.

DELETE
/orders/{client_tag}

Cancels a resting order by user, instrument, and client tag, and returns the executed quantity if it was partially filled. Requires an Authorization: Bearer SIWE token proving control of user; otherwise 401.

Authorization

bearer_auth
headerAuthorizationBearer <token>

Path Parameters

client_tag*string

Client tag in hex format (0x prefix optional)

Query Parameters

user*string

User address in hex format (0x prefix optional)

instrument*string

Instrument identifier in hex format (0x prefix optional)

Response Body

Order cancelled

application/json
  1. response

The engine cancelled a resting order. Failures come back as an error envelope; in particular a cancel that lost a race to a fill or an expiry is order_not_found, which is benign.

client_tag*string

Client tag as 0x-prefixed lowercase hex

exchange_ts_micros*integer

Exchange timestamp in microseconds since the Unix epoch

Formatint64
executed_quantity*integer

Quantity already executed before cancellation, in whole contracts

Formatint64
Range0 <= value
instrument*string

Instrument identifier as 0x-prefixed lowercase hex

user*string

User address as 0x-prefixed lowercase hex

Example Request
curl -X DELETE 'https://testnet-api.scalar.market/orders/string?user=string&instrument=string'
Example Response
{
  "client_tag": "string",
  "exchange_ts_micros": 0,
  "executed_quantity": 0,
  "instrument": "string",
  "user": "string"
}