Orders
Create Order
Place a new order on the specified platform. Requires stored credentials or a provider with a default client.
POST
/
v1
/
api
/
orders
Create order
curl --request POST \
--url https://api.dotprediction.io/v1/api/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market_id": "<string>",
"outcome": "<string>",
"size": 123,
"credential_id": 123,
"price": 123,
"time_in_force": "<string>",
"expiration": "<string>",
"client_order_id": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://api.dotprediction.io/v1/api/orders"
payload = {
"market_id": "<string>",
"outcome": "<string>",
"size": 123,
"credential_id": 123,
"price": 123,
"time_in_force": "<string>",
"expiration": "<string>",
"client_order_id": "<string>",
"idempotency_key": "<string>"
}
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({
market_id: '<string>',
outcome: '<string>',
size: 123,
credential_id: 123,
price: 123,
time_in_force: '<string>',
expiration: '<string>',
client_order_id: '<string>',
idempotency_key: '<string>'
})
};
fetch('https://api.dotprediction.io/v1/api/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://api.dotprediction.io/v1/api/orders",
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([
'market_id' => '<string>',
'outcome' => '<string>',
'size' => 123,
'credential_id' => 123,
'price' => 123,
'time_in_force' => '<string>',
'expiration' => '<string>',
'client_order_id' => '<string>',
'idempotency_key' => '<string>'
]),
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.dotprediction.io/v1/api/orders"
payload := strings.NewReader("{\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\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.dotprediction.io/v1/api/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dotprediction.io/v1/api/orders")
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 \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"order": {
"order_id": "<string>",
"platform": "<string>",
"market_id": "<string>",
"outcome": "<string>",
"price": 123,
"size": 123,
"filled_size": 123,
"remaining_size": 123,
"average_fill_price": 123,
"status": "<string>",
"time_in_force": "<string>",
"client_order_id": "<string>",
"fees": {
"maker_fee": 123,
"taker_fee": 123,
"total_fee": 123
},
"created_at": "<string>",
"updated_at": "<string>",
"expiration": "<string>"
},
"meta": {
"platform": "<string>",
"request_time_ms": 123,
"idempotent_replay": true
}
}{
"error": {
"status": 123,
"message": "<string>",
"resolution": "<string>",
"error_text": "<string>"
}
}{
"error": {
"status": 123,
"message": "<string>",
"resolution": "<string>",
"error_text": "<string>"
}
}Authorizations
API key for authentication. Generate one via the dashboard or the /v1/api/auth/api-keys endpoint.
Body
application/json
Target platform.
Available options:
kalshi, polymarket, limitless The market to place the order on.
Order side.
Available options:
buy, sell Outcome to trade (e.g., 'Yes', 'No').
Order type.
Available options:
limit, market Number of contracts/shares.
Stored credential ID. Omit to use default.
Limit price (0.01-0.99). Required for limit orders.
Time in force (default: gtc).
Expiration time (ISO 8601).
Client-provided order ID.
Idempotency key to prevent duplicate orders.
⌘I
Create order
curl --request POST \
--url https://api.dotprediction.io/v1/api/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"market_id": "<string>",
"outcome": "<string>",
"size": 123,
"credential_id": 123,
"price": 123,
"time_in_force": "<string>",
"expiration": "<string>",
"client_order_id": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://api.dotprediction.io/v1/api/orders"
payload = {
"market_id": "<string>",
"outcome": "<string>",
"size": 123,
"credential_id": 123,
"price": 123,
"time_in_force": "<string>",
"expiration": "<string>",
"client_order_id": "<string>",
"idempotency_key": "<string>"
}
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({
market_id: '<string>',
outcome: '<string>',
size: 123,
credential_id: 123,
price: 123,
time_in_force: '<string>',
expiration: '<string>',
client_order_id: '<string>',
idempotency_key: '<string>'
})
};
fetch('https://api.dotprediction.io/v1/api/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://api.dotprediction.io/v1/api/orders",
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([
'market_id' => '<string>',
'outcome' => '<string>',
'size' => 123,
'credential_id' => 123,
'price' => 123,
'time_in_force' => '<string>',
'expiration' => '<string>',
'client_order_id' => '<string>',
'idempotency_key' => '<string>'
]),
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.dotprediction.io/v1/api/orders"
payload := strings.NewReader("{\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\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.dotprediction.io/v1/api/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dotprediction.io/v1/api/orders")
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 \"market_id\": \"<string>\",\n \"outcome\": \"<string>\",\n \"size\": 123,\n \"credential_id\": 123,\n \"price\": 123,\n \"time_in_force\": \"<string>\",\n \"expiration\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"order": {
"order_id": "<string>",
"platform": "<string>",
"market_id": "<string>",
"outcome": "<string>",
"price": 123,
"size": 123,
"filled_size": 123,
"remaining_size": 123,
"average_fill_price": 123,
"status": "<string>",
"time_in_force": "<string>",
"client_order_id": "<string>",
"fees": {
"maker_fee": 123,
"taker_fee": 123,
"total_fee": 123
},
"created_at": "<string>",
"updated_at": "<string>",
"expiration": "<string>"
},
"meta": {
"platform": "<string>",
"request_time_ms": 123,
"idempotent_replay": true
}
}{
"error": {
"status": 123,
"message": "<string>",
"resolution": "<string>",
"error_text": "<string>"
}
}{
"error": {
"status": 123,
"message": "<string>",
"resolution": "<string>",
"error_text": "<string>"
}
}