Cancel order
POST/cancelorder
This endpoint allows cancelling an open order for a Futures contract.
Request
- application/json
Body
required
The time before which the request should be processed, otherwise it is rejected.
The unique identifier of the order to be cancelled.
The client unique identifier of the order to be cancelled.
Responses
- 200
- application/json
- Schema
- success
Schema
- Success Response
- ErrorResponse
- Array [
- PlaceEvent
- CancelEvent
- EditEvent
- RejectEvent
- ExecuteEvent
- PlaceTriggerEvent
- CancelTriggerEvent
- RejectTriggerEvent
- OrderJson
- OrderJson
POST_WOULD_EXECUTE
- The post-only order would be filled upon placement, thus is cancelled.IOC_WOULD_NOT_EXECUTE
- The immediate-or-cancel order would not execute.- OrderJson
- OrderTriggerJson
- OrderTriggerJson
- ]
cancelled
- The order has been cancelled. This may only be part of the order as part may have been filled. Check open_orders websocket feed for status of the order.filled
- The order was found completely filled and could not be cancellednotFound
- The order was not found, either because it had already been cancelled or it never existedaccountInactive
: 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 client order ID. Shown only if client specified one.
orderEvents object[]
Possible values: [PLACE
]
Always PLACE
.
order object
The placed order.
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 amount of quantity that was removed before placement or null if the order is not a reduce only.
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.
Possible values: [EDIT
]
Always EDIT
.
old object
The order before the edit was applied.
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.
new object
The order after the edit was applied.
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 amount of quantity that was removed from the edited order or null if the order is not a reduce only.
Possible values: [REJECT
]
Always REJECT
.
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.
Possible values: [POST_WOULD_EXECUTE
, IOC_WOULD_NOT_EXECUTE
]
The rejection reason:
Possible values: [EXECUTION
]
Always EXECUTION
.
The UID associated with the execution.
The price of the execution.
The executed amount.
orderPriorEdit 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.
orderPriorExecution object
The order before it executes.
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 amount of quantity that was removed from the order before execution or null if the order is not a reduce only.
Possible values: [PLACE
]
Always PLACE
.
orderTrigger 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
]
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 limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
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.
Possible values: [CANCEL
]
Always CANCEL
.
orderTrigger 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
]
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 limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
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.
Possible values: [REJECT
]
Always REJECT
.
orderTrigger 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
]
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 limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
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.
Possible values: [MARKET_SUSPENDED
, MARKET_NOT_FOUND
, INVALID_PRICE
, INVALID_QUANTITY
, SMALL_ORDER_LIMIT_EXCEEDED
, INSUFFICIENT_MARGIN
, WOULD_CAUSE_LIQUIDATION
, CLIENT_ORDER_ID_IN_USE
, CLIENT_ORDER_ID_TOO_LONG
, MAX_POSITION_EXCEEDED
, PRICE_COLLAR
, PRICE_DISLOCATION
, EDIT_HAS_NO_EFFECT
, ORDER_FOR_CANCELLATION_NOT_FOUND
, ORDER_FOR_EDIT_NOT_FOUND
, ORDER_CANNOT_HAVE_TRIGGER_PRICE
, POST_WOULD_EXECUTE
, IOC_WOULD_NOT_EXECUTE
, WOULD_EXECUTE_SELF
, WOULD_NOT_REDUCE_POSITION
, REJECTED_AFTER_EXECUTION
, MARKET_IS_POST_ONLY
, ORDER_LIMIT_EXCEEDED
, FIXED_LEVERAGE_TOO_HIGH
, CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP
, CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP
, TRAILING_STOP_ORDER_LIMIT_EXCEEDED
, TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES
, TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE
, TRAILING_STOP_MAX_DEVIATION_TOO_LARGE
, TRAILING_STOP_MAX_DEVIATION_TOO_SMALL
, INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP
, NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE
, INSUFFICIENT_CLOSING_MARGIN
, LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE
, LIMIT_PRICE_OFFSET_VALUE_INVALID
, LIMIT_PRICE_OFFSET_UNIT_INVALID
, LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT
, LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE
, LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES
, LIMIT_PRICE_OFFSET_TOO_HIGH
, LIMIT_PRICE_OFFSET_TOO_LOW
]
The cancelled order UID
The date and time the order cancellation was received.
Possible values: [cancelled
, filled
, notFound
]
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": {
"status": "cancelled",
"order_id": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"receivedTime": "2020-07-22T13:26:20.806Z",
"orderEvents": [
{
"type": "CANCEL",
"uid": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"order": {
"orderId": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"cliOrdId": "1234568",
"type": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"quantity": 5500,
"filled": 0,
"limitPrice": 8000,
"reduceOnly": false,
"timestamp": "2020-07-22T13:25:56.366Z",
"lastUpdateTimestamp": "2020-07-22T13:25:56.366Z"
}
}
]
},
"serverTime": "2020-07-22T13:26:20.806Z"
}