curl --request POST \
--url https://api.parlayx.com/v1/kalshi/orders \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'PX-Content-Sha256: <px-content-sha256>' \
--header 'PX-Key-Id: <px-key-id>' \
--header 'PX-Signature: <px-signature>' \
--header 'PX-Timestamp: <px-timestamp>' \
--data '
{
"ticker": "KXPRES-2028",
"side": "BID",
"count": "10",
"price": "0.38",
"postOnly": true,
"selfTradePrevention": "TAKER_AT_CROSS",
"cancelOrderOnPause": true,
"timeInForce": {
"type": "GTC"
},
"clientOrderId": "order-1"
}
'import requests
url = "https://api.parlayx.com/v1/kalshi/orders"
payload = {
"ticker": "KXPRES-2028",
"side": "BID",
"count": "10",
"price": "0.38",
"postOnly": True,
"selfTradePrevention": "TAKER_AT_CROSS",
"cancelOrderOnPause": True,
"timeInForce": { "type": "GTC" },
"clientOrderId": "order-1"
}
headers = {
"PX-Key-Id": "<px-key-id>",
"PX-Timestamp": "<px-timestamp>",
"PX-Signature": "<px-signature>",
"PX-Content-Sha256": "<px-content-sha256>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'PX-Key-Id': '<px-key-id>',
'PX-Timestamp': '<px-timestamp>',
'PX-Signature': '<px-signature>',
'PX-Content-Sha256': '<px-content-sha256>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ticker: 'KXPRES-2028',
side: 'BID',
count: '10',
price: '0.38',
postOnly: true,
selfTradePrevention: 'TAKER_AT_CROSS',
cancelOrderOnPause: true,
timeInForce: {type: 'GTC'},
clientOrderId: 'order-1'
})
};
fetch('https://api.parlayx.com/v1/kalshi/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.parlayx.com/v1/kalshi/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([
'ticker' => 'KXPRES-2028',
'side' => 'BID',
'count' => '10',
'price' => '0.38',
'postOnly' => true,
'selfTradePrevention' => 'TAKER_AT_CROSS',
'cancelOrderOnPause' => true,
'timeInForce' => [
'type' => 'GTC'
],
'clientOrderId' => 'order-1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"PX-Content-Sha256: <px-content-sha256>",
"PX-Key-Id: <px-key-id>",
"PX-Signature: <px-signature>",
"PX-Timestamp: <px-timestamp>"
],
]);
$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.parlayx.com/v1/kalshi/orders"
payload := strings.NewReader("{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("PX-Key-Id", "<px-key-id>")
req.Header.Add("PX-Timestamp", "<px-timestamp>")
req.Header.Add("PX-Signature", "<px-signature>")
req.Header.Add("PX-Content-Sha256", "<px-content-sha256>")
req.Header.Add("Idempotency-Key", "<idempotency-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.parlayx.com/v1/kalshi/orders")
.header("PX-Key-Id", "<px-key-id>")
.header("PX-Timestamp", "<px-timestamp>")
.header("PX-Signature", "<px-signature>")
.header("PX-Content-Sha256", "<px-content-sha256>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parlayx.com/v1/kalshi/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["PX-Key-Id"] = '<px-key-id>'
request["PX-Timestamp"] = '<px-timestamp>'
request["PX-Signature"] = '<px-signature>'
request["PX-Content-Sha256"] = '<px-content-sha256>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d",
"status": "OPEN",
"filledCount": "4",
"remainingCount": "6",
"averagePrice": "0.384"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "IDEMPOTENCY_CONFLICT",
"message": "Idempotency key was reused with a different request body"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}Submit Order
Places a limit order on a Kalshi market and returns the issued order id.
curl --request POST \
--url https://api.parlayx.com/v1/kalshi/orders \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'PX-Content-Sha256: <px-content-sha256>' \
--header 'PX-Key-Id: <px-key-id>' \
--header 'PX-Signature: <px-signature>' \
--header 'PX-Timestamp: <px-timestamp>' \
--data '
{
"ticker": "KXPRES-2028",
"side": "BID",
"count": "10",
"price": "0.38",
"postOnly": true,
"selfTradePrevention": "TAKER_AT_CROSS",
"cancelOrderOnPause": true,
"timeInForce": {
"type": "GTC"
},
"clientOrderId": "order-1"
}
'import requests
url = "https://api.parlayx.com/v1/kalshi/orders"
payload = {
"ticker": "KXPRES-2028",
"side": "BID",
"count": "10",
"price": "0.38",
"postOnly": True,
"selfTradePrevention": "TAKER_AT_CROSS",
"cancelOrderOnPause": True,
"timeInForce": { "type": "GTC" },
"clientOrderId": "order-1"
}
headers = {
"PX-Key-Id": "<px-key-id>",
"PX-Timestamp": "<px-timestamp>",
"PX-Signature": "<px-signature>",
"PX-Content-Sha256": "<px-content-sha256>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'PX-Key-Id': '<px-key-id>',
'PX-Timestamp': '<px-timestamp>',
'PX-Signature': '<px-signature>',
'PX-Content-Sha256': '<px-content-sha256>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ticker: 'KXPRES-2028',
side: 'BID',
count: '10',
price: '0.38',
postOnly: true,
selfTradePrevention: 'TAKER_AT_CROSS',
cancelOrderOnPause: true,
timeInForce: {type: 'GTC'},
clientOrderId: 'order-1'
})
};
fetch('https://api.parlayx.com/v1/kalshi/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.parlayx.com/v1/kalshi/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([
'ticker' => 'KXPRES-2028',
'side' => 'BID',
'count' => '10',
'price' => '0.38',
'postOnly' => true,
'selfTradePrevention' => 'TAKER_AT_CROSS',
'cancelOrderOnPause' => true,
'timeInForce' => [
'type' => 'GTC'
],
'clientOrderId' => 'order-1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"PX-Content-Sha256: <px-content-sha256>",
"PX-Key-Id: <px-key-id>",
"PX-Signature: <px-signature>",
"PX-Timestamp: <px-timestamp>"
],
]);
$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.parlayx.com/v1/kalshi/orders"
payload := strings.NewReader("{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("PX-Key-Id", "<px-key-id>")
req.Header.Add("PX-Timestamp", "<px-timestamp>")
req.Header.Add("PX-Signature", "<px-signature>")
req.Header.Add("PX-Content-Sha256", "<px-content-sha256>")
req.Header.Add("Idempotency-Key", "<idempotency-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.parlayx.com/v1/kalshi/orders")
.header("PX-Key-Id", "<px-key-id>")
.header("PX-Timestamp", "<px-timestamp>")
.header("PX-Signature", "<px-signature>")
.header("PX-Content-Sha256", "<px-content-sha256>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parlayx.com/v1/kalshi/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["PX-Key-Id"] = '<px-key-id>'
request["PX-Timestamp"] = '<px-timestamp>'
request["PX-Signature"] = '<px-signature>'
request["PX-Content-Sha256"] = '<px-content-sha256>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ticker\": \"KXPRES-2028\",\n \"side\": \"BID\",\n \"count\": \"10\",\n \"price\": \"0.38\",\n \"postOnly\": true,\n \"selfTradePrevention\": \"TAKER_AT_CROSS\",\n \"cancelOrderOnPause\": true,\n \"timeInForce\": {\n \"type\": \"GTC\"\n },\n \"clientOrderId\": \"order-1\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d",
"status": "OPEN",
"filledCount": "4",
"remainingCount": "6",
"averagePrice": "0.384"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "IDEMPOTENCY_CONFLICT",
"message": "Idempotency key was reused with a different request body"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_REQUEST",
"message": "<string>",
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "<string>"
}
}Headers
The key id issued for your signing keypair.
Unix seconds at signing, valid within 30 seconds of the server clock.
Ed25519 signature of the request
Hex SHA-256 of the request body, or the SHA-256 of the empty string when there is no body.
Idempotency key for this request. Re-sending the same key with the same body returns the original result and creates no duplicate; re-sending it with a different body is rejected with 422.
1"2f1a8c4e-0b3d-4a9c-8e7f-1a2b3c4d5e6f"
Body
Kalshi market ticker identifying the market to trade.
1"KXPRES-2028"
Order direction on the market's YES book.
| Side | Meaning |
|---|---|
BID | Buy YES contracts, profiting if the market resolves YES. |
ASK | Sell YES contracts, profiting if the market resolves NO. |
Selling YES is the same order as buying NO, so ASK covers both.
BID, ASK "BID"
Order size in contracts, as a decimal string. Contracts trade in steps of 0.01.
"10"
Limit price per contract in dollars, as a decimal string on the market's YES book. A price off that market's tick grid is rejected.
"0.38"
Reject the order if it would cross the book instead of resting as a maker.
Which order is cancelled when this order would trade against your own resting order.
| Policy | Meaning |
|---|---|
TAKER_AT_CROSS | Cancels this order, leaving the resting one on the book. |
MAKER | Cancels the resting order and lets this one keep matching. |
Defaults to TAKER_AT_CROSS.
TAKER_AT_CROSS, MAKER "TAKER_AT_CROSS"
Cancel the order if the exchange pauses trading, instead of leaving it resting.
Execution policy; defaults to GTC.
- GoodTillCancelled
- ImmediateOrCancel
- FillOrKill
- GoodTillDate
Show child attributes
Show child attributes
Your own identifier for this order, returned unchanged on every read of it. Each value may be used only once.
1 - 64"order-1"
Response
Order accepted; status is the order's recorded state, and acceptance alone does not mean it is resting or filled
Issued order id.
"3f8b2c9a-2d18-4f7e-9c2a-1b6e1f0c8a4d"
Order lifecycle status.
| Status | Meaning |
|---|---|
PENDING | Accepted, not yet sent to the venue. |
SUBMITTED | At the venue, outcome not yet known. Either not yet acknowledged, or an immediate-or-cancel order acknowledged but not yet settled. |
OPEN | Resting on the venue, and cancellable. |
FILLED | Fully filled. |
CANCELLED / REJECTED | Terminal. |
PENDING, SUBMITTED, OPEN, FILLED, CANCELLED, REJECTED "OPEN"
Contracts filled immediately when the venue acknowledged the order, or null if unreported.
"4"
Contracts still resting when the venue acknowledged the order, or null if unreported.
"6"
Average price per contract in dollars on the market's YES book, of the contracts filled at acknowledgement, or null if none filled.
"0.384"