API Reference
Trading
Order creation, management, positions, balance, and fills
Trading Endpoints
Place orders, manage positions, and check balances across Polymarket and Kalshi.
All trading endpoints require the trade scope on your API key. Trading requests are never cached -- they are proxied directly to the exchange.
You must have exchange credentials stored before using trading endpoints. See Account > Exchange Credentials.
Orders
Create Order
POST /polymarket/orders
POST /kalshi/ordersRequest body (CreateOrderParams):
| Field | Type | Required | Description |
|---|---|---|---|
market_id | string | Yes | Market identifier |
outcome_id | string | Yes | Outcome to trade |
side | string | Yes | buy or sell |
order_type | string | Yes | limit or market |
amount | string | Yes | Number of shares/contracts |
price | string | For limit | Limit price (decimal string, e.g. "0.65") |
time_in_force | string | No | GTC (default), IOC, FOK |
Polymarket example:
curl -X POST https://papi.tylerthebuildor.com/polymarket/orders \
-H "Authorization: Bearer papi_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"market_id": "0x1234abcd...",
"outcome_id": "71234567890",
"side": "buy",
"order_type": "limit",
"amount": "100.00",
"price": "0.65",
"time_in_force": "GTC"
}'Kalshi example:
curl -X POST https://papi.tylerthebuildor.com/kalshi/orders \
-H "Authorization: Bearer papi_sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"market_id": "KXBTC-26DEC31-T100000",
"outcome_id": "yes",
"side": "buy",
"order_type": "limit",
"amount": "10.00",
"price": "0.62",
"time_in_force": "GTC"
}'Response (Order object):
{
"id": "order_abc123",
"market_id": "0x1234abcd...",
"outcome_id": "71234567890",
"side": "buy",
"order_type": "limit",
"price": "0.65",
"amount": "100.00",
"status": "open",
"filled": "0.00",
"remaining": "100.00",
"timestamp": "2026-03-18T12:00:00Z",
"fee": null,
"time_in_force": "GTC"
}List Orders
GET /polymarket/orders
GET /kalshi/orders| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results |
pagination_key | string | Cursor for pagination |
curl -s "https://papi.tylerthebuildor.com/polymarket/orders?limit=10" \
-H "Authorization: Bearer papi_sk_live_..."Returns an array of Order objects.
Get Order
GET /polymarket/orders/{order_id}
GET /kalshi/orders/{order_id}curl -s "https://papi.tylerthebuildor.com/polymarket/orders/order_abc123" \
-H "Authorization: Bearer papi_sk_live_..."Returns a single Order object.
Cancel Order
DELETE /polymarket/orders/{order_id}
DELETE /kalshi/orders/{order_id}curl -X DELETE https://papi.tylerthebuildor.com/polymarket/orders/order_abc123 \
-H "Authorization: Bearer papi_sk_live_..."Positions
GET /polymarket/positions
GET /kalshi/positionscurl -s https://papi.tylerthebuildor.com/polymarket/positions \
-H "Authorization: Bearer papi_sk_live_..."Response (array of Position objects):
[
{
"market_id": "0x1234abcd...",
"outcome_id": "71234567890",
"outcome_label": "Yes",
"size": "100.00",
"entry_price": "0.55",
"current_price": "0.72",
"unrealized_pnl": "17.00",
"realized_pnl": null,
"market_title": "Will Bitcoin exceed $100k?",
"market_slug": "will-bitcoin-exceed-100k",
"redeemable": false
}
]Position Fields
| Field | Type | Description |
|---|---|---|
market_id | string | Market identifier |
outcome_id | string | Outcome token/contract ID |
outcome_label | string | Display label (e.g., "Yes") |
size | string | Position size |
entry_price | string | Average entry price |
current_price | string | Current market price |
unrealized_pnl | string | Unrealized profit/loss |
realized_pnl | string | null | Realized profit/loss |
market_title | string | Market question text |
market_slug | string | URL-friendly market identifier |
redeemable | boolean | Whether the position can be redeemed |
Balance
GET /polymarket/balance
GET /kalshi/balancecurl -s https://papi.tylerthebuildor.com/polymarket/balance \
-H "Authorization: Bearer papi_sk_live_..."Response (Balance object):
{
"currency": "USDC",
"total": "1000.00",
"available": "850.00",
"locked": "150.00"
}| Field | Type | Description |
|---|---|---|
currency | string | Currency code (USDC for Polymarket, USD for Kalshi) |
total | string | Total balance |
available | string | Available for trading |
locked | string | Locked in open orders |
User Fills (Kalshi only)
GET /kalshi/trades/meReturns your executed trades (fills) on Kalshi.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results |
curl -s "https://papi.tylerthebuildor.com/kalshi/trades/me?limit=5" \
-H "Authorization: Bearer papi_sk_live_..."Returns an array of Trade objects representing your executed fills.
Order Type Reference
| Field | Type | Values | Description |
|---|---|---|---|
side | string | buy, sell | Order direction |
order_type | string | limit, market | Order type |
status | string | open, filled, partially_filled, cancelled | Order status |
time_in_force | string | GTC, IOC, FOK | Time in force policy |
- GTC (Good Til Cancelled) -- Order remains open until filled or cancelled
- IOC (Immediate or Cancel) -- Fill immediately or cancel unfilled portion
- FOK (Fill or Kill) -- Fill entirely or cancel the whole order
Important Notes
- All prices are decimal strings (e.g.,
"0.65", not0.65or65) - Kalshi prices are automatically converted from cents -- you send and receive decimals
- Order operations are never cached
- Failed orders return exchange-specific error messages wrapped in the PAPI error format
- You must have exchange credentials stored before using any trading endpoint