curl --request POST \
--url https://api.ornn.com/v1/markets/schedules/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"legs": [
{
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"listingTermId": "88888888-8888-4888-8888-888888888888",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00Z",
"endsAt": "2026-10-27T00:00:00Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}
'import requests
url = "https://api.ornn.com/v1/markets/schedules/purchases"
payload = { "legs": [
{
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"listingTermId": "88888888-8888-4888-8888-888888888888",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00Z",
"endsAt": "2026-10-27T00:00:00Z",
"askPricePerGpuHourMicroUsd": 4200000
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
legs: [
{
listingId: 'eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee',
listingTermId: '88888888-8888-4888-8888-888888888888',
nodeCount: 1,
startsAt: '2026-10-24T00:00:00Z',
endsAt: '2026-10-27T00:00:00Z',
askPricePerGpuHourMicroUsd: 4200000
}
]
})
};
fetch('https://api.ornn.com/v1/markets/schedules/purchases', 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.ornn.com/v1/markets/schedules/purchases",
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([
'legs' => [
[
'listingId' => 'eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee',
'listingTermId' => '88888888-8888-4888-8888-888888888888',
'nodeCount' => 1,
'startsAt' => '2026-10-24T00:00:00Z',
'endsAt' => '2026-10-27T00:00:00Z',
'askPricePerGpuHourMicroUsd' => 4200000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.ornn.com/v1/markets/schedules/purchases"
payload := strings.NewReader("{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.ornn.com/v1/markets/schedules/purchases")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/markets/schedules/purchases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"purchases": [
{
"reservationId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00.000Z",
"endsAt": "2026-10-27T00:00:00.000Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}{
"purchases": [
{
"reservationId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00.000Z",
"endsAt": "2026-10-27T00:00:00.000Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}{
"detail": {
"code": "idempotency_key_required",
"message": "Send an Idempotency-Key header with this request."
}
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": {
"code": "cannot_buy_own_listing",
"message": "You cannot buy your own listing."
}
}{
"detail": {
"code": "schedule_not_found",
"message": "Ornn could not find that listing."
}
}{
"detail": {
"code": "ask_changed",
"message": "The asking price changed. Review the new price and try again."
}
}{
"detail": {
"code": "invalid_listing_term",
"message": "Choose an available listing term."
}
}{
"code": "<string>",
"detail": "<string>"
}Buy Market windows
Buys one or more windows of relisted capacity at the asking price. There is no offer and no seller approval: every leg is bought together or none are. Each leg becomes its own reservation, returned as reservationId.
Read the listing first. Choose a reserved term whose duration bounds allow your window (a shorter window is allowed when it ends exactly at the listing’s end) and send its listingTermId and pricePerGpuHourMicroUsd as askPricePerGpuHourMicroUsd. Use whole-second times; windows can start up to five minutes in the past.
Payment is up front. A reservation under 10,000ischargedatoncefromOrnncredits,thenyoursavedcard;ifthatchargefails,thepurchaseiscancelledandthewindowreturnstotheMarket.Areservationof10,000 or more is invoiced by wire and is held until paid. Poll GET /commerce/reservations/: status moves from awaiting_payment to confirmed, then active when the window starts. The reservation can take a moment to appear.
Requires Idempotency-Key. Available to every member of your organization; approval is not required. You cannot buy your own organization’s listings.
curl --request POST \
--url https://api.ornn.com/v1/markets/schedules/purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"legs": [
{
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"listingTermId": "88888888-8888-4888-8888-888888888888",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00Z",
"endsAt": "2026-10-27T00:00:00Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}
'import requests
url = "https://api.ornn.com/v1/markets/schedules/purchases"
payload = { "legs": [
{
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"listingTermId": "88888888-8888-4888-8888-888888888888",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00Z",
"endsAt": "2026-10-27T00:00:00Z",
"askPricePerGpuHourMicroUsd": 4200000
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
legs: [
{
listingId: 'eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee',
listingTermId: '88888888-8888-4888-8888-888888888888',
nodeCount: 1,
startsAt: '2026-10-24T00:00:00Z',
endsAt: '2026-10-27T00:00:00Z',
askPricePerGpuHourMicroUsd: 4200000
}
]
})
};
fetch('https://api.ornn.com/v1/markets/schedules/purchases', 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.ornn.com/v1/markets/schedules/purchases",
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([
'legs' => [
[
'listingId' => 'eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee',
'listingTermId' => '88888888-8888-4888-8888-888888888888',
'nodeCount' => 1,
'startsAt' => '2026-10-24T00:00:00Z',
'endsAt' => '2026-10-27T00:00:00Z',
'askPricePerGpuHourMicroUsd' => 4200000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.ornn.com/v1/markets/schedules/purchases"
payload := strings.NewReader("{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.ornn.com/v1/markets/schedules/purchases")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ornn.com/v1/markets/schedules/purchases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"legs\": [\n {\n \"listingId\": \"eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee\",\n \"listingTermId\": \"88888888-8888-4888-8888-888888888888\",\n \"nodeCount\": 1,\n \"startsAt\": \"2026-10-24T00:00:00Z\",\n \"endsAt\": \"2026-10-27T00:00:00Z\",\n \"askPricePerGpuHourMicroUsd\": 4200000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"purchases": [
{
"reservationId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00.000Z",
"endsAt": "2026-10-27T00:00:00.000Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}{
"purchases": [
{
"reservationId": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"listingId": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
"nodeCount": 1,
"startsAt": "2026-10-24T00:00:00.000Z",
"endsAt": "2026-10-27T00:00:00.000Z",
"askPricePerGpuHourMicroUsd": 4200000
}
]
}{
"detail": {
"code": "idempotency_key_required",
"message": "Send an Idempotency-Key header with this request."
}
}{
"code": "<string>",
"detail": "<string>"
}{
"detail": {
"code": "cannot_buy_own_listing",
"message": "You cannot buy your own listing."
}
}{
"detail": {
"code": "schedule_not_found",
"message": "Ornn could not find that listing."
}
}{
"detail": {
"code": "ask_changed",
"message": "The asking price changed. Review the new price and try again."
}
}{
"detail": {
"code": "invalid_listing_term",
"message": "Choose an available listing term."
}
}{
"code": "<string>",
"detail": "<string>"
}Idempotency-Key for each purchase. If the response is lost, retry with the same key and body to get the original result instead of buying twice.
ornn schedules buy does not send a term or node count, so it works only on listings without terms and always buys every node. Use this endpoint for listings with terms. See Buy relisted capacity.Authorizations
Create an organization API key in Account Settings > Developer. Do not send this key to the Kubernetes API server.
Headers
Required. A unique key of 1 to 200 characters for this operation, such as a UUID. Retrying with the same key and the same body returns the original result with HTTP 200 instead of creating a second one. The key is remembered for 24 hours per organization; reusing it for a different request returns 409 idempotency_conflict. A missing key returns 400 idempotency_key_required.
1 - 200Body
Windows to buy together. All legs succeed or none do; legs may not overlap.
1 - 50 elementsShow child attributes
Show child attributes
Response
A retry with the same Idempotency-Key and body; returns the original purchases.
Show child attributes
Show child attributes
Was this page helpful?