Modify a limit order
Resize keeps the order id; a price change is cancel+place and yields a new id. Built as strict level ops on the owner’s book (UpdateBookLimit): the tx fails if the order’s resting size changed since it was read — refetch and retry.
Spread guard (post-only): unless crossSpread is true, a modify that grows a level — a reprice, or a size increase — at/above the best registered ask (buy) or at/below the best registered bid (sell) is rejected with CROSSES_SPREAD, as the program does on-chain. Shrinking an order never crosses, so a size-only decrease is always allowed.
curl --request PUT \
--url https://api.archer.exchange/v1/order/limit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orderId": "<string>",
"crossSpread": false,
"newPrice": "151.25",
"newSize": "2.0",
"signer": "<string>",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/order/limit"
payload = {
"orderId": "<string>",
"crossSpread": False,
"newPrice": "151.25",
"newSize": "2.0",
"signer": "<string>",
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: '<string>',
crossSpread: false,
newPrice: '151.25',
newSize: '2.0',
signer: '<string>',
withInstructions: 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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => '<string>',
'crossSpread' => false,
'newPrice' => '151.25',
'newSize' => '2.0',
'signer' => '<string>',
'withInstructions' => 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 \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.archer.exchange/v1/order/limit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": 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::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": 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
Provide at least one of newPrice / newSize. Resize keeps the id; a price change yields a new id.
Opaque order id returned at placement.
When false (default), a modify that grows a level — a reprice, or a size increase — to a price that crosses the spread (a buy at/above the best registered ask, a sell at/below the best registered bid) is rejected with CROSSES_SPREAD, and the tx is sent post-only. Size decreases are never rejected. Set true to keep a spread-crossing order.
"151.25"
"2.0"
The wallet that signs, for an order on an ArcherAccount-owned book: the account's owner or delegate. Omit for a wallet-owned order, which its maker signs. Existing clients may keep sending it as authority; send one name only.
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.
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 PUT \
--url https://api.archer.exchange/v1/order/limit \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orderId": "<string>",
"crossSpread": false,
"newPrice": "151.25",
"newSize": "2.0",
"signer": "<string>",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/order/limit"
payload = {
"orderId": "<string>",
"crossSpread": False,
"newPrice": "151.25",
"newSize": "2.0",
"signer": "<string>",
"withInstructions": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderId: '<string>',
crossSpread: false,
newPrice: '151.25',
newSize: '2.0',
signer: '<string>',
withInstructions: 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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orderId' => '<string>',
'crossSpread' => false,
'newPrice' => '151.25',
'newSize' => '2.0',
'signer' => '<string>',
'withInstructions' => 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 \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": false\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.archer.exchange/v1/order/limit")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": 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::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderId\": \"<string>\",\n \"crossSpread\": false,\n \"newPrice\": \"151.25\",\n \"newSize\": \"2.0\",\n \"signer\": \"<string>\",\n \"withInstructions\": 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>"
}