Skip to main content

Cancel Orders

Cancel a single open order by id, or cancel several open orders in one request.

warning

For all transactions related to the private endpoint, you must authorize before sending your request.

For more information you can check our Authentication V1 article. Both endpoints require the Trade API key permission.

A 200 OK response means the cancellation was accepted for processing, not necessarily finalized. An authenticated WebSocket connection receives an order-cancelled message (type 452) once it is applied; without one, poll Get Single Order or All Orders to confirm the final status.

Cancel Order​

DELETE /api/v1/order/{id}

Path Parameters​

NameTypeDescription
id*longid of the order

Headers​

NameTypeDescription
X-PCK*stringAPI public key.
X-Stamp*integerCurrent time in milliseconds since the Unix epoch (UTC).
X-Signature*stringHMAC-SHA256 signature. See Authentication V1.
X-NonceintegerOptional. Backward tolerance for X-Stamp in milliseconds. Default 5000, maximum 60000.

Request example:​

  • /api/v1/order/123456789
{"success": true, "message": "SUCCESS", "code": 0}

Cancel Multiple Orders​

DELETE /api/v1/order

Cancels every order id listed in the request body. Orders are cancelled one by one, not atomically — some ids can succeed while others fail.

Request Body​

NameTypeDescription
id*long[]Order ids to cancel. Must contain at least one id.
{ "id": [123456789, 123456790, 123456791] }
info

Read success before uncancelledOrders. A partial failure still returns 200 OK with success: false and one entry in uncancelledOrders per id that could not be cancelled. success is true only when every id was cancelled, in which case uncancelledOrders is an empty array.

{
"success": true,
"message": null,
"code": 0,
"data": {
"uncancelledOrders": []
}
}

A missing body, an empty id array, or id: null all return the 400 above.

Code Example​

# Cancel a single order
curl -X DELETE "https://api.global.btcturk.com/api/v1/order/123456789" \
-H "X-PCK: YOUR_API_PUBLIC_KEY" \
-H "X-Stamp: 1735866257711" \
-H "X-Signature: COMPUTED_SIGNATURE"

# Cancel several orders
curl -X DELETE "https://api.global.btcturk.com/api/v1/order" \
-H "X-PCK: YOUR_API_PUBLIC_KEY" \
-H "X-Stamp: 1735866257711" \
-H "X-Signature: COMPUTED_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{ "id": [123456789, 123456790] }'