PAPI
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/orders

Request body (CreateOrderParams):

FieldTypeRequiredDescription
market_idstringYesMarket identifier
outcome_idstringYesOutcome to trade
sidestringYesbuy or sell
order_typestringYeslimit or market
amountstringYesNumber of shares/contracts
pricestringFor limitLimit price (decimal string, e.g. "0.65")
time_in_forcestringNoGTC (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
ParameterTypeDescription
limitintegerNumber of results
pagination_keystringCursor 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/positions
curl -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

FieldTypeDescription
market_idstringMarket identifier
outcome_idstringOutcome token/contract ID
outcome_labelstringDisplay label (e.g., "Yes")
sizestringPosition size
entry_pricestringAverage entry price
current_pricestringCurrent market price
unrealized_pnlstringUnrealized profit/loss
realized_pnlstring | nullRealized profit/loss
market_titlestringMarket question text
market_slugstringURL-friendly market identifier
redeemablebooleanWhether the position can be redeemed

Balance

GET /polymarket/balance
GET /kalshi/balance
curl -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"
}
FieldTypeDescription
currencystringCurrency code (USDC for Polymarket, USD for Kalshi)
totalstringTotal balance
availablestringAvailable for trading
lockedstringLocked in open orders

User Fills (Kalshi only)

GET /kalshi/trades/me

Returns your executed trades (fills) on Kalshi.

ParameterTypeDescription
limitintegerNumber 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

FieldTypeValuesDescription
sidestringbuy, sellOrder direction
order_typestringlimit, marketOrder type
statusstringopen, filled, partially_filled, cancelledOrder status
time_in_forcestringGTC, IOC, FOKTime 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", not 0.65 or 65)
  • 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

On this page