Cancel order

Cancel an order. (Private ๐Ÿ”’)

This endpoint is used to cancel a limit order which hasnโ€™t already been executed at a given time. Please note that this is a Private ๐Ÿ”’ route which means it needs to be authorised by the account initiating this request.

Note: You will need to include the JWT Auth token to request headers to access this endpoint. To get the JWT Auth Token, refer the login section of the documentation.

Endpoint

POST /sapi/v1/orders/cancel/

Request Headers

{
  "Authorization": "JWT ***"
}

Request Body

FieldTypeMandatory

order_id

INTEGER

YES

Example

{
  "order_id": 3
}

Response

{
    "status": "success",
    "message": "Order is successfully queued for cancellation",
    "payload": {
        "id": 25768879,
        "uuid": "17be02d1-34ef-49df-9b92-264705047d99",
        "side": "buy",
        "ord_type": "limit",
        "price": "68733.81",
        "stop_price": null,
        "avg_price": "68733.81",
        "state": "wait",
        "market": "btcusdc",
        "created_at": "2024-05-31T09:02:00+02:00",
        "updated_at": "2024-05-31T09:02:03+02:00",
        "origin_volume": "0.0425",
        "remaining_volume": "0.0335",
        "executed_volume": "0.009000000000000001",
        "maker_fee": "0.0004",
        "taker_fee": "0.0004",
        "trades_count": 2,
        "cancel_reason": null
    }
}

Possible Cancel Reasons:

You may receive the following cancel reasons in the response:

  • 'Order cancelled by user': The user requested to cancel the order directly, or through a bulk cancel request.

  • โ€˜Slippage greater than 30%. Order cancelled to prevent loss of fundsโ€™: The order was cancelled because its price changed by more than 30% from the time it was placed to the time it was matched.

  • โ€˜Order cancellation was initiated by systemโ€™: The order was cancelled for reasons such as order expiration, slippage exceeding a specified threshold, inconsistent order matching, or detection of suspicious activity. However, cancellations due to these reasons are infrequent.

  • โ€˜Something went wrong, order was cancelled to prevent loss of fundsโ€™: The order was cancelled because it didn't meet the matching criteria due to unexpected reasons.

Last updated