Skip to main content

Order Cancellation

Cancel an Order

DEL /v1/api/order

This endpoint will attempt to cancel an existing order on the exchange.

Headers

Header FieldTypeComments
credentials_secretJWTCreated by user for validation

Request Body

Passed in the query string

NameTypeComments
order_idstringOptional Exchange order id (if known)
client_order_idstringUnique Order Id generated by the client

Responses

Cancellation Successful

{
"cancel_order_response": {
"tradeable_entity_id": "6",
"symbol": "PTF-USD",
"order_id": "9553031",
"client_order_id": "cA1NP44bPggQuhuvxXqR_",
"timestamp": "1670247099990633",
"reason": "user_cancelled"
}
}

Cancellation Failed

{
"cancel_order_response": {
"order_id": "123",
"client_order_id": "",
"timestamp": "1670247419802790",
"reason": "exchange order_id or client_order_id not found in order cache"
}
}
{
"error": {
"error_code": "16",
"message": "optional exchange order_id must be numeric"
}
}

Cancel All Orders

DEL /v1/api/allOrders

This endpoint will attempt to cancel all users orders.

Headers

Header FieldTypeComments
credentials_secretJWTCreated by user for validation

Response

Cancellation Successful

{
"cancel_all_orders_response": {
"timestamp": "1670247472793568",
"reason": "success"
}
}

Cancellation Failure

{
"cancel_all_orders_response": {
"timestamp": "1670247474858170",
"reason": "failed no open orders found"
}
}

If you have an open WebSocket connection, you will receive individual order cancelled messages there.