Skip to main content

Cancel Order

Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options
Classic account covers: Spot / USDT perpetual / Inverse contract

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
  • Unified account: spot, linear, inverse, option
  • Classic account: spot, linear, inverse
symboltruestringSymbol name
orderIdfalsestringOrder ID. Either orderId or orderLinkId is required
orderLinkIdfalsestringUser customised order ID. Either orderId or orderLinkId is required
orderFilterfalsestringValid for spot only. Order,tpslOrder,StopOrder. If not passed, Order by default

Response Parameters

ParameterTypeComments
orderIdstringOrder ID
orderLinkIdstringUser customised order ID

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
}