Cancel and replace orders sequentially and non-atomically
curl --request POST \
--url https://api.limitless.exchange/orders/cancel-replace/batch \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"operations": [
{
"cancel": {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
},
"replacement": {
"order": {
"salt": "1778155025318314496",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"feeRateBps": 0,
"side": 0,
"signature": "0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b",
"signatureType": 2,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"price": 0.75
},
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "biden-vs-trump-2024",
"postOnly": true,
"clientOrderId": "client-order-001",
"timestamp": 1735689600000,
"recvWindow": 1500,
"stpPolicy": "cancel_maker"
},
"mode": "STOP_ON_FAILURE",
"onBehalfOf": 12345
}
]
}
'import requests
url = "https://api.limitless.exchange/orders/cancel-replace/batch"
payload = { "operations": [
{
"cancel": {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
},
"replacement": {
"order": {
"salt": "1778155025318314496",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"feeRateBps": 0,
"side": 0,
"signature": "0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b",
"signatureType": 2,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"price": 0.75
},
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "biden-vs-trump-2024",
"postOnly": True,
"clientOrderId": "client-order-001",
"timestamp": 1735689600000,
"recvWindow": 1500,
"stpPolicy": "cancel_maker"
},
"mode": "STOP_ON_FAILURE",
"onBehalfOf": 12345
}
] }
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({
operations: [
{
cancel: {
orderId: '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
clientOrderId: 'partner-order-001'
},
replacement: {
order: {
salt: '1778155025318314496',
maker: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
signer: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
tokenId: '19633204485790857949828516737993423758628930235371629943999544859324645414627',
makerAmount: 5000000,
takerAmount: 10000000,
nonce: 0,
feeRateBps: 0,
side: 0,
signature: '0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b',
signatureType: 2,
taker: '0x0000000000000000000000000000000000000000',
expiration: '0',
price: 0.75
},
ownerId: 12345,
orderType: 'GTC',
marketSlug: 'biden-vs-trump-2024',
postOnly: true,
clientOrderId: 'client-order-001',
timestamp: 1735689600000,
recvWindow: 1500,
stpPolicy: 'cancel_maker'
},
mode: 'STOP_ON_FAILURE',
onBehalfOf: 12345
}
]
})
};
fetch('https://api.limitless.exchange/orders/cancel-replace/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-replace/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([
'operations' => [
[
'cancel' => [
'orderId' => '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'clientOrderId' => 'partner-order-001'
],
'replacement' => [
'order' => [
'salt' => '1778155025318314496',
'maker' => '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'signer' => '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'tokenId' => '19633204485790857949828516737993423758628930235371629943999544859324645414627',
'makerAmount' => 5000000,
'takerAmount' => 10000000,
'nonce' => 0,
'feeRateBps' => 0,
'side' => 0,
'signature' => '0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b',
'signatureType' => 2,
'taker' => '0x0000000000000000000000000000000000000000',
'expiration' => '0',
'price' => 0.75
],
'ownerId' => 12345,
'orderType' => 'GTC',
'marketSlug' => 'biden-vs-trump-2024',
'postOnly' => true,
'clientOrderId' => 'client-order-001',
'timestamp' => 1735689600000,
'recvWindow' => 1500,
'stpPolicy' => 'cancel_maker'
],
'mode' => 'STOP_ON_FAILURE',
'onBehalfOf' => 12345
]
]
]),
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-replace/batch"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\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-replace/batch")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel-replace/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 \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"cancel": {
"status": "SUCCESS",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientOrderId": "<string>"
},
"replacement": {
"status": "SUCCESS",
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"salt": "1778155025318314496",
"maker": "<string>",
"signer": "<string>",
"tokenId": "<string>",
"signatureType": 0,
"signature": "<string>",
"orderType": "GTC",
"side": 0,
"marketId": "<string>",
"ownerId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"market": {
"id": 7348,
"slug": "btc-up-or-down-1-hour",
"title": "BTC Up or Down - Hourly",
"status": "FUNDED",
"yesPositionId": "11514974713064423461...",
"noPositionId": "14525308260861904048...",
"group": {
"id": 42,
"slug": "btc-price-markets",
"title": "BTC Price Markets"
}
},
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"rankName": "<string>",
"points": 123,
"referredUsersCount": 123,
"isTop100": true,
"leaderboardPosition": 123
},
"taker": "<string>",
"expiration": "2023-11-07T05:31:56Z",
"feeRateBps": 123,
"price": 0.75
},
"execution": {
"matched": true,
"settlementStatus": "MINED",
"feeRateBps": 25,
"effectiveFeeBps": 26,
"totalsRaw": {
"contractsGross": "1000000",
"contractsFee": "1000",
"contractsNet": "999000",
"usdGross": "500000",
"usdFee": "500",
"usdNet": "499500"
},
"reason": "settlement transaction reverted",
"eligibleAt": "2026-06-08T10:15:30.000Z",
"tradeEventId": "4aa706dd-6c57-4f3c-945a-99818dfd95f1",
"txHash": "0xabc123",
"clientOrderId": "client-order-001",
"stpMakerCancels": [
"4aa706dd-6c57-4f3c-945a-99818dfd95f1"
]
},
"makerMatches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"matchedSize": "1000000",
"fillPrice": "0.55",
"fillCost": "550000",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maker": "<string>",
"price": "0.55",
"side": 0,
"tokenId": "<string>",
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"points": 0,
"referredUsersCount": 0
}
}
}
]
}
},
"index": 1
}
]
}{
"results": [
{
"cancel": {
"status": "SUCCESS",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientOrderId": "<string>"
},
"replacement": {
"status": "SUCCESS",
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"salt": "1778155025318314496",
"maker": "<string>",
"signer": "<string>",
"tokenId": "<string>",
"signatureType": 0,
"signature": "<string>",
"orderType": "GTC",
"side": 0,
"marketId": "<string>",
"ownerId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"market": {
"id": 7348,
"slug": "btc-up-or-down-1-hour",
"title": "BTC Up or Down - Hourly",
"status": "FUNDED",
"yesPositionId": "11514974713064423461...",
"noPositionId": "14525308260861904048...",
"group": {
"id": 42,
"slug": "btc-price-markets",
"title": "BTC Price Markets"
}
},
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"rankName": "<string>",
"points": 123,
"referredUsersCount": 123,
"isTop100": true,
"leaderboardPosition": 123
},
"taker": "<string>",
"expiration": "2023-11-07T05:31:56Z",
"feeRateBps": 123,
"price": 0.75
},
"execution": {
"matched": true,
"settlementStatus": "MINED",
"feeRateBps": 25,
"effectiveFeeBps": 26,
"totalsRaw": {
"contractsGross": "1000000",
"contractsFee": "1000",
"contractsNet": "999000",
"usdGross": "500000",
"usdFee": "500",
"usdNet": "499500"
},
"reason": "settlement transaction reverted",
"eligibleAt": "2026-06-08T10:15:30.000Z",
"tradeEventId": "4aa706dd-6c57-4f3c-945a-99818dfd95f1",
"txHash": "0xabc123",
"clientOrderId": "client-order-001",
"stpMakerCancels": [
"4aa706dd-6c57-4f3c-945a-99818dfd95f1"
]
},
"makerMatches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"matchedSize": "1000000",
"fillPrice": "0.55",
"fillCost": "550000",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maker": "<string>",
"price": "0.55",
"side": 0,
"tokenId": "<string>",
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"points": 0,
"referredUsersCount": 0
}
}
}
]
}
},
"index": 1
}
]
}{
"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
}{
"message": "<string>"
}{
"message": "<string>"
}Trading
Cancel and Replace Orders (Batch)
POST
/
orders
/
cancel-replace
/
batch
Cancel and replace orders sequentially and non-atomically
curl --request POST \
--url https://api.limitless.exchange/orders/cancel-replace/batch \
--header 'Content-Type: application/json' \
--header 'lmts-api-key: <api-key>' \
--data '
{
"operations": [
{
"cancel": {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
},
"replacement": {
"order": {
"salt": "1778155025318314496",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"feeRateBps": 0,
"side": 0,
"signature": "0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b",
"signatureType": 2,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"price": 0.75
},
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "biden-vs-trump-2024",
"postOnly": true,
"clientOrderId": "client-order-001",
"timestamp": 1735689600000,
"recvWindow": 1500,
"stpPolicy": "cancel_maker"
},
"mode": "STOP_ON_FAILURE",
"onBehalfOf": 12345
}
]
}
'import requests
url = "https://api.limitless.exchange/orders/cancel-replace/batch"
payload = { "operations": [
{
"cancel": {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203",
"clientOrderId": "partner-order-001"
},
"replacement": {
"order": {
"salt": "1778155025318314496",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"feeRateBps": 0,
"side": 0,
"signature": "0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b",
"signatureType": 2,
"taker": "0x0000000000000000000000000000000000000000",
"expiration": "0",
"price": 0.75
},
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "biden-vs-trump-2024",
"postOnly": True,
"clientOrderId": "client-order-001",
"timestamp": 1735689600000,
"recvWindow": 1500,
"stpPolicy": "cancel_maker"
},
"mode": "STOP_ON_FAILURE",
"onBehalfOf": 12345
}
] }
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({
operations: [
{
cancel: {
orderId: '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
clientOrderId: 'partner-order-001'
},
replacement: {
order: {
salt: '1778155025318314496',
maker: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
signer: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
tokenId: '19633204485790857949828516737993423758628930235371629943999544859324645414627',
makerAmount: 5000000,
takerAmount: 10000000,
nonce: 0,
feeRateBps: 0,
side: 0,
signature: '0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b',
signatureType: 2,
taker: '0x0000000000000000000000000000000000000000',
expiration: '0',
price: 0.75
},
ownerId: 12345,
orderType: 'GTC',
marketSlug: 'biden-vs-trump-2024',
postOnly: true,
clientOrderId: 'client-order-001',
timestamp: 1735689600000,
recvWindow: 1500,
stpPolicy: 'cancel_maker'
},
mode: 'STOP_ON_FAILURE',
onBehalfOf: 12345
}
]
})
};
fetch('https://api.limitless.exchange/orders/cancel-replace/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-replace/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([
'operations' => [
[
'cancel' => [
'orderId' => '6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203',
'clientOrderId' => 'partner-order-001'
],
'replacement' => [
'order' => [
'salt' => '1778155025318314496',
'maker' => '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'signer' => '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'tokenId' => '19633204485790857949828516737993423758628930235371629943999544859324645414627',
'makerAmount' => 5000000,
'takerAmount' => 10000000,
'nonce' => 0,
'feeRateBps' => 0,
'side' => 0,
'signature' => '0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b',
'signatureType' => 2,
'taker' => '0x0000000000000000000000000000000000000000',
'expiration' => '0',
'price' => 0.75
],
'ownerId' => 12345,
'orderType' => 'GTC',
'marketSlug' => 'biden-vs-trump-2024',
'postOnly' => true,
'clientOrderId' => 'client-order-001',
'timestamp' => 1735689600000,
'recvWindow' => 1500,
'stpPolicy' => 'cancel_maker'
],
'mode' => 'STOP_ON_FAILURE',
'onBehalfOf' => 12345
]
]
]),
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-replace/batch"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\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-replace/batch")
.header("lmts-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.limitless.exchange/orders/cancel-replace/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 \"operations\": [\n {\n \"cancel\": {\n \"orderId\": \"6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203\",\n \"clientOrderId\": \"partner-order-001\"\n },\n \"replacement\": {\n \"order\": {\n \"salt\": \"1778155025318314496\",\n \"maker\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"signer\": \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\",\n \"tokenId\": \"19633204485790857949828516737993423758628930235371629943999544859324645414627\",\n \"makerAmount\": 5000000,\n \"takerAmount\": 10000000,\n \"nonce\": 0,\n \"feeRateBps\": 0,\n \"side\": 0,\n \"signature\": \"0x6e3a3f2c2c2bb1ce3a14c4f5e4ad6f3c8b1ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d4a36cc4ad9c44d4d5fa1c4cd5b6e74a4d41b\",\n \"signatureType\": 2,\n \"taker\": \"0x0000000000000000000000000000000000000000\",\n \"expiration\": \"0\",\n \"price\": 0.75\n },\n \"ownerId\": 12345,\n \"orderType\": \"GTC\",\n \"marketSlug\": \"biden-vs-trump-2024\",\n \"postOnly\": true,\n \"clientOrderId\": \"client-order-001\",\n \"timestamp\": 1735689600000,\n \"recvWindow\": 1500,\n \"stpPolicy\": \"cancel_maker\"\n },\n \"mode\": \"STOP_ON_FAILURE\",\n \"onBehalfOf\": 12345\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"cancel": {
"status": "SUCCESS",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientOrderId": "<string>"
},
"replacement": {
"status": "SUCCESS",
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"salt": "1778155025318314496",
"maker": "<string>",
"signer": "<string>",
"tokenId": "<string>",
"signatureType": 0,
"signature": "<string>",
"orderType": "GTC",
"side": 0,
"marketId": "<string>",
"ownerId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"market": {
"id": 7348,
"slug": "btc-up-or-down-1-hour",
"title": "BTC Up or Down - Hourly",
"status": "FUNDED",
"yesPositionId": "11514974713064423461...",
"noPositionId": "14525308260861904048...",
"group": {
"id": 42,
"slug": "btc-price-markets",
"title": "BTC Price Markets"
}
},
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"rankName": "<string>",
"points": 123,
"referredUsersCount": 123,
"isTop100": true,
"leaderboardPosition": 123
},
"taker": "<string>",
"expiration": "2023-11-07T05:31:56Z",
"feeRateBps": 123,
"price": 0.75
},
"execution": {
"matched": true,
"settlementStatus": "MINED",
"feeRateBps": 25,
"effectiveFeeBps": 26,
"totalsRaw": {
"contractsGross": "1000000",
"contractsFee": "1000",
"contractsNet": "999000",
"usdGross": "500000",
"usdFee": "500",
"usdNet": "499500"
},
"reason": "settlement transaction reverted",
"eligibleAt": "2026-06-08T10:15:30.000Z",
"tradeEventId": "4aa706dd-6c57-4f3c-945a-99818dfd95f1",
"txHash": "0xabc123",
"clientOrderId": "client-order-001",
"stpMakerCancels": [
"4aa706dd-6c57-4f3c-945a-99818dfd95f1"
]
},
"makerMatches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"matchedSize": "1000000",
"fillPrice": "0.55",
"fillCost": "550000",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maker": "<string>",
"price": "0.55",
"side": 0,
"tokenId": "<string>",
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"points": 0,
"referredUsersCount": 0
}
}
}
]
}
},
"index": 1
}
]
}{
"results": [
{
"cancel": {
"status": "SUCCESS",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clientOrderId": "<string>"
},
"replacement": {
"status": "SUCCESS",
"data": {
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"salt": "1778155025318314496",
"maker": "<string>",
"signer": "<string>",
"tokenId": "<string>",
"signatureType": 0,
"signature": "<string>",
"orderType": "GTC",
"side": 0,
"marketId": "<string>",
"ownerId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"market": {
"id": 7348,
"slug": "btc-up-or-down-1-hour",
"title": "BTC Up or Down - Hourly",
"status": "FUNDED",
"yesPositionId": "11514974713064423461...",
"noPositionId": "14525308260861904048...",
"group": {
"id": 42,
"slug": "btc-price-markets",
"title": "BTC Price Markets"
}
},
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"rankName": "<string>",
"points": 123,
"referredUsersCount": 123,
"isTop100": true,
"leaderboardPosition": 123
},
"taker": "<string>",
"expiration": "2023-11-07T05:31:56Z",
"feeRateBps": 123,
"price": 0.75
},
"execution": {
"matched": true,
"settlementStatus": "MINED",
"feeRateBps": 25,
"effectiveFeeBps": 26,
"totalsRaw": {
"contractsGross": "1000000",
"contractsFee": "1000",
"contractsNet": "999000",
"usdGross": "500000",
"usdFee": "500",
"usdNet": "499500"
},
"reason": "settlement transaction reverted",
"eligibleAt": "2026-06-08T10:15:30.000Z",
"tradeEventId": "4aa706dd-6c57-4f3c-945a-99818dfd95f1",
"txHash": "0xabc123",
"clientOrderId": "client-order-001",
"stpMakerCancels": [
"4aa706dd-6c57-4f3c-945a-99818dfd95f1"
]
},
"makerMatches": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"matchedSize": "1000000",
"fillPrice": "0.55",
"fillCost": "550000",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"maker": "<string>",
"price": "0.55",
"side": 0,
"tokenId": "<string>",
"owner": {
"id": 123,
"account": "<string>",
"client": "<string>",
"tradeWalletOption": "eoa",
"smartWallet": "<string>",
"username": "<string>",
"displayName": "<string>",
"pfpUrl": "<string>",
"socialUrl": "<string>",
"points": 0,
"referredUsersCount": 0
}
}
}
]
}
},
"index": 1
}
]
}{
"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
}{
"message": "<string>"
}{
"message": "<string>"
}Submit multiple cancel-and-replace operations in one request. Each executed operation has the same non-atomic behavior as
The order values below illustrate the request shape. Generate each
POST /orders/cancel-replace, and one operation result does not stop later operations.
Request
Sendoperations as an array of 1 to 4 cancel-and-replace operations. Each item contains cancel, replacement, mode, and optional onBehalfOf fields as described in the single-operation reference.
Use HMAC authentication with the trading scope and sign the exact JSON body with the path /orders/cancel-replace/batch. Each signed replacement remains a normal EIP-712 order; delegated body onBehalfOf operations follow the same authorized-owner and delegated-signing rules. The x-on-behalf-of header is not supported.
A request-level validation, authorization, market, signature, maintenance-mode, or receive-window error rejects the batch without a
results array; maintenance-mode and receive-window failures return 425 Too Early. Duplicate cancellation targets and duplicate normalized replacement clientOrderId values also reject the entire request. Accepted operations then report independent cancellation and replacement outcomes.order.signature from its complete replacement payload instead of copying the placeholder signatures.
{
"operations": [
{
"cancel": {
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203"
},
"replacement": {
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "btc-100k",
"clientOrderId": "replacement-101",
"order": {
"salt": "1778155025318314496",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5000000,
"takerAmount": 10000000,
"nonce": 0,
"price": 0.5,
"feeRateBps": 0,
"side": 0,
"signature": "0x1234",
"signatureType": 0
}
},
"mode": "STOP_ON_FAILURE"
},
{
"cancel": {
"clientOrderId": "missing-order-102"
},
"replacement": {
"ownerId": 12345,
"orderType": "GTC",
"marketSlug": "btc-100k",
"clientOrderId": "replacement-102",
"order": {
"salt": "1778155025318314497",
"maker": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"signer": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"taker": "0x0000000000000000000000000000000000000000",
"tokenId": "19633204485790857949828516737993423758628930235371629943999544859324645414627",
"makerAmount": 5500000,
"takerAmount": 10000000,
"nonce": 0,
"price": 0.55,
"feeRateBps": 0,
"side": 0,
"signature": "0x5678",
"signatureType": 0
}
},
"mode": "ALLOW_FAILURE"
}
]
}
Ordering and partial failures
Accepted operations execute sequentially and the response preserves request order: every result has the zero-basedindex of its input operation. Operations produce independent outcomes, so inspect both cancel and replacement for every index rather than treating the HTTP status as an item-level result. A failed operation does not stop later operations.
If all items have top-level cancel.status: "SUCCESS" and replacement.status: "SUCCESS", the endpoint returns 200 OK. If any item has another top-level status, it returns 207 Multi-Status with every result, including successful items.
{
"results": [
{
"index": 0,
"cancel": {
"status": "SUCCESS",
"orderId": "6f52b6d2-6c9e-4a5c-8a4f-28ab4b7ff203"
},
"replacement": {
"status": "FAILURE",
"error": {
"code": "425",
"message": "order receive window expired: elapsed=2500ms, window=1500ms"
}
}
},
{
"index": 1,
"cancel": {
"status": "FAILURE",
"error": {
"code": "ORDER_NOT_FOUND",
"message": "Order not found"
}
},
"replacement": {
"status": "FAILURE",
"error": {
"code": "400",
"message": "Insufficient balance"
}
}
}
]
}
STOP_ON_FAILURE produces NOT_ATTEMPTED only for the affected operation. ALLOW_FAILURE still attempts that operation’s replacement. Cancellation and replacement outcomes can also be UNKNOWN when the final result cannot be determined.
Insufficient balance or allowance can produce a successful cancellation with an item-level replacement FAILURE and an HTTP-status error code such as "400". The batch continues and returns 207 Multi-Status with all results.
A receive-window or trading-availability rejection can likewise produce a successful cancellation with an item-level replacement FAILURE and error.code: "425".
Operation error codes are strings, not a closed enum. A missing cancellation target uses ORDER_NOT_FOUND; request failures use decimal HTTP status strings such as 400, 404, 409, 425, or 500; other failures use INTERNAL_ERROR. FAILURE identifies a known failure and UNKNOWN an inconclusive outcome. Cancellation authorization failures remain request-level 401 or 403 responses.
Request-level errors use their ordinary HTTP status instead of 207 Multi-Status. A 207 is returned when at least one operation has a non-success top-level result.
HTTP
200 versus 207 follows the top-level cancellation and placement statuses. An accepted replacement stays top-level SUCCESS even if its nested execution.settlementStatus is FAILED; the nested reason carries the settlement failure.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.
Body
application/json
Independent cancel-and-replace operations
Required array length:
1 - 4 elementsShow child attributes
Show child attributes
Response
Every operation succeeded
Outcomes in input order. Each item includes its zero-based input index.
Show child attributes
Show child attributes