Update buy orders
curl --request PATCH \
--url https://thefirm.biz/api/public/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"slug": "thefirm",
"maxSpendUsdc": "50",
"maxFdvUsdc": "5000000",
"expiresInMs": 86400000
}
]
}
'import requests
url = "https://thefirm.biz/api/public/v1/orders"
payload = { "items": [
{
"slug": "thefirm",
"maxSpendUsdc": "50",
"maxFdvUsdc": "5000000",
"expiresInMs": 86400000
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
slug: 'thefirm',
maxSpendUsdc: '50',
maxFdvUsdc: '5000000',
expiresInMs: 86400000
}
]
})
};
fetch('https://thefirm.biz/api/public/v1/orders', 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://thefirm.biz/api/public/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'slug' => 'thefirm',
'maxSpendUsdc' => '50',
'maxFdvUsdc' => '5000000',
'expiresInMs' => 86400000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://thefirm.biz/api/public/v1/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://thefirm.biz/api/public/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://thefirm.biz/api/public/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"slug": "thefirm",
"ok": true,
"status": "created"
},
{
"slug": "feel",
"ok": true,
"status": "unchanged"
},
{
"slug": "no-such-project",
"ok": false,
"code": "unknown_project",
"message": "No project matches the slug"
}
]
}
Buy Orders
Update buy orders
Updates the spend cap, FDV cap, or expiry of one or more active buy orders.
Each item is processed independently. The response is always HTTP 200 once authenticated and the body is valid — check the per-item ok flag in results (index-aligned to your request) for each outcome.
PATCH
/
api
/
public
/
v1
/
orders
Update buy orders
curl --request PATCH \
--url https://thefirm.biz/api/public/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"slug": "thefirm",
"maxSpendUsdc": "50",
"maxFdvUsdc": "5000000",
"expiresInMs": 86400000
}
]
}
'import requests
url = "https://thefirm.biz/api/public/v1/orders"
payload = { "items": [
{
"slug": "thefirm",
"maxSpendUsdc": "50",
"maxFdvUsdc": "5000000",
"expiresInMs": 86400000
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
slug: 'thefirm',
maxSpendUsdc: '50',
maxFdvUsdc: '5000000',
expiresInMs: 86400000
}
]
})
};
fetch('https://thefirm.biz/api/public/v1/orders', 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://thefirm.biz/api/public/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'slug' => 'thefirm',
'maxSpendUsdc' => '50',
'maxFdvUsdc' => '5000000',
'expiresInMs' => 86400000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://thefirm.biz/api/public/v1/orders"
payload := strings.NewReader("{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://thefirm.biz/api/public/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://thefirm.biz/api/public/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"slug\": \"thefirm\",\n \"maxSpendUsdc\": \"50\",\n \"maxFdvUsdc\": \"5000000\",\n \"expiresInMs\": 86400000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"slug": "thefirm",
"ok": true,
"status": "created"
},
{
"slug": "feel",
"ok": true,
"status": "unchanged"
},
{
"slug": "no-such-project",
"ok": false,
"code": "unknown_project",
"message": "No project matches the slug"
}
]
}
Body
application/json
The buy orders to update, keyed by project slug.

