Cancel all orders
POST/cancelallorders
This endpoint allows cancelling orders which are associated with a future's contract or a margin account. If no arguments are specified all open orders will be cancelled.
Request
- application/json
Body
required
A futures product to cancel all open orders.
Responses
- 200
- application/json
- Schema
- success
Schema
- Success Response
- ErrorResponse
- Array [
- ]
- Array [
- OrderJson
- ]
cancelled
- successful cancellationnoOrdersToCancel
- no open orders for cancellationaccountInactive
: The Futures account the request refers to is inactiveapiLimitExceeded
: The API limit for the calling IP address has been exceededauthenticationError
: The request could not be authenticatedinsufficientFunds
: The amount requested for transfer is below the amount of funds availableinvalidAccount
: The Futures account the transfer request refers to is invalidinvalidAmount
: The amount the transfer request refers to is invalidinvalidArgument
: One or more arguments provided are invalidinvalidUnit
: The unit the transfer request refers to is invalidJson Parse Error
: The request failed to pass valid JSON as an argumentmarketUnavailable
: The market is currently unavailablenonceBelowThreshold
: The provided nonce is below the thresholdnonceDuplicate
: The provided nonce is a duplicate as it has been used in a previous requestnotFound
: The requested information could not be foundrequiredArgumentMissing
: One or more required arguments are missingServer Error
: There was an error processing the requestUnavailable
: The endpoint being called is unavailableunknownError
: An unknown error has occurred
cancelStatus object
A structure containing information on the cancellation request.
The symbol of the futures or all.
cancelledOrders object[]
A list of structures containing all the successfully cancelled orders.
Possible values: <= 100 characters
Unique client order identifier.
Order ID.
orderEvents object[]
Possible values: [CANCEL
]
Always CANCEL
.
The UID associated with the order.
order object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
The date and time the order cancellation was received.
Possible values: [noOrdersToCancel
, cancelled
]
The status of the order cancellation:
Possible values: [success
]
Server time in Coordinated Universal Time (UTC)
Possible values: [accountInactive
, apiLimitExceeded
, authenticationError
, insufficientFunds
, invalidAccount
, invalidAmount
, invalidArgument
, invalidUnit
, Json Parse Error
, marketUnavailable
, nonceBelowThreshold
, nonceDuplicate
, notFound
, requiredArgumentMissing
, Server Error
, Unavailable
, unknownError
]
Possible values: [accountInactive
, apiLimitExceeded
, authenticationError
, insufficientFunds
, invalidAccount
, invalidAmount
, invalidArgument
, invalidUnit
, Json Parse Error
, marketUnavailable
, nonceBelowThreshold
, nonceDuplicate
, notFound
, requiredArgumentMissing
, Server Error
, Unavailable
, unknownError
]
Error description.
Possible values: [error
]
Server time in Coordinated Universal Time (UTC)
{
"result": "success",
"cancelStatus": {
"receivedTime": "2019-08-01T15:57:37.518Z",
"cancelOnly": "all",
"status": "cancelled",
"cancelledOrders": [
{
"order_id": "6180adfa-e4b1-4a52-adac-ea5417620dbd"
},
{
"order_id": "89e3edbe-d739-4c52-b866-6f5a8407ff6e"
},
{
"order_id": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7"
}
],
"orderEvents": [
{
"type": "CANCEL",
"uid": "89e3edbe-d739-4c52-b866-6f5a8407ff6e",
"order": {
"orderId": "89e3edbe-d739-4c52-b866-6f5a8407ff6e",
"type": "post",
"symbol": "PI_XBTUSD",
"side": "buy",
"quantity": 890,
"filled": 0,
"limitPrice": 10040,
"reduceOnly": false,
"timestamp": "2019-08-01T15:57:08.508Z",
"lastUpdateTimestamp": "2019-08-01T15:57:08.508Z"
}
},
{
"type": "CANCEL",
"uid": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7",
"order": {
"orderId": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7",
"type": "lmt",
"symbol": "PI_XBTUSD",
"side": "sell",
"quantity": 900,
"filled": 0,
"limitPrice": 10145,
"reduceOnly": true,
"timestamp": "2019-08-01T15:57:14.003Z",
"lastUpdateTimestamp": "2019-08-01T15:57:14.003Z"
}
}
]
},
"serverTime": "2019-08-01T15:57:37.520Z"
}