Batch Orders
Place multiple orders in one request.
Each order is processed independently — individual failures don’t block the rest. The batch size is limited by your API tier.
HFT optimisation: CLOB midpoint prices are pre-fetched in parallel for all unique markets in the batch before orders are processed. This collapses N sequential HTTP round-trips into one parallel burst, warming the Redis midpoint cache so each order hits the sub-ms HFT fast-path during execution.
curl --request POST \
--url https://api.polysimulator.com/v1/orders/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orders": [
{
"market_id": "<string>",
"outcome": "<string>",
"quantity": "<string>",
"amount": "<string>",
"order_type": "market",
"price": "<string>",
"time_in_force": "GTC",
"client_order_id": "<string>",
"expiration": "<string>",
"post_only": false,
"wallet_id": 123
}
]
}
'import requests
url = "https://api.polysimulator.com/v1/orders/batch"
payload = { "orders": [
{
"market_id": "<string>",
"outcome": "<string>",
"quantity": "<string>",
"amount": "<string>",
"order_type": "market",
"price": "<string>",
"time_in_force": "GTC",
"client_order_id": "<string>",
"expiration": "<string>",
"post_only": False,
"wallet_id": 123
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
market_id: '<string>',
outcome: '<string>',
quantity: '<string>',
amount: '<string>',
order_type: 'market',
price: '<string>',
time_in_force: 'GTC',
client_order_id: '<string>',
expiration: '<string>',
post_only: false,
wallet_id: 123
}
]
})
};
fetch('https://api.polysimulator.com/v1/orders/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.polysimulator.com/v1/orders/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([
'orders' => [
[
'market_id' => '<string>',
'outcome' => '<string>',
'quantity' => '<string>',
'amount' => '<string>',
'order_type' => 'market',
'price' => '<string>',
'time_in_force' => 'GTC',
'client_order_id' => '<string>',
'expiration' => '<string>',
'post_only' => false,
'wallet_id' => 123
]
]
]),
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.polysimulator.com/v1/orders/batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.polysimulator.com/v1/orders/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polysimulator.com/v1/orders/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"order_id": 123,
"status": "<string>",
"order_type": "<string>",
"side": "<string>",
"outcome": "<string>",
"price": "<string>",
"quantity": "<string>",
"notional": "<string>",
"fee": "<string>",
"filled_at": "<string>",
"cancelled_reason": "<string>",
"price_source": "<string>",
"slippage_bps": 123,
"quote_age_ms": 123,
"spread_bps": 123,
"impact_bps": 123,
"book_walk_levels": 123,
"account_balance": "<string>",
"position": {},
"client_order_id": "<string>",
"error": "<string>",
"error_message": "<string>",
"amount_interpreted_as": "<string>",
"is_replay": true,
"warnings": [
"<string>"
]
}
],
"succeeded": 123,
"failed": 123
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}Authorizations
Issue from /v1/keys (or admin-issued for enterprise tier).
Headers
Your PolySimulator API key
Polymarket-CLOB-compat alias for X-API-Key (underscore form). SDK clients ported from Polymarket can authenticate without changing header names. X-API-Key takes precedence when both are provided.
PM-CLOB-compat dashed-form alias for X-API-Key. Same value semantics as POLY_API_KEY but with HTTP-conventional dash separators. Both spellings are accepted end-to-end.
PM-CLOB-compat: Authorization: Bearer ps_live_... (or ps_test_...) is accepted as an alias for X-API-Key so py-clob-client and other ported SDKs authenticate without header name changes. Bearer JWTs are NOT accepted here — use the dashboard-auth endpoints for those.
Body
1 - 100 elementsShow child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.polysimulator.com/v1/orders/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"orders": [
{
"market_id": "<string>",
"outcome": "<string>",
"quantity": "<string>",
"amount": "<string>",
"order_type": "market",
"price": "<string>",
"time_in_force": "GTC",
"client_order_id": "<string>",
"expiration": "<string>",
"post_only": false,
"wallet_id": 123
}
]
}
'import requests
url = "https://api.polysimulator.com/v1/orders/batch"
payload = { "orders": [
{
"market_id": "<string>",
"outcome": "<string>",
"quantity": "<string>",
"amount": "<string>",
"order_type": "market",
"price": "<string>",
"time_in_force": "GTC",
"client_order_id": "<string>",
"expiration": "<string>",
"post_only": False,
"wallet_id": 123
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orders: [
{
market_id: '<string>',
outcome: '<string>',
quantity: '<string>',
amount: '<string>',
order_type: 'market',
price: '<string>',
time_in_force: 'GTC',
client_order_id: '<string>',
expiration: '<string>',
post_only: false,
wallet_id: 123
}
]
})
};
fetch('https://api.polysimulator.com/v1/orders/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.polysimulator.com/v1/orders/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([
'orders' => [
[
'market_id' => '<string>',
'outcome' => '<string>',
'quantity' => '<string>',
'amount' => '<string>',
'order_type' => 'market',
'price' => '<string>',
'time_in_force' => 'GTC',
'client_order_id' => '<string>',
'expiration' => '<string>',
'post_only' => false,
'wallet_id' => 123
]
]
]),
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.polysimulator.com/v1/orders/batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.polysimulator.com/v1/orders/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polysimulator.com/v1/orders/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"quantity\": \"<string>\",\n \"amount\": \"<string>\",\n \"order_type\": \"market\",\n \"price\": \"<string>\",\n \"time_in_force\": \"GTC\",\n \"client_order_id\": \"<string>\",\n \"expiration\": \"<string>\",\n \"post_only\": false,\n \"wallet_id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"order_id": 123,
"status": "<string>",
"order_type": "<string>",
"side": "<string>",
"outcome": "<string>",
"price": "<string>",
"quantity": "<string>",
"notional": "<string>",
"fee": "<string>",
"filled_at": "<string>",
"cancelled_reason": "<string>",
"price_source": "<string>",
"slippage_bps": 123,
"quote_age_ms": 123,
"spread_bps": 123,
"impact_bps": 123,
"book_walk_levels": 123,
"account_balance": "<string>",
"position": {},
"client_order_id": "<string>",
"error": "<string>",
"error_message": "<string>",
"amount_interpreted_as": "<string>",
"is_replay": true,
"warnings": [
"<string>"
]
}
],
"succeeded": 123,
"failed": 123
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {},
"request_id": "<string>"
}