Cancel Order
curl --request DELETE \
--url https://api.limitless.exchange/orders/{orderId} \
--header 'lmts-api-key: <api-key>'import requests
url = "https://api.limitless.exchange/orders/{orderId}"
headers = {"lmts-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'lmts-api-key': '<api-key>'}};
fetch('https://api.limitless.exchange/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.limitless.exchange/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"lmts-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/orders/{orderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("lmts-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.limitless.exchange/orders/{orderId}")
.header("lmts-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["lmts-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Order canceled successfully"
}{
"message": [
{
"field": "orderIds",
"message": "orderIds should not be empty"
}
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "<string>",
"error": "<string>",
"statusCode": 123
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>",
"statusCode": 123
}{
"code": "trading_disabled",
"message": "Trading is currently disabled.",
"mode": "disabled",
"resumeAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}Trading
Cancel Order
Cancel an open order and return locked funds
DELETE
/
orders
/
{orderId}
Cancel Order
curl --request DELETE \
--url https://api.limitless.exchange/orders/{orderId} \
--header 'lmts-api-key: <api-key>'import requests
url = "https://api.limitless.exchange/orders/{orderId}"
headers = {"lmts-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'lmts-api-key': '<api-key>'}};
fetch('https://api.limitless.exchange/orders/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.limitless.exchange/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"lmts-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/orders/{orderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("lmts-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.limitless.exchange/orders/{orderId}")
.header("lmts-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["lmts-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Order canceled successfully"
}{
"message": [
{
"field": "orderIds",
"message": "orderIds should not be empty"
}
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "<string>",
"error": "<string>",
"statusCode": 123
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>",
"statusCode": 123
}{
"code": "trading_disabled",
"message": "Trading is currently disabled.",
"mode": "disabled",
"resumeAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}This endpoint cancels by internal
orderId. To cancel by either orderId or clientOrderId, use Cancel Order (Combined).To cancel multiple orders at once, use Batch Cancel Orders (Combined), Cancel Orders (Batch), or Cancel All.
Cancellations remain available in
cancel_only and post_only, but return 425 Too Early with code: "trading_disabled" when trading mode is disabled.Authentication and delegation
Use a scoped API token with HMAC signing and thetrading scope. To cancel for a partner sub-account, add ?onBehalfOf=<subProfileId>; the target must belong to the authenticated partner and the token must also have delegated_signing. Include the query string in the HMAC-signed path.
Cancellation behavior
A delayed order can be cancelled before execution, including a delayed FAK or FOK order. That path returnsDelayed order canceled successfully. Immediate FAK/FOK orders are generally terminal and no longer cancellable.
The endpoint distinguishes:
404 Order not foundwhen the internal ID does not exist;401 Unauthorizedwhen the order belongs to another profile;400 Market has already been resolvedfor a resolved market; and400 Order not found or already canceledwhen the order can no longer be cancelled.
Authorizations
Scoped API token with HMAC-SHA256 signing. Requires three headers: lmts-api-key (token ID), lmts-timestamp (ISO-8601), lmts-signature (Base64-encoded HMAC). See Authentication docs for details.
Path Parameters
Unique identifier of the order to be cancelled
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Example:
"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203"
Query Parameters
Partner sub-account profile ID. Requires delegated_signing in addition to trading.
Required range:
x >= 1Example:
326
Response
Order successfully cancelled
Confirmation message for the cancelled order
Available options:
Order canceled successfully, Delayed order canceled successfully Example:
"Order canceled successfully"