Skip to main content
POST
/
kalshi
/
order
/
limit
cURL
curl --request POST \
  --url https://api.example.com/kalshi/order/limit \
  --header 'Content-Type: application/json' \
  --data '
{
  "chain": "base",
  "marketId": "PRES-2024",
  "ccontracts": "1050",
  "priceUusdc": "750000",
  "action": "buy",
  "side": "yes",
  "userAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
  "signature": "0x...",
  "expiry": 1234567890,
  "devAccountId": "bison"
}
'
import requests

url = "https://api.example.com/kalshi/order/limit"

payload = {
"chain": "base",
"marketId": "PRES-2024",
"ccontracts": "1050",
"priceUusdc": "750000",
"action": "buy",
"side": "yes",
"userAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"signature": "0x...",
"expiry": 1234567890,
"devAccountId": "bison"
}
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({
chain: 'base',
marketId: 'PRES-2024',
ccontracts: '1050',
priceUusdc: '750000',
action: 'buy',
side: 'yes',
userAddress: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
signature: '0x...',
expiry: 1234567890,
devAccountId: 'bison'
})
};

fetch('https://api.example.com/kalshi/order/limit', 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.example.com/kalshi/order/limit",
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([
'chain' => 'base',
'marketId' => 'PRES-2024',
'ccontracts' => '1050',
'priceUusdc' => '750000',
'action' => 'buy',
'side' => 'yes',
'userAddress' => '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'signature' => '0x...',
'expiry' => 1234567890,
'devAccountId' => 'bison'
]),
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.example.com/kalshi/order/limit"

payload := strings.NewReader("{\n \"chain\": \"base\",\n \"marketId\": \"PRES-2024\",\n \"ccontracts\": \"1050\",\n \"priceUusdc\": \"750000\",\n \"action\": \"buy\",\n \"side\": \"yes\",\n \"userAddress\": \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\",\n \"signature\": \"0x...\",\n \"expiry\": 1234567890,\n \"devAccountId\": \"bison\"\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.example.com/kalshi/order/limit")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"base\",\n \"marketId\": \"PRES-2024\",\n \"ccontracts\": \"1050\",\n \"priceUusdc\": \"750000\",\n \"action\": \"buy\",\n \"side\": \"yes\",\n \"userAddress\": \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\",\n \"signature\": \"0x...\",\n \"expiry\": 1234567890,\n \"devAccountId\": \"bison\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/kalshi/order/limit")

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 \"chain\": \"base\",\n \"marketId\": \"PRES-2024\",\n \"ccontracts\": \"1050\",\n \"priceUusdc\": \"750000\",\n \"action\": \"buy\",\n \"side\": \"yes\",\n \"userAddress\": \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\",\n \"signature\": \"0x...\",\n \"expiry\": 1234567890,\n \"devAccountId\": \"bison\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "orderId": "<string>",
  "status": "<string>",
  "message": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
To avoid ambiguity, we denote the smallest possible multiple of USDC (0.000001 USDC) as one uusdc, which stands for µUSDC (micro-USDC), and denote the smallest possible multiple of a contract (0.01 contract) as one ccontract (centicontract).User-facing USDC balances are specified as fixed-point strings (e.g. "1.2625" for USDC). Contract quantities in the API and SDK are specified as integer ccontracts strings (e.g. "1050" for 10.50 contracts at precision 2).

Body

application/json
chain
enum<string>
required

Chain to execute the action on; one of: base, bsc

Available options:
base,
bsc
Example:

"base"

marketId
string
required

ID of the market to buy/sell in

Example:

"PRES-2024"

ccontracts
string
required

Number of ccontracts as a positive integer string (1 contract = 100 ccontracts).

Example:

"1050"

priceUusdc
string
required

Price per contract in µUSDC (micro-USDC, 1 µUSDC = 0.000001 USD). Must be positive integer string.

Example:

"750000"

action
enum<string>
required

Action to execute

Available options:
buy,
sell
Example:

"buy"

side
enum<string>
required

Side of the market (yes or no)

Available options:
yes,
no
Example:

"yes"

userAddress
string
required

User wallet address

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"

signature
string
required

EIP-712 signature from the user authorizing the order

Example:

"0x..."

expiry
number
required

Unix timestamp when the authorization expires

Example:

1234567890

devAccountId
string

Optional dev account ID to attribute this order to

Example:

"bison"

Response

Order placed successfully

success
boolean
required
orderId
string
required
status
string
required
message
string