DELETE
/
api
/
v1
/
orders
curl --request DELETE \
  --url https://order.sandbox.rails.xyz/api/v1/orders \
  --header 'Authorization: Bearer <token>'
{
  "message": "Cancelling 1 order for market ETH-USD without any errors"
}
For order cancellations, we recommend using the Cancel Order By ID WebSocket instead of this endpoint. A 200 response from this endpoint only indicates that your request has been received and processing has begun; it does not guarantee the successful cancellation of all orders.

If you prefer using this endpoint for its convenience, there are three ways to make sure that all orders have been cancelled successfully:

  1. Call the endpoint again and check if “Cancelling 0 orders” is included in the response message.
  2. Call the Get Account Open Orders endpoint to check if the orders are still there.
  3. Include an optional clientRequestId query parameter to uniquely identify the request and subscribe to Order Creation WebSocket for notifications (one notification per order). The notification message will contain the same client request ID plus a suffix. For example, if the client request ID is 0835bf3e-4a20-41f0-908d-8213f2b7a285 and there are two orders to be cancelled, the two notifications will contain 0835bf3e-4a20-41f0-908d-8213f2b7a285#0 and 0835bf3e-4a20-41f0-908d-8213f2b7a285#1 respectively in no particular order.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

market
string
required

To get all supported markets, call /api/v1/markets endpoint. To cancel orders across all markets, use the value all.

clientRequestId
string

The client request ID must be a UUID and is used to uniquely identify the request. If not provided, a random UUID will be generated.

Response

200
application/json

The response is of type object.