Cancel Order
curl --request POST \
--url https://api.limitless.exchange/orders/cancel \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
}
'import requests
url = "https://api.limitless.exchange/orders/cancel"
payload = {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
}
headers = {
"lmts-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'lmts-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
clientOrderId: 'partner-order-001'
})
};
fetch('https://api.limitless.exchange/orders/cancel', 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/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'clientOrderId' => 'partner-order-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/orders/cancel"
payload := strings.NewReader("{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("lmts-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.limitless.exchange/orders/cancel")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["lmts-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}"
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 (Combined)
Cancel an open order by either internal orderId or client-provided clientOrderId.
POST
/
orders
/
cancel
Cancel Order
curl --request POST \
--url https://api.limitless.exchange/orders/cancel \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
}
'import requests
url = "https://api.limitless.exchange/orders/cancel"
payload = {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
}
headers = {
"lmts-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'lmts-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
clientOrderId: 'partner-order-001'
})
};
fetch('https://api.limitless.exchange/orders/cancel', 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/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'clientOrderId' => 'partner-order-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.limitless.exchange/orders/cancel"
payload := strings.NewReader("{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("lmts-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.limitless.exchange/orders/cancel")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["lmts-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n}"
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>"
}Cancel one order by either the internal
This on-behalf-of path additionally requires the
orderId or the clientOrderId supplied when creating the order.
Provide exactly one identifier. Requests with both identifiers or neither identifier return 400 Bad Request.
DELETE /orders/{orderId} remains supported for existing integrations that cancel only by internal order ID.Authentication
Cancelling is not EIP-712 signed. Unlike placing an order, you do not include asignature in the request. Cancellation is an off-chain operation that removes the order from the book.
Use a scoped API token with HMAC signing and the trading scope. No additional scope is needed to cancel your own orders.
Cancelling a sub-account’s orders (partner flow)
If you placed an order withonBehalfOf (so it is owned by a managed sub-account, not your partner profile), cancel it through your partner token with the onBehalfOf query parameter:
POST /orders/cancel?onBehalfOf=<subProfileId>
delegated_signing scope on your partner token. The scope is reused as the authorization gate for acting on a sub-account. It does not mean the order must be server-signed, and it works for EOA sub-accounts that signed their own orders. See Delegated Signing.
The HMAC signature must be computed over the full path including the query string, so sign
/orders/cancel?onBehalfOf=42, not /orders/cancel. See Authentication.Cancellation behavior
- A cancellation can remove a delayed order before execution. This returns
Delayed order canceled successfully. - FAK and FOK orders can be delayed on markets with taker delay. Immediate FAK/FOK orders are generally terminal and no longer cancellable.
- An order that can no longer be cancelled returns
400 Bad RequestwithOrder not found or already canceled.
Error distinctions
| Status | Meaning |
|---|---|
400 | Invalid request, resolved market, or an order that can no longer be cancelled. |
401 | Authentication failed, or the resolved order is owned by another profile. |
403 | The HMAC token lacks trading, or delegated cancellation is not permitted. |
404 | No order resolves from the supplied internal or client order ID. |
425 | Trading mode is disabled. Cancellation remains available in normal, post_only, and cancel_only. |
500 | An unexpected cancellation failure occurred. |
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.
Query Parameters
Partner sub-account profile ID. Requires delegated_signing in addition to trading.
Required range:
x >= 1Example:
326
Body
application/json
- Option 1
- Option 2
Internal order ID. Provide exactly one of orderId or clientOrderId.
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"
Client-provided order ID from order creation. Provide exactly one of orderId or clientOrderId.
Maximum string length:
128Example:
"partner-order-001"
Response
Order successfully cancelled
Confirmation message for the cancelled order
Available options:
Order canceled successfully, Delayed order canceled successfully Example:
"Order canceled successfully"