Cancel a limit order (one or all)
Cancel a single order by id, or all of the owner’s orders on a market (all=true). A single cancel is a strict UpdateBookLimit op (fails if the order’s size changed since it was read); cancel-all is a ClearBook.
curl --request DELETE \
--url https://api.archer.exchange/v1/order/limit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"accountOwner": "<string>",
"all": false,
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"orderId": "<string>",
"platform": "self",
"signer": "<string>",
"unwrapSol": false,
"withInstructions": false,
"withdrawFreeFunds": false
}
'import requests
url = "https://api.archer.exchange/v1/order/limit"
payload = {
"accountOwner": "<string>",
"all": False,
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"orderId": "<string>",
"platform": "self",
"signer": "<string>",
"unwrapSol": False,
"withInstructions": False,
"withdrawFreeFunds": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountOwner: '<string>',
all: false,
market: 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
orderId: '<string>',
platform: 'self',
signer: '<string>',
unwrapSol: false,
withInstructions: false,
withdrawFreeFunds: false
})
};
fetch('https://api.archer.exchange/v1/order/limit', 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.archer.exchange/v1/order/limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'accountOwner' => '<string>',
'all' => false,
'market' => 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
'orderId' => '<string>',
'platform' => 'self',
'signer' => '<string>',
'unwrapSol' => false,
'withInstructions' => false,
'withdrawFreeFunds' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.archer.exchange/v1/order/limit"
payload := strings.NewReader("{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-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.delete("https://api.archer.exchange/v1/order/limit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/order/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}"
response = http.request(request)
puts response.read_body{
"addressLookupTables": [
"<string>"
],
"anchorMidTicks": 123,
"depositBaseLots": 123,
"depositQuoteLots": 123,
"expiresAt": 123,
"includesDeposit": true,
"nextSequenceNumber": 123,
"orderIds": [
"<string>"
],
"requiredBaseLots": 123,
"requiredQuoteLots": 123,
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
},
"price": "<string>",
"side": "buy",
"size": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}Authorizations
Body
Cancel one order by id, OR all of an owner's orders on a market (all=true with market+owner).
The wallet that owns the ArcherAccount this request acts through. With platform it derives the account PDA server-side — you never handle a PDA. Omit for a plain wallet-owned book. Replaces the earlier archerAccount field, which is no longer read.
Required when all=true.
"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4"
Cancel a single order by id.
Platform namespace for accountOwner. Ignored unless accountOwner is set.
self, treadfi The wallet that signs. Required when all is true. For a single order it is needed only when the order sits on an ArcherAccount-owned book (the account's owner or delegate); a wallet-owned order is signed by its maker. Existing clients may keep sending it as owner or authority; send one name only.
With withdrawFreeFunds, also append a WSOL CloseAccount so a native-SOL market unwraps to lamports. No-op on non-native markets.
Also return the unsigned instructions under instructions, for composing your own transaction instead of signing ours. Omitted or false leaves the response exactly as it was.
Cancel-one only. Append a MakerWithdrawFunds after the cancel so collateral freed by that order (computed exactly) returns to the owner's wallet in the same tx. Rejected with all=true — cancel-all only clears; withdraw via POST /v1/maker/withdraw.
Response
Unsigned transaction built.
Unsigned tx for the owner to sign, plus affected order ids, action targeting, and auto-funded collateral.
The book's mid anchor in ticks. Always 0 for limit-order books: a level's offset is its absolute price tick.
The maker-book sequence number this tx writes.
Total base lots the resulting book state requires as collateral (the program's update_book solvency check).
Total quote lots required, including the positive-maker-fee buffer.
Base64 unsigned VersionedTransaction in its wire encoding: a v0 message when the write fits 1232 bytes, otherwise a v1 (SIMD-0385) message, which a full maker registry needs. A v1 transaction must be sent base64-encoded and signed by a wallet that supports version 1.
Unsigned instructions, present only when the request set withInstructions.
Show child attributes
Show child attributes
Human price (quote per base) the order rests/rested at. Absent for cancel-all.
Side this action targets. Absent for cancel-all.
buy, sell Human base-token size the action targets — placed size (place), new size (modify), or canceled size (cancel-one). Absent for cancel-all.
curl --request DELETE \
--url https://api.archer.exchange/v1/order/limit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"accountOwner": "<string>",
"all": false,
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"orderId": "<string>",
"platform": "self",
"signer": "<string>",
"unwrapSol": false,
"withInstructions": false,
"withdrawFreeFunds": false
}
'import requests
url = "https://api.archer.exchange/v1/order/limit"
payload = {
"accountOwner": "<string>",
"all": False,
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"orderId": "<string>",
"platform": "self",
"signer": "<string>",
"unwrapSol": False,
"withInstructions": False,
"withdrawFreeFunds": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountOwner: '<string>',
all: false,
market: 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
orderId: '<string>',
platform: 'self',
signer: '<string>',
unwrapSol: false,
withInstructions: false,
withdrawFreeFunds: false
})
};
fetch('https://api.archer.exchange/v1/order/limit', 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.archer.exchange/v1/order/limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'accountOwner' => '<string>',
'all' => false,
'market' => 'u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4',
'orderId' => '<string>',
'platform' => 'self',
'signer' => '<string>',
'unwrapSol' => false,
'withInstructions' => false,
'withdrawFreeFunds' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.archer.exchange/v1/order/limit"
payload := strings.NewReader("{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-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.delete("https://api.archer.exchange/v1/order/limit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/order/limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountOwner\": \"<string>\",\n \"all\": false,\n \"market\": \"u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4\",\n \"orderId\": \"<string>\",\n \"platform\": \"self\",\n \"signer\": \"<string>\",\n \"unwrapSol\": false,\n \"withInstructions\": false,\n \"withdrawFreeFunds\": false\n}"
response = http.request(request)
puts response.read_body{
"addressLookupTables": [
"<string>"
],
"anchorMidTicks": 123,
"depositBaseLots": 123,
"depositQuoteLots": 123,
"expiresAt": 123,
"includesDeposit": true,
"nextSequenceNumber": 123,
"orderIds": [
"<string>"
],
"requiredBaseLots": 123,
"requiredQuoteLots": 123,
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
},
"price": "<string>",
"side": "buy",
"size": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}