Cancel multiple orders in batch
curl --request POST \
--url https://api.limitless.exchange/orders/cancel-batch \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"orderIds": [
"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"9e31c452-8a2b-42d1-b327-65f18d07dc96"
]
}
'import requests
url = "https://api.limitless.exchange/orders/cancel-batch"
payload = { "orderIds": ["6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203", "9e31c452-8a2b-42d1-b327-65f18d07dc96"] }
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({
orderIds: ['6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203', '9e31c452-8a2b-42d1-b327-65f18d07dc96']
})
};
fetch('https://api.limitless.exchange/orders/cancel-batch', 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-batch",
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([
'orderIds' => [
'6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'9e31c452-8a2b-42d1-b327-65f18d07dc96'
]
]),
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-batch"
payload := strings.NewReader("{\n \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\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-batch")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel-batch")
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 \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Orders canceled successfully",
"canceled": [
"611badac-8dfc-48a0-b09e-59654adea1c5"
],
"failed": [
{
"orderId": "b53f0e4b-1529-45cc-ad39-e27f4c6eab5a",
"reason": "ORDER_NOT_FOUND",
"message": "Order not found or already canceled"
}
]
}{
"message": "Orders canceled successfully",
"canceled": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"failed": [
{
"orderId": "b53f0e4b-1529-45cc-ad39-e27f4c6eab5a",
"reason": "ORDER_NOT_FOUND",
"message": "Order not found or already canceled"
}
]
}{
"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 Orders (Batch)
POST
/
orders
/
cancel-batch
Cancel multiple orders in batch
curl --request POST \
--url https://api.limitless.exchange/orders/cancel-batch \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"orderIds": [
"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"9e31c452-8a2b-42d1-b327-65f18d07dc96"
]
}
'import requests
url = "https://api.limitless.exchange/orders/cancel-batch"
payload = { "orderIds": ["6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203", "9e31c452-8a2b-42d1-b327-65f18d07dc96"] }
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({
orderIds: ['6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203', '9e31c452-8a2b-42d1-b327-65f18d07dc96']
})
};
fetch('https://api.limitless.exchange/orders/cancel-batch', 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-batch",
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([
'orderIds' => [
'6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'9e31c452-8a2b-42d1-b327-65f18d07dc96'
]
]),
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-batch"
payload := strings.NewReader("{\n \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\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-batch")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel-batch")
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 \"orderIds\": [\n \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"9e31c452-8a2b-42d1-b327-65f18d07dc96\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Orders canceled successfully",
"canceled": [
"611badac-8dfc-48a0-b09e-59654adea1c5"
],
"failed": [
{
"orderId": "b53f0e4b-1529-45cc-ad39-e27f4c6eab5a",
"reason": "ORDER_NOT_FOUND",
"message": "Order not found or already canceled"
}
]
}{
"message": "Orders canceled successfully",
"canceled": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"failed": [
{
"orderId": "b53f0e4b-1529-45cc-ad39-e27f4c6eab5a",
"reason": "ORDER_NOT_FOUND",
"message": "Order not found or already canceled"
}
]
}{
"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 multiple orders by internal
orderIds only. Send { "orderIds": [...] } with at least one UUIDv4 order ID. This legacy endpoint has no documented maximum batch size, but all orders that resolve must belong to one market.
To cancel by either
orderIds or clientOrderIds, use Batch Cancel Orders (Combined).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.
Results
200 OKreturns the cancelled order IDs.207 Multi-Statusreturns bothcanceledand normalizedfailedrecords.400 Bad RequestwithFailed to cancel any ordersmeans every attempted cancellation failed.404 Orders not foundmeans none of the supplied IDs resolved.
ORDER_NOT_FOUND with Order not found or already canceled, or UNKNOWN_ERROR with Failed to cancel order. Cancellation remains available in normal, post_only, and cancel_only; disabled returns 425 Too Early.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
Array of order IDs to be cancelled in a single batch operation
Minimum array length:
1Pattern:
^[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",
"9e31c452-8a2b-42d1-b327-65f18d07dc96"
]
Response
All orders successfully cancelled
Confirmation message for the cancelled orders
Example:
"Orders canceled successfully"
Array of successfully cancelled order IDs
Example:
["611badac-8dfc-48a0-b09e-59654adea1c5"]
Array of orders that failed to cancel with reasons
Show child attributes
Show child attributes