Create order draft
curl --request POST \
--url https://api.worm.wtf/orders/ \
--header 'Content-Type: application/json' \
--data '
{
"market_condition_id": "<string>",
"is_yes": true,
"side": "<string>",
"order_type": "<string>",
"price": "<string>",
"amount": "<string>",
"funds": "<string>"
}
'import requests
url = "https://api.worm.wtf/orders/"
payload = {
"market_condition_id": "<string>",
"is_yes": True,
"side": "<string>",
"order_type": "<string>",
"price": "<string>",
"amount": "<string>",
"funds": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
market_condition_id: '<string>',
is_yes: true,
side: '<string>',
order_type: '<string>',
price: '<string>',
amount: '<string>',
funds: '<string>'
})
};
fetch('https://api.worm.wtf/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.worm.wtf/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_condition_id' => '<string>',
'is_yes' => true,
'side' => '<string>',
'order_type' => '<string>',
'price' => '<string>',
'amount' => '<string>',
'funds' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.worm.wtf/orders/"
payload := strings.NewReader("{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.worm.wtf/orders/")
.header("Content-Type", "application/json")
.body("{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/orders/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pubkey": "5uA9kQ1dM8rT4yW2nB7cF3pL6zX0vH5sJ2eR9tQ4mNp",
"message": "Program call payload to sign for order placement."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Orders
Create order draft
Create a draft order that must be signed and submitted to be placed on the orderbook.
POST
/
orders
/
Create order draft
curl --request POST \
--url https://api.worm.wtf/orders/ \
--header 'Content-Type: application/json' \
--data '
{
"market_condition_id": "<string>",
"is_yes": true,
"side": "<string>",
"order_type": "<string>",
"price": "<string>",
"amount": "<string>",
"funds": "<string>"
}
'import requests
url = "https://api.worm.wtf/orders/"
payload = {
"market_condition_id": "<string>",
"is_yes": True,
"side": "<string>",
"order_type": "<string>",
"price": "<string>",
"amount": "<string>",
"funds": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
market_condition_id: '<string>',
is_yes: true,
side: '<string>',
order_type: '<string>',
price: '<string>',
amount: '<string>',
funds: '<string>'
})
};
fetch('https://api.worm.wtf/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.worm.wtf/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_condition_id' => '<string>',
'is_yes' => true,
'side' => '<string>',
'order_type' => '<string>',
'price' => '<string>',
'amount' => '<string>',
'funds' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.worm.wtf/orders/"
payload := strings.NewReader("{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.worm.wtf/orders/")
.header("Content-Type", "application/json")
.body("{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/orders/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"market_condition_id\": \"<string>\",\n \"is_yes\": true,\n \"side\": \"<string>\",\n \"order_type\": \"<string>\",\n \"price\": \"<string>\",\n \"amount\": \"<string>\",\n \"funds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pubkey": "5uA9kQ1dM8rT4yW2nB7cF3pL6zX0vH5sJ2eR9tQ4mNp",
"message": "Program call payload to sign for order placement."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Body Parameters
Order side:
buy or sell (case-insensitive). Must be a JSON string, not a numeric code.Order type:
limit or market (case-insensitive). Must be a JSON string, not a numeric code.Spot CLOB only. This endpoint places orders on the spot orderbook (
config.kind = orderbook). Markets with margin_enabled=true or a Polymarket/Hyperliquid margin backend are rejected. Use margin position requests for leveraged positions.Sign the returned
message, then call Submit order with the hex signature (see that page).Response
On success the API returns201 Created. When the draft order pubkey is available, the response includes a Location header pointing to GET /orders/{pubkey}/.
{
"data": {
"pubkey": "5uA9kQ1dM8rT4yW2nB7cF3pL6zX0vH5sJ2eR9tQ4mNp",
"message": "Program call payload to sign for order placement."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}