Skip to main content

Cancel Order

important
  • You must specify orderId or orderLinkId to cancel the order.
  • If orderId and orderLinkId do not match, the system will process orderId first.
  • You can only cancel unfilled or partially filled orders.

HTTP Request

POST /v5/order/cancel

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear, inverse, spot, option
  • classic account: linear, inverse, spot
symboltruestringSymbol name, like BTCUSDT, uppercase only
orderIdfalsestringOrder ID. Either orderId or orderLinkId is required
orderLinkIdfalsestringUser customised order ID. Either orderId or orderLinkId is required
orderFilterfalsestringSpot trading only
  • Order
  • tpslOrder
  • StopOrder
  • If not passed, Order by default

    Response Parameters

    ParameterTypeComments
    orderIdstringOrder ID
    orderLinkIdstringUser customised order ID
    info

    The ack of cancel order request indicates that the request is successfully accepted. Please use websocket order stream to confirm the order status


    Request Example

    POST /v5/order/cancel HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: XXXXX
    X-BAPI-TIMESTAMP: 1672217376681
    X-BAPI-RECV-WINDOW: 5000
    Content-Type: application/json

    {
    "category": "linear",
    "symbol": "BTCPERP",
    "orderLinkId": null,
    "orderId":"c6f055d9-7f21-4079-913d-e6523a9cfffa"
    }

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "orderId": "c6f055d9-7f21-4079-913d-e6523a9cfffa",
    "orderLinkId": "linear-004"
    },
    "retExtInfo": {},
    "time": 1672217377164
    }