The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders//execute instead.
POST
/
orders
Error
A valid request URL is required to generate request examples
A Lean API key, sent as Authorization: Bearer <key>. A test key (lean_sk_test_...) simulates orders and fills with no money; a live key (lean_sk_live_...) trades for real within the key's limits. Every successful response says which mode answered in data.livemode.
Body
application/json
client_order_id
string
required
Unique per API key. Replaying an id returns the original order.
Pattern: ^[A-Za-z0-9_-]{1,64}$
market_id
string
required
A market id from GET /markets, or a venue symbol that names one market: a Polymarket token id, a Hyperliquid book coin (#…, written %23… in a path), or a leg ticker (pm:…, hl:…, pmus:… or a Kalshi market ticker) that lists only this outcome. A symbol that names more than one market, such as a Polymarket condition id, is refused with 400; use the token id or the market id instead. An order named by a venue symbol trades only that listing, so it is refused when venues leaves out the symbol's venue. A buy routed automatically still buys that listing, paid from the other venue. The order is stored under the market id.
Required string length: 1 - 512
action
enum<string>
required
Available options:
buy,
sell
quantity
string
Shares, in 0.01 steps. Send exactly one of quantity or notional. A sell of the whole position, as held or written to two decimals, sells what each venue's increment allows and keeps the rest.
Pattern: ^\d+(?:\.\d+)?$
notional
string
Dollars to spend on an ioc or fok buy, in place of quantity, at most two decimals. The buy walks the books from the best price and never spends more than this before fees; Lean works out the shares. Sells and resting orders are sized with quantity.
Pattern: ^\d+(?:\.\d{1,2})?$
limit_price
string
Worst price per share you accept, in dollars. Required with quantity on a limit order. With notional or on a market order it defaults to 0.99 for a buy and 0.01 for a sell; a market order is then placed 1 cent past the worst price its quantity reaches in the book, tightened by max_slippage_bps when set.
type
enum<string>
default:limit
limit trades at limit_price or better. market trades at once at the best prices: it needs time_in_force ioc or fok, and each venue order is placed 1 cent past the worst price its quantity reaches in the book of that venue. limit_price and max_slippage_bps are optional extra caps on the worst price it accepts.
Available options:
limit,
market
time_in_force
enum<string>
default:gtc
gtc rests until filled or canceled. ioc fills what it can at once and cancels the rest. fok fills the whole order at once or cancels all of it, and is placed whole on one venue: Polymarket, else Kalshi, else Polymarket US, since Hyperliquid has no fill or kill. gtd rests like gtc until expires_at, and is placed on Kalshi, Polymarket and Polymarket US, since Hyperliquid has no order expiry. Polymarket takes an ioc or fok buy only by dollar amount: one sized with notional can fill there, while one sized with quantity goes only to the other venues, and when Polymarket is the only one it is refused with 400 VALIDATION_ERROR, so send it with notional or as gtc. notional needs ioc or fok.
Available options:
gtc,
ioc,
fok,
gtd
expires_at
string<date-time>
When a gtd order expires, as an ISO 8601 time. Required with gtd and refused with any other time_in_force. At least 3 minutes and at most 30 days ahead. Whatever has not filled by then is canceled, and the order reads expired.
max_slippage_bps
integer
Optional extra cap: the furthest each venue order may trade from that venue's own best price, in basis points; overrides the account's max_slippage_bps. Each venue is measured against its own book, not the best price across venues, so venues quoting different prices can each fill. Never looser than limit_price. Without one, a limit order trades to its limit and a market order to 1 cent past the worst price its quantity reaches in the book, as the Lean trading terminal places it.
Required range: 0 <= x <= 10000
all_or_none
boolean
default:false
Refuse the order unless the books, as read, fill the whole quantity within the slippage bound. Needs time_in_force ioc or fok. Best effort: venue orders are placed separately and books can move between the read and the fill, so a partial fill is still possible.
post_only
boolean
default:false
Only rest on the book, never take. Needs time_in_force gtc, cannot take best_price, and is placed on Kalshi, Polymarket US and Hyperliquid, since Polymarket cannot rest post-only. An order that would trade at once against the books, as read, is refused with reason POST_ONLY_WOULD_CROSS, and the venue rejects one that would trade by the time it arrives.
venues
enum<string>[]
Only these venues may fill or fund the order, within the account's allowed venues. A single venue sends the order only there, and the order is refused if that venue can't fill it. Omit to use every allowed venue.
Minimum array length: 1
Available options:
kalshi,
polymarket,
polymarket_us,
hyperliquid
best_price
boolean
default:false
Buy at the best price across venues: when a route across venues that moves cash from another venue would cost less in all than buying where the account's cash is, the buy goes through that route. Needs the route scope. A test key prices a route at the order's limit, so there it wins only when the direct buy's fees cost more. Sells already sell across every venue that holds shares, so this does not change them.
Response
The order as recorded after every venue answered, or the original on replay. Venue outcomes are statuses, not errors: an ioc reads canceled with status_reason.code IOC_REMAINDER_CANCELED when the venue canceled what did not fill at once, with filled_quantity 0 if nothing matched, a venue rejection reads rejected, and a submit the venue did not confirm reads unconfirmed. Each leg carries its own status and status_reason. A routed buy has no legs and route names its funding and execution venues: a live one stays pending while the router moves the payment, and a test one is filled by the simulator
Option 1
Option 2
success
enum<boolean>
required
Available options:
true
data
object
required
Hide child attributes
data.id
string<uuid>
required
data.client_order_id
string
required
Minimum string length: 1
data.market_id
string
required
The market id from GET /markets, however the request named the market.
Minimum string length: 1
data.title
string | null
required
Minimum string length: 1
data.outcome
string | null
required
Minimum string length: 1
data.venue
enum<string> | null
required
Available options:
kalshi,
polymarket,
polymarket_us,
hyperliquid
data.ticker
string | null
required
Minimum string length: 1
data.side
enum<string> | null
required
Available options:
yes,
no
data.action
enum<string>
required
Available options:
buy,
sell
data.type
enum<string>
required
Available options:
limit,
market
data.time_in_force
enum<string>
required
Available options:
gtc,
ioc,
fok,
gtd
data.expires_at
string<date-time> | null
required
data.quantity
string
required
Pattern: ^\d+(?:\.\d+)?$
data.filled_quantity
string
required
Pattern: ^\d+(?:\.\d+)?$
data.remaining_quantity
string
required
Shares still working on the venues: the unfilled size of each live venue order. Zero once the order is final, since a canceled, expired or rejected remainder no longer works.
Pattern: ^\d+(?:\.\d+)?$
data.limit_price
string
required
data.avg_fill_price
string | null
required
Average price per share filled, size-weighted across the venue orders that filled, excluding fees. Null until every filled venue order has a price.
data.notional_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
data.filled_notional_usd
string | null
required
Pattern: ^\d+(?:\.\d+)?$
data.status
enum<string>
required
Available options:
pending,
open,
partially_filled,
filled,
canceled,
rejected,
expired,
unconfirmed,
needs_attention,
cancel_requested
data.venue_status
string | null
required
data.venue_order_id
string | null
required
data.status_reason
object | null
required
Hide child attributes
data.status_reason.code
string
required
Minimum string length: 1
data.status_reason.message
string
required
Minimum string length: 1
data.legs
object[]
required
Hide child attributes
data.legs.venue
enum<string>
required
Available options:
kalshi,
polymarket,
polymarket_us,
hyperliquid
data.legs.ticker
string
required
Minimum string length: 1
data.legs.side
enum<string>
required
Available options:
yes,
no
data.legs.quantity
string
required
Pattern: ^\d+(?:\.\d+)?$
data.legs.filled_quantity
string
required
Pattern: ^\d+(?:\.\d+)?$
data.legs.limit_price
string
required
data.legs.avg_fill_price
string | null
required
data.legs.status
enum<string>
required
Available options:
pending,
open,
partially_filled,
filled,
canceled,
rejected,
expired,
unconfirmed,
needs_attention,
cancel_requested
data.legs.venue_status
string | null
required
data.legs.venue_order_id
string | null
required
data.legs.cancel_requested_at
string<date-time> | null
required
data.legs.status_reason
object | null
required
Hide child attributes
data.legs.status_reason.code
string
required
Minimum string length: 1
data.legs.status_reason.message
string
required
Minimum string length: 1
data.post_only
boolean
required
data.replaces_order_id
string<uuid> | null
required
data.replaced_by_order_id
string<uuid> | null
required
data.created_at
string<date-time>
required
data.updated_at
string<date-time>
required
data.livemode
boolean
required
data.route
object | null
required
Hide child attributes
data.route.funding_venue
enum<string>
required
Available options:
polymarket,
hyperliquid
data.route.execution_venue
enum<string>
required
Available options:
polymarket,
hyperliquid
data.route.notional_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
data.route.costs
object
required
Hide child attributes
data.route.costs.rebalance_fee_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
data.route.costs.gas_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
data.route.costs.activation_fee_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
data.route.costs.network_cost_usd
string
required
Pattern: ^\d+(?:\.\d+)?$
meta
object
required
Hide child attributes
meta.timestampMs
integer
required
Required range: x >= 0
meta.requestId
string
required
Minimum string length: 1
meta.traceId
string
Minimum string length: 1
meta.cachedAtMs
integer
Required range: x >= 0
meta.source
enum<string>
Available options:
cache,
database,
clickhouse,
upstream,
fallback,
internal
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Lean API","colors":{"primary":"#2F5BFF","light":"#8EA6FF","dark":"#3D66FF"},"logo":{"light":"https://mintcdn.com/lean/aK_dPkAAQjEsgndO/logo/light.svg?fit=max\u0026auto=format\u0026n=aK_dPkAAQjEsgndO\u0026q=85\u0026s=6f5d064937ce6cfedc8198e9ba927287","dark":"https://mintcdn.com/lean/aK_dPkAAQjEsgndO/logo/dark.svg?fit=max\u0026auto=format\u0026n=aK_dPkAAQjEsgndO\u0026q=85\u0026s=6d4c29348beb6f1c14aa1aecb4003afd","href":"/"},"api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"all","languages":["curl","python","javascript"],"prefill":true}},"appearance":{"default":"light"},"background":{"color":{"light":"#FFFFFF","dark":"#0C0F17"}},"navbar":{"links":[{"href":"https://lean.mintlify.site/api-reference/openapi.json","label":"OpenAPI spec"}],"primary":{"type":"button","label":"Quickstart","href":"/quickstart"}},"footer":{"links":[{"header":"Lean API v0.1","items":[{"label":"Limitations","href":"/"},{"label":"Changelog","href":"/changelog"},{"label":"OpenAPI spec","href":"https://lean.mintlify.site/api-reference/openapi.json"}]}]},"fonts":{"family":"Geist"},"styling":{"codeblocks":"dark","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","mcp"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lean","hasAudioNarration":false,"actualSubdomain":"lean","customDomains":[],"gitSource":{"type":"github","owner":"nivasaurus","repo":"lean-api-docs-demo","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6ae2d9189e92e136d8b49833"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6afba544821a1e85a5162553","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"API reference","count":62},{"language":"default","tag":"Guides","count":32},{"language":"default","tag":"Orders","count":13},{"language":"default","tag":"Use cases","count":13},{"language":"default","tag":"API keys","count":11},{"language":"default","tag":"Account","count":9},{"language":"default","tag":"Markets","count":7},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Transfers","count":5},{"language":"default","tag":"Limit chases","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n:root{--lean-ink: #09090b;--lean-ink-2: #2b2d34;--lean-slate: #5d6270;--lean-faint: #8a8f9c;--lean-line: #e7e8ec;--lean-line-2: #f0f1f4;--lean-mist: #f7f8fa;--lean-cobalt: #2f5bff;--lean-cobalt-ink: #1f43d6;--lean-night: #0c0f17;--lean-night-2: #131826;--lean-night-line: #1f2536}code,pre,kbd{font-family:'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace}.prose h1,.prose h2,.prose h3{letter-spacing:-0.025em;font-weight:600}.prose h2{padding-top:28px;border-top:1px solid var(--lean-line)}.dark .prose h2{border-top-color:#ffffff14}.prose :not(pre)>code{font-size:.86em;background:var(--lean-mist);border:1px solid var(--lean-line-2);padding:1px 5px;border-radius:5px;color:var(--lean-ink-2)}.dark .prose :not(pre)>code{background:#ffffff0d;border-color:#ffffff14;color:#e6e9f2}.prose table{font-size:14px}.prose thead th{font-weight:500;font-size:13px;color:var(--lean-faint);border-bottom:1px solid var(--lean-ink)}.prose tbody td{border-bottom:1px solid var(--lean-line-2);vertical-align:top}.dark .prose thead th{border-bottom-color:#ffffff55}.dark .prose tbody td{border-bottom-color:#ffffff12}#content-area:has(.lean-hero)>#header{display:none}#content-area:has(.lean-hero)>#content{margin-top:0}.lean-hero{background:var(--lean-night);color:#fff;border-radius:18px;padding:56px 48px;margin:8px 0 56px;border:1px solid var(--lean-night-line);background-image:radial-gradient(1200px 400px at 85% -10%, #2f5bff33, transparent 60%)}.lean-kicker{display:inline-flex;align-items:center;gap:10px;font-size:13px;color:#b9c1d4;border:1px solid #ffffff1f;background:#ffffff08;border-radius:999px;padding:5px 14px 5px 6px;margin-bottom:24px}.lean-kicker b{font:500 11.5px/1 'Geist Mono', monospace;color:#fff;background:var(--lean-cobalt);border-radius:999px;padding:5px 8px}.lean-hero h1.lean-title{font-size:clamp(36px, 4.6vw, 56px);line-height:1.04;letter-spacing:-0.045em;font-weight:600;margin:0 0 20px;max-width:14ch;color:#fff;border:0;padding:0}.lean-lede{font-size:18px;line-height:1.6;color:#aeb6c8;max-width:48ch;margin:0 0 32px}.lean-cta{display:flex;gap:12px;flex-wrap:wrap}.lean-btn{display:inline-flex;align-items:center;height:40px;padding:0 18px;border-radius:10px;font-size:14.5px;font-weight:500;text-decoration:none!important;border:1px solid transparent}.lean-btn-primary{background:var(--lean-cobalt);color:#fff!important}.lean-btn-primary:hover{background:var(--lean-cobalt-ink)}.lean-btn-ghost{color:#fff!important;border-color:#ffffff2e;background:#ffffff08}.lean-btn-ghost:hover{background:#ffffff14;border-color:#ffffff44}.lean-facts{display:flex;flex-wrap:wrap;gap:20px 36px;margin-top:44px;padding-top:24px;border-top:1px solid #ffffff14;color:#8d95a8;font-size:13.5px}.lean-facts strong{display:block;color:#fff;font-weight:500;font-size:15px;margin-bottom:2px}.lean-steps{list-style:none;margin:24px 0 8px;padding:0!important;display:grid;grid-template-columns:repeat(5, minmax(0, 1fr));border-top:1px solid var(--lean-ink)}.dark .lean-steps{border-top-color:#ffffff55}.lean-steps li{padding:20px 20px 4px 0;margin:0!important}.lean-steps li+li{padding-left:20px;border-left:1px solid var(--lean-line)}.dark .lean-steps li+li{border-left-color:#ffffff14}.lean-steps li::marker{content:none}.lean-step-n{font:500 13px/1 'Geist Mono', monospace;color:var(--lean-faint);display:block;margin-bottom:28px}.lean-steps h3{font-size:16px;margin:0 0 6px;border:0;padding:0}.lean-steps p{margin:0 0 14px;color:var(--lean-slate);font-size:14px;line-height:1.6}.dark .lean-steps p{color:#9aa2b5}.lean-chip{display:inline-flex;flex-wrap:wrap;gap:8px;align-items:center;max-width:100%;padding:7px 10px;border-radius:8px;background:var(--lean-mist);border:1px solid var(--lean-line);font:500 12.5px/1.2 'Geist Mono', monospace;color:var(--lean-ink-2)!important;text-decoration:none!important;border-bottom-width:1px!important}.lean-chip:hover{border-color:#cfd3dc;color:var(--lean-ink)!important}.lean-chip code{background:none!important;border:0!important;padding:0!important;font:inherit!important;color:inherit!important}.dark .lean-chip{background:var(--lean-night-2);border-color:var(--lean-night-line);color:#d5dae6!important}.dark .lean-chip:hover{border-color:#3a4258;color:#fff!important}.lean-verb{font:600 10.5px/1 'Geist Mono', monospace;letter-spacing:.02em;padding:3px 5px;border-radius:4px}.lean-verb-get{color:#0f8a5f;background:#e7f6ef}.lean-verb-post{color:#2f5bff;background:#eef2ff}.dark .lean-verb-get{color:#4fd1a0;background:#0f8a5f26}.dark .lean-verb-post{color:#8ea6ff;background:#2f5bff26}@media (max-width: 1279px){.lean-steps{grid-template-columns:repeat(2, minmax(0, 1fr))}.lean-steps li,.lean-steps li+li{padding:20px 20px 16px 0;border-left:0;border-bottom:1px solid var(--lean-line)}.dark .lean-steps li,.dark .lean-steps li+li{border-bottom-color:#ffffff14}.lean-step-n{margin-bottom:14px}}@media (max-width: 700px){.lean-hero{padding:40px 24px}.lean-steps{grid-template-columns:1fr}}body,body *{-webkit-hyphens:none!important;hyphens:none!important}"}],"page":{"pagePath":"api-reference/orders/create-order","slug":"/api-reference/orders/create-order","pageMetadata":{"title":"Create an order","openapi":"api-reference/openapi.json POST /orders","description":"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and `route` names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.","href":"/api-reference/orders/create-order"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and \", _jsx(_components.code, {\n children: \"route\"\n }), \" names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/\", \"/execute instead.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Create an order","openapi":"api-reference/openapi.json POST /orders","description":"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and `route` names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.","href":"/api-reference/orders/create-order"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createOrder","summary":"Place an order","description":"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and `route` names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.","tags":["Orders"],"requestBody":"04e4e6ec-78d2-4168-ba02-ac22f38fe253","responses":{"200":"5b25bb77-4b7c-47db-be01-aae4a08e00d4","400":"2e9d7b08-48a7-42b8-b612-20503f591a3c","401":"12b8087e-aefa-4003-ab7d-bf8c3ec82c0f","403":"9f024bde-1017-463b-94b7-acfd8af78b0a","404":"9db784eb-6817-4a92-b001-f2790ed938d8","409":"432d3165-1d8c-4f7d-a29d-f65857d59c4f","422":"9027fb7a-bd45-45d5-b215-e72ad9d72481","429":"9b5c5861-b4c0-4fe0-8caa-43481148be9d","500":"e4bd1f50-2de7-48d7-983a-35b9fa7cce7d","503":"1144dcb5-55a4-4a1b-ae87-f9bae3e59514"},"method":"post","type":"path","servers":["b9d200f3-058d-4de6-ac62-d3daef380488"],"security":["c7e5b678-a356-44de-a8fa-4ee7f0d1c1fd"],"path":"/orders","baseUrlOptions":["{baseUrl}/v1"],"title":"Place an order","codeSamples":[],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.client_order_id":"bot-0001","body.market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","body.action":"buy","body.quantity":"10","body.limit_price":"0.55","body.type":"limit","body.time_in_force":"gtc","body.all_or_none":false,"body.post_only":false,"body.best_price":false}]},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_order_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"Unique per API key. Replaying an id returns the original order.","isRequired":true,"uniqueKey":"client_order_id","typeLabel":"string"},"market_id":{"type":"string","minLength":1,"maxLength":512,"description":"A market id from GET /markets, or a venue symbol that names one market: a Polymarket token id, a Hyperliquid book coin (`#…`, written `%23…` in a path), or a leg `ticker` (`pm:…`, `hl:…`, `pmus:…` or a Kalshi market ticker) that lists only this outcome. A symbol that names more than one market, such as a Polymarket condition id, is refused with 400; use the token id or the market id instead. An order named by a venue symbol trades only that listing, so it is refused when `venues` leaves out the symbol's venue. A buy routed automatically still buys that listing, paid from the other venue. The order is stored under the market id.","isRequired":true,"uniqueKey":"market_id","typeLabel":"string"},"action":{"type":"string","enum":["buy","sell"],"isRequired":true,"uniqueKey":"action","typeLabel":"enum\u003cstring>"},"quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","description":"Shares, in 0.01 steps. Send exactly one of quantity or notional. A sell of the whole position, as held or written to two decimals, sells what each venue's increment allows and keeps the rest.","uniqueKey":"quantity","typeLabel":"string"},"notional":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,2})?$","description":"Dollars to spend on an ioc or fok buy, in place of quantity, at most two decimals. The buy walks the books from the best price and never spends more than this before fees; Lean works out the shares. Sells and resting orders are sized with quantity.","uniqueKey":"notional","typeLabel":"string"},"limit_price":{"type":"string","description":"Worst price per share you accept, in dollars. Required with quantity on a limit order. With notional or on a market order it defaults to 0.99 for a buy and 0.01 for a sell; a market order is then placed 1 cent past the worst price its quantity reaches in the book, tightened by max_slippage_bps when set.","uniqueKey":"limit_price","typeLabel":"string"},"type":{"type":"string","enum":["limit","market"],"default":"limit","description":"limit trades at limit_price or better. market trades at once at the best prices: it needs time_in_force ioc or fok, and each venue order is placed 1 cent past the worst price its quantity reaches in the book of that venue. limit_price and max_slippage_bps are optional extra caps on the worst price it accepts.","uniqueKey":"type","typeLabel":"enum\u003cstring>"},"time_in_force":{"type":"string","enum":["gtc","ioc","fok","gtd"],"default":"gtc","description":"gtc rests until filled or canceled. ioc fills what it can at once and cancels the rest. fok fills the whole order at once or cancels all of it, and is placed whole on one venue: Polymarket, else Kalshi, else Polymarket US, since Hyperliquid has no fill or kill. gtd rests like gtc until expires_at, and is placed on Kalshi, Polymarket and Polymarket US, since Hyperliquid has no order expiry. Polymarket takes an ioc or fok buy only by dollar amount: one sized with notional can fill there, while one sized with quantity goes only to the other venues, and when Polymarket is the only one it is refused with 400 VALIDATION_ERROR, so send it with notional or as gtc. notional needs ioc or fok.","uniqueKey":"time_in_force","typeLabel":"enum\u003cstring>"},"expires_at":{"type":"string","format":"date-time","description":"When a gtd order expires, as an ISO 8601 time. Required with gtd and refused with any other time_in_force. At least 3 minutes and at most 30 days ahead. Whatever has not filled by then is canceled, and the order reads expired.","uniqueKey":"expires_at","typeLabel":"string\u003cdate-time>"},"max_slippage_bps":{"type":"integer","minimum":0,"maximum":10000,"description":"Optional extra cap: the furthest each venue order may trade from that venue's own best price, in basis points; overrides the account's max_slippage_bps. Each venue is measured against its own book, not the best price across venues, so venues quoting different prices can each fill. Never looser than limit_price. Without one, a limit order trades to its limit and a market order to 1 cent past the worst price its quantity reaches in the book, as the Lean trading terminal places it.","uniqueKey":"max_slippage_bps","typeLabel":"integer"},"all_or_none":{"type":"boolean","default":false,"description":"Refuse the order unless the books, as read, fill the whole quantity within the slippage bound. Needs time_in_force ioc or fok. Best effort: venue orders are placed separately and books can move between the read and the fill, so a partial fill is still possible.","uniqueKey":"all_or_none","typeLabel":"boolean"},"post_only":{"type":"boolean","default":false,"description":"Only rest on the book, never take. Needs time_in_force gtc, cannot take best_price, and is placed on Kalshi, Polymarket US and Hyperliquid, since Polymarket cannot rest post-only. An order that would trade at once against the books, as read, is refused with reason POST_ONLY_WOULD_CROSS, and the venue rejects one that would trade by the time it arrives.","uniqueKey":"post_only","typeLabel":"boolean"},"venues":{"type":"array","items":{"type":"string","enum":["kalshi","polymarket","polymarket_us","hyperliquid"],"uniqueKey":"venues.items.[INDEX]","typeLabel":"enum\u003cstring>"},"minItems":1,"description":"Only these venues may fill or fund the order, within the account's allowed venues. A single venue sends the order only there, and the order is refused if that venue can't fill it. Omit to use every allowed venue.","uniqueKey":"venues","typeLabel":"enum\u003cstring>[]"},"best_price":{"type":"boolean","default":false,"description":"Buy at the best price across venues: when a route across venues that moves cash from another venue would cost less in all than buying where the account's cash is, the buy goes through that route. Needs the route scope. A test key prices a route at the order's limit, so there it wins only when the direct buy's fees cost more. Sells already sell across every venue that holds shares, so this does not change them.","uniqueKey":"best_price","typeLabel":"boolean"}},"required":["client_order_id","market_id","action"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"client_order_id":"bot-0001","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","action":"buy","type":"limit","quantity":"10","limit_price":"0.55","time_in_force":"gtc","all_or_none":false,"post_only":false,"best_price":false},"examples":{"Example":{"title":"Example","value":{"client_order_id":"bot-0001","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","action":"buy","type":"limit","quantity":"10","limit_price":"0.55","time_in_force":"gtc","all_or_none":false,"post_only":false,"best_price":false}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"5b25bb77-4b7c-47db-be01-aae4a08e00d4":{"description":"The order as recorded after every venue answered, or the original on replay. Venue outcomes are statuses, not errors: an ioc reads canceled with status_reason.code IOC_REMAINDER_CANCELED when the venue canceled what did not fill at once, with filled_quantity 0 if nothing matched, a venue rejection reads rejected, and a submit the venue did not confirm reads unconfirmed. Each leg carries its own status and status_reason. A routed buy has no legs and `route` names its funding and execution venues: a live one stays pending while the router moves the payment, and a test one is filled by the simulator","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","enum":[true],"isRequired":true,"uniqueKey":"oneOf.0.success","typeLabel":"enum\u003cboolean>"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.data.id","typeLabel":"string\u003cuuid>"},"client_order_id":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.client_order_id","typeLabel":"string"},"market_id":{"type":"string","minLength":1,"description":"The market id from GET /markets, however the request named the market.","isRequired":true,"uniqueKey":"oneOf.0.data.market_id","typeLabel":"string"},"title":{"oneOf":[{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.title.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.title.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.title","typeLabel":"string | null"},"outcome":{"oneOf":[{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.outcome.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.outcome.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.outcome","typeLabel":"string | null"},"venue":{"oneOf":[{"type":"string","enum":["kalshi","polymarket","polymarket_us","hyperliquid"],"isRequired":true,"uniqueKey":"oneOf.0.data.venue.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["kalshi","polymarket","polymarket_us","hyperliquid"],"isRequired":true,"uniqueKey":"oneOf.0.data.venue.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.venue","typeLabel":"enum\u003cstring> | null"},"ticker":{"oneOf":[{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.ticker.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.ticker.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.ticker","typeLabel":"string | null"},"side":{"oneOf":[{"type":"string","enum":["yes","no"],"isRequired":true,"uniqueKey":"oneOf.0.data.side.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["yes","no"],"isRequired":true,"uniqueKey":"oneOf.0.data.side.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.side","typeLabel":"enum\u003cstring> | null"},"action":{"type":"string","enum":["buy","sell"],"isRequired":true,"uniqueKey":"oneOf.0.data.action","typeLabel":"enum\u003cstring>"},"type":{"type":"string","enum":["limit","market"],"isRequired":true,"uniqueKey":"oneOf.0.data.type","typeLabel":"enum\u003cstring>"},"time_in_force":{"type":"string","enum":["gtc","ioc","fok","gtd"],"isRequired":true,"uniqueKey":"oneOf.0.data.time_in_force","typeLabel":"enum\u003cstring>"},"expires_at":{"oneOf":[{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.expires_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.expires_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.expires_at","typeLabel":"string\u003cdate-time> | null"},"quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.quantity","typeLabel":"string"},"filled_quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.filled_quantity","typeLabel":"string"},"remaining_quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","description":"Shares still working on the venues: the unfilled size of each live venue order. Zero once the order is final, since a canceled, expired or rejected remainder no longer works.","isRequired":true,"uniqueKey":"oneOf.0.data.remaining_quantity","typeLabel":"string"},"limit_price":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.limit_price","typeLabel":"string"},"avg_fill_price":{"oneOf":[{"type":"string","description":"Average price per share filled, size-weighted across the venue orders that filled, excluding fees. Null until every filled venue order has a price.","isRequired":true,"uniqueKey":"oneOf.0.data.avg_fill_price.oneOf.0","typeLabel":"string"},{"type":"null","description":"Average price per share filled, size-weighted across the venue orders that filled, excluding fees. Null until every filled venue order has a price.","isRequired":true,"uniqueKey":"oneOf.0.data.avg_fill_price.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.avg_fill_price","typeLabel":"string | null"},"notional_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.notional_usd","typeLabel":"string"},"filled_notional_usd":{"oneOf":[{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.filled_notional_usd.oneOf.0","typeLabel":"string"},{"type":"null","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.filled_notional_usd.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.filled_notional_usd","typeLabel":"string | null"},"status":{"type":"string","enum":["pending","open","partially_filled","filled","canceled","rejected","expired","unconfirmed","needs_attention","cancel_requested"],"isRequired":true,"uniqueKey":"oneOf.0.data.status","typeLabel":"enum\u003cstring>"},"venue_status":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.venue_status.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.data.venue_status.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.venue_status","typeLabel":"string | null"},"venue_order_id":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.venue_order_id.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.data.venue_order_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.venue_order_id","typeLabel":"string | null"},"status_reason":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.status_reason.oneOf.0.code","typeLabel":"string"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.status_reason.oneOf.0.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"oneOf.0.data.status_reason.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1}},"required":["code","message"],"isRequired":true,"uniqueKey":"oneOf.0.data.status_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.status_reason","typeLabel":"object | null"},"legs":{"type":"array","items":{"type":"object","properties":{"venue":{"type":"string","enum":["kalshi","polymarket","polymarket_us","hyperliquid"],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue","typeLabel":"enum\u003cstring>"},"ticker":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].ticker","typeLabel":"string"},"side":{"type":"string","enum":["yes","no"],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].side","typeLabel":"enum\u003cstring>"},"quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].quantity","typeLabel":"string"},"filled_quantity":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].filled_quantity","typeLabel":"string"},"limit_price":{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].limit_price","typeLabel":"string"},"avg_fill_price":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].avg_fill_price.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].avg_fill_price.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].avg_fill_price","typeLabel":"string | null"},"status":{"type":"string","enum":["pending","open","partially_filled","filled","canceled","rejected","expired","unconfirmed","needs_attention","cancel_requested"],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"venue_status":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_status.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_status.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_status","typeLabel":"string | null"},"venue_order_id":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_order_id.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_order_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].venue_order_id","typeLabel":"string | null"},"cancel_requested_at":{"oneOf":[{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].cancel_requested_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].cancel_requested_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].cancel_requested_at","typeLabel":"string\u003cdate-time> | null"},"status_reason":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status_reason.oneOf.0.code","typeLabel":"string"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status_reason.oneOf.0.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status_reason.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1}},"required":["code","message"],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.legs.items.[INDEX].status_reason","typeLabel":"object | null"}},"required":["venue","ticker","side","quantity","filled_quantity","limit_price","avg_fill_price","status","venue_status","venue_order_id","cancel_requested_at","status_reason"],"uniqueKey":"oneOf.0.data.legs.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.0.data.legs","typeLabel":"object[]"},"post_only":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.data.post_only","typeLabel":"boolean"},"replaces_order_id":{"oneOf":[{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.data.replaces_order_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.data.replaces_order_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.replaces_order_id","typeLabel":"string\u003cuuid> | null"},"replaced_by_order_id":{"oneOf":[{"type":"string","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.data.replaced_by_order_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","format":"uuid","isRequired":true,"uniqueKey":"oneOf.0.data.replaced_by_order_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.replaced_by_order_id","typeLabel":"string\u003cuuid> | null"},"created_at":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.0.data.updated_at","typeLabel":"string\u003cdate-time>"},"livemode":{"type":"boolean","isRequired":true,"uniqueKey":"oneOf.0.data.livemode","typeLabel":"boolean"},"route":{"oneOf":[{"type":"object","properties":{"funding_venue":{"type":"string","enum":["polymarket","hyperliquid"],"isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.funding_venue","typeLabel":"enum\u003cstring>"},"execution_venue":{"type":"string","enum":["polymarket","hyperliquid"],"isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.execution_venue","typeLabel":"enum\u003cstring>"},"notional_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.notional_usd","typeLabel":"string"},"costs":{"type":"object","properties":{"rebalance_fee_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.costs.rebalance_fee_usd","typeLabel":"string"},"gas_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.costs.gas_usd","typeLabel":"string"},"activation_fee_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.costs.activation_fee_usd","typeLabel":"string"},"network_cost_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$","isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.costs.network_cost_usd","typeLabel":"string"}},"required":["rebalance_fee_usd","gas_usd","activation_fee_usd","network_cost_usd"],"isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0.costs","typeLabel":"object"}},"required":["funding_venue","execution_venue","notional_usd","costs"],"isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.0","typeLabel":"object"},{"type":"null","properties":{"funding_venue":{"type":"string","enum":["polymarket","hyperliquid"]},"execution_venue":{"type":"string","enum":["polymarket","hyperliquid"]},"notional_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"costs":{"type":"object","properties":{"rebalance_fee_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"gas_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"activation_fee_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"},"network_cost_usd":{"type":"string","pattern":"^\\d+(?:\\.\\d+)?$"}},"required":["rebalance_fee_usd","gas_usd","activation_fee_usd","network_cost_usd"]}},"required":["funding_venue","execution_venue","notional_usd","costs"],"isRequired":true,"uniqueKey":"oneOf.0.data.route.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.data.route","typeLabel":"object | null"}},"required":["id","client_order_id","market_id","title","outcome","venue","ticker","side","action","type","time_in_force","expires_at","quantity","filled_quantity","remaining_quantity","limit_price","avg_fill_price","notional_usd","filled_notional_usd","status","venue_status","venue_order_id","status_reason","legs","post_only","replaces_order_id","replaced_by_order_id","created_at","updated_at","livemode","route"],"isRequired":true,"uniqueKey":"oneOf.0.data","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"oneOf.0.meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.0.meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"oneOf.0.meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"oneOf.0.meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"oneOf.0.meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"oneOf.0.meta","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["success","error","meta"],"properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"oneOf.1.success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"oneOf.1.error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"oneOf.1.error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"oneOf.1.error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"oneOf.1.meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"oneOf.1.meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"oneOf.1.meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"oneOf.1.meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"oneOf.1.meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"oneOf.1.meta","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Filled":{"title":"Filled","summary":"An ioc order that filled","value":{"success":true,"data":{"id":"3f6c2a8e-91d4-4b7a-8c25-0e4d7b19a6f3","client_order_id":"bot-2026-10-29-0001","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"ioc","expires_at":null,"quantity":"5","filled_quantity":"5","remaining_quantity":"0","limit_price":"0.50","avg_fill_price":"0.47","notional_usd":"2.5","filled_notional_usd":"2.35","status":"filled","venue_status":"filled","venue_order_id":"91234567012","status_reason":null,"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"5","limit_price":"0.50","avg_fill_price":"0.47","status":"filled","venue_status":"filled","venue_order_id":"91234567012","cancel_requested_at":null,"status_reason":null},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"5","limit_price":"0.50","avg_fill_price":"0.47","status":"filled","venue_status":"filled","venue_order_id":"91234567012","cancel_requested_at":null,"status_reason":null}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.587Z","livemode":true,"route":null},"meta":{"timestampMs":1791741602600,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Resting":{"title":"Resting","summary":"A gtc order on the book","value":{"success":true,"data":{"id":"8a1e5c07-4b3f-4d62-9f18-2c7e0a95d4b1","client_order_id":"bot-2026-10-29-0002","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"gtc","expires_at":null,"quantity":"10","filled_quantity":"0","remaining_quantity":"10","limit_price":"0.45","avg_fill_price":null,"notional_usd":"4.5","filled_notional_usd":"0","status":"open","venue_status":"open","venue_order_id":"91234567388","status_reason":null,"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"10","filled_quantity":"0","limit_price":"0.45","avg_fill_price":null,"status":"open","venue_status":"open","venue_order_id":"91234567388","cancel_requested_at":null,"status_reason":null},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"10","filled_quantity":"0","limit_price":"0.45","avg_fill_price":null,"status":"open","venue_status":"open","venue_order_id":"91234567388","cancel_requested_at":null,"status_reason":null}],"created_at":"2026-10-11T18:04:40.902Z","updated_at":"2026-10-11T18:04:41.317Z","livemode":true,"route":null},"meta":{"timestampMs":1791741881330,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Split":{"title":"Split","summary":"A buy split across two venues","value":{"success":true,"data":{"id":"6b0f3d92-1e7c-4a85-b3d6-9c4a2f01e7b5","client_order_id":"bot-2026-10-29-0003","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":null,"ticker":null,"side":null,"action":"buy","type":"limit","time_in_force":"ioc","expires_at":null,"quantity":"40","filled_quantity":"40","remaining_quantity":"0","limit_price":"0.50","avg_fill_price":"0.48375","notional_usd":"20","filled_notional_usd":"19.35","status":"filled","venue_status":null,"venue_order_id":null,"status_reason":null,"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"25","filled_quantity":"25","limit_price":"0.50","avg_fill_price":"0.48","status":"filled","venue_status":"filled","venue_order_id":"91234567455","cancel_requested_at":null,"status_reason":null},{"venue":"polymarket","ticker":"\u003cvenue ticker>","side":"yes","quantity":"15","filled_quantity":"15","limit_price":"0.50","avg_fill_price":"0.49","status":"filled","venue_status":"filled","venue_order_id":"0x\u003cvenue order id>","cancel_requested_at":null,"status_reason":null},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"25","filled_quantity":"25","limit_price":"0.50","avg_fill_price":"0.48","status":"filled","venue_status":"filled","venue_order_id":"91234567455","cancel_requested_at":null,"status_reason":null},{"venue":"polymarket","ticker":"\u003cvenue ticker>","side":"yes","quantity":"15","filled_quantity":"15","limit_price":"0.50","avg_fill_price":"0.49","status":"filled","venue_status":"filled","venue_order_id":"0x\u003cvenue order id>","cancel_requested_at":null,"status_reason":null}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.587Z","livemode":true,"route":null},"meta":{"timestampMs":1791741603020,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Test order":{"title":"Test order","summary":"A test key: filled in full at the limit price, nothing sent to a venue","value":{"success":true,"data":{"id":"4c8e1f53-0a7d-4b29-96e4-d3b5a2f8c107","client_order_id":"bot-2026-10-29-0001","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"ioc","expires_at":null,"quantity":"5","filled_quantity":"5","remaining_quantity":"0","limit_price":"0.50","avg_fill_price":"0.50","notional_usd":"2.5","filled_notional_usd":"2.5","status":"filled","venue_status":null,"venue_order_id":null,"status_reason":null,"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"5","limit_price":"0.50","avg_fill_price":"0.50","status":"filled","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":null},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"5","limit_price":"0.50","avg_fill_price":"0.50","status":"filled","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":null}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.114Z","livemode":false,"route":null},"meta":{"timestampMs":1791741602130,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Unfilled ioc":{"title":"Unfilled ioc","summary":"An ioc order that matched nothing: canceled, 0 filled","value":{"success":true,"data":{"id":"5b7d0e2c-3a91-4f68-b4c2-9e1f7a03d856","client_order_id":"bot-2026-10-29-0005","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"ioc","expires_at":null,"quantity":"5","filled_quantity":"0","remaining_quantity":"0","limit_price":"0.50","avg_fill_price":null,"notional_usd":"2.5","filled_notional_usd":"0","status":"canceled","venue_status":"canceled","venue_order_id":null,"status_reason":null,"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"canceled","venue_status":"canceled","venue_order_id":null,"cancel_requested_at":null,"status_reason":null},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"canceled","venue_status":"canceled","venue_order_id":null,"cancel_requested_at":null,"status_reason":null}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.587Z","livemode":true,"route":null},"meta":{"timestampMs":1791741602600,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Rejected":{"title":"Rejected","summary":"The venue refused the order","value":{"success":true,"data":{"id":"0e4a9c71-d25b-4f3e-8a60-1b7c5d2e9f48","client_order_id":"bot-2026-10-29-0006","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"gtc","expires_at":null,"quantity":"5","filled_quantity":"0","remaining_quantity":"0","limit_price":"0.50","avg_fill_price":null,"notional_usd":"2.5","filled_notional_usd":"0","status":"rejected","venue_status":null,"venue_order_id":null,"status_reason":{"code":"VENUE_REJECTED","message":"\u003cvenue message>"},"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"rejected","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":{"code":"VENUE_REJECTED","message":"\u003cvenue message>"}},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"rejected","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":{"code":"VENUE_REJECTED","message":"\u003cvenue message>"}}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.587Z","livemode":true,"route":null},"meta":{"timestampMs":1791741602600,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Unconfirmed":{"title":"Unconfirmed","summary":"The venue did not confirm the order; read it back, do not resend","value":{"success":true,"data":{"id":"c83f1a6e-7b04-4d92-9e5a-2f6d0b8c4a17","client_order_id":"bot-2026-10-29-0007","market_id":"mkt_bmZsOjIwMjYtMTAtMTE6REVOLUxBQwpzcHJlYWQ6Z2FtZTpERU46LTMuNQpERU4","venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","action":"buy","type":"limit","time_in_force":"gtc","expires_at":null,"quantity":"5","filled_quantity":"0","remaining_quantity":"5","limit_price":"0.50","avg_fill_price":null,"notional_usd":"2.5","filled_notional_usd":"0","status":"unconfirmed","venue_status":null,"venue_order_id":null,"status_reason":{"code":"SUBMISSION_UNKNOWN","message":"The venue did not confirm this order. Read it back by client_order_id; do not resend it."},"post_only":false,"replaces_order_id":null,"replaced_by_order_id":null,"legs":[{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"unconfirmed","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":{"code":"SUBMISSION_UNKNOWN","message":"The venue did not confirm this order. Read it back by client_order_id; do not resend it."}},{"venue":"hyperliquid","ticker":"\u003cvenue ticker>","side":"yes","quantity":"5","filled_quantity":"0","limit_price":"0.50","avg_fill_price":null,"status":"unconfirmed","venue_status":null,"venue_order_id":null,"cancel_requested_at":null,"status_reason":{"code":"SUBMISSION_UNKNOWN","message":"The venue did not confirm this order. Read it back by client_order_id; do not resend it."}}],"created_at":"2026-10-11T18:00:02.114Z","updated_at":"2026-10-11T18:00:02.587Z","livemode":true,"route":null},"meta":{"timestampMs":1791741602600,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"2e9d7b08-48a7-42b8-b612-20503f591a3c":{"description":"The order terms are invalid or no venue takes them","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"market_gtc":{"title":"market_gtc","summary":"A market order that would rest","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"market orders need time_in_force ioc or fok"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"gtd_on_hyperliquid":{"title":"gtd_on_hyperliquid","summary":"gtd with only a Hyperliquid listing","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"gtd orders are placed on Kalshi, Polymarket, or Polymarket US, since Hyperliquid has no order expiry, and this order has none of them to go to"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"gtd_without_expiry":{"title":"gtd_without_expiry","summary":"gtd without expires_at","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"gtd orders need expires_at"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"Bad limit price":{"title":"Bad limit price","summary":"limit_price outside (0, 1)","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"limit_price must be strictly between 0 and 1"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"12b8087e-aefa-4003-ab7d-bf8c3ec82c0f":{"description":"Missing, invalid, expired or revoked API key","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Unknown key":{"title":"Unknown key","summary":"Unknown, expired or revoked key","value":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Invalid, expired or revoked API key"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Missing key":{"title":"Missing key","summary":"No Authorization header","value":{"success":false,"error":{"code":"UNAUTHORIZED","message":"Missing API key"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"9f024bde-1017-463b-94b7-acfd8af78b0a":{"description":"The key lacks the trade scope, or a routed buy found the account has not enabled trading in the Lean app (ACCOUNT_NOT_DELEGATED, with details.order_id); nothing was paid","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Missing scope":{"title":"Missing scope","summary":"The key lacks the trade scope","value":{"success":false,"error":{"code":"FORBIDDEN","message":"This API key lacks the trade scope"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"9db784eb-6817-4a92-b001-f2790ed938d8":{"description":"API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Not found":{"title":"Not found","summary":"Market not found","value":{"success":false,"error":{"code":"NOT_FOUND","message":"Market not found"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"432d3165-1d8c-4f7d-a29d-f65857d59c4f":{"description":"client_order_id was already used with a different request, or the Polymarket wallet changed while the order was being placed (for example its signer delegation was revoked). Nothing was placed in either case; for the wallet, check its signer delegation in Lean, then retry; the same client_order_id can be reused. A routed buy whose payment could not be authorized answers with details.reason (QUOTE_EXPIRED, ROUTE_MOVED, PAYMENT_MISMATCH, AGENT_APPROVAL_REQUIRED) and details.order_id; nothing was paid","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"client_order_id_reused":{"title":"client_order_id_reused","summary":"client_order_id reused with a different request","value":{"success":false,"error":{"code":"CONFLICT","message":"client_order_id was already used with a different request","details":{"order_id":"8a1e5c07-4b3f-4d62-9f18-2c7e0a95d4b1"}},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"polymarket_not_ready":{"title":"polymarket_not_ready","summary":"Polymarket wallet not ready for API orders","value":{"success":false,"error":{"code":"CONFLICT","message":"The Polymarket wallet is no longer ready for API orders. Check its signer delegation and try again."},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}}},"exampleType":"examples"}},"exampleType":"examples"},"9027fb7a-bd45-45d5-b215-e72ad9d72481":{"description":"Refused by a key limit or a check made before any venue was called; nothing was placed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"quantity_and_notional":{"title":"quantity_and_notional","summary":"Both or neither of quantity and notional","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"Send exactly one of quantity or notional"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"notional_gtc":{"title":"notional_gtc","summary":"notional on a resting order","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"notional needs time_in_force ioc or fok; size a resting order with quantity"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"notional_sell":{"title":"notional_sell","summary":"notional on a sell","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"notional sizes buys only; size a sell with quantity"},"meta":{"timestampMs":1792771200000,"requestId":"7d2c9f4e-1b3a-4e8d-9c6f-2a5b8e0d4f17"}}},"Per-order limit":{"title":"Per-order limit","summary":"quantity × limit_price is above the key limit","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"Order notional exceeds this key's per-order limit","details":{"reason":"ORDER_NOTIONAL_LIMIT","max_order_notional_micros":5000000}},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Insufficient funds":{"title":"Insufficient funds","summary":"No venue that could place it has the cash","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"The trading account cannot pay for this order on the venues that could place it","details":{"reason":"INSUFFICIENT_FUNDS"}},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Below minimum":{"title":"Below minimum","summary":"Too small for every venue that could place it","value":{"success":false,"error":{"code":"VALIDATION_ERROR","message":"Order notional is below the minimum of every venue that could place it","details":{"reason":"BELOW_VENUE_MINIMUM","min_order_notional_micros":1000000}},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"9b5c5861-b4c0-4fe0-8caa-43481148be9d":{"description":"API error","headers":{"Retry-After":{"description":"Seconds remaining in the upstream read cooldown, when available","schema":{"type":"integer","minimum":0}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Rate limited":{"title":"Rate limited","summary":"Over 5 requests a second; wait for Retry-After","value":{"success":false,"error":{"code":"RATE_LIMITED","message":"Too many requests for this API key"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"e4bd1f50-2de7-48d7-983a-35b9fa7cce7d":{"description":"API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Internal error":{"title":"Internal error","summary":"Unexpected server error","value":{"success":false,"error":{"code":"INTERNAL_ERROR","message":"An internal error occurred."},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"},"1144dcb5-55a4-4a1b-ae87-f9bae3e59514":{"description":"Order placement is unavailable. UPSTREAM_ERROR without details.order_id means a venue failed or timed out; look the order up by client_order_id before you resend it. FEATURE_DISABLED with details.reason LIVE_TRADING_DISABLED means live keys cannot place orders right now and test keys still can; TRADING_PAUSED with details.scope api_key or trading_account means this key or its account is paused until resumed from the dashboard. UPSTREAM_ERROR with details.order_id means a routed buy could not have its payment signed; nothing was paid","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"isRequired":true,"uniqueKey":"success","typeLabel":"enum\u003cboolean>"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","NOT_FOUND","UNAUTHORIZED","FORBIDDEN","CONFLICT","UPSTREAM_ERROR","RATE_LIMITED","INTERNAL_ERROR","FEATURE_DISABLED","CONDITIONAL_SELL_REJECTED","CONDITIONAL_SELL_ACTIVE"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"oneOf":[{},{"type":"null","uniqueKey":"error.details.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.details","typeLabel":"null"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"meta":{"type":"object","properties":{"timestampMs":{"type":"integer","minimum":0,"isRequired":true,"uniqueKey":"meta.timestampMs","typeLabel":"integer"},"requestId":{"type":"string","minLength":1,"isRequired":true,"uniqueKey":"meta.requestId","typeLabel":"string"},"traceId":{"type":"string","minLength":1,"uniqueKey":"meta.traceId","typeLabel":"string"},"cachedAtMs":{"type":"integer","minimum":0,"uniqueKey":"meta.cachedAtMs","typeLabel":"integer"},"source":{"type":"string","enum":["cache","database","clickhouse","upstream","fallback","internal"],"uniqueKey":"meta.source","typeLabel":"enum\u003cstring>"}},"required":["timestampMs","requestId"],"isRequired":true,"uniqueKey":"meta","typeLabel":"object"}},"required":["success","error","meta"],"uniqueKey":"","typeLabel":"object"},"examples":{"Venue failed":{"title":"Venue failed","summary":"A venue failed before anything was placed","value":{"success":false,"error":{"code":"UPSTREAM_ERROR","message":"Hyperliquid upstream request failed"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Live trading off":{"title":"Live trading off","summary":"A live key on an account where live trading is not enabled yet; test keys still work","value":{"success":false,"error":{"code":"FEATURE_DISABLED","message":"Live order placement is switched off. Test keys can still place simulated orders.","details":{"reason":"LIVE_TRADING_DISABLED"}},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}},"Key paused":{"title":"Key paused","summary":"This key paused itself with POST /v1/account/pause; resume from the dashboard","value":{"success":false,"error":{"code":"FEATURE_DISABLED","message":"Order placement is paused for this key: Strategy halted. Reads and cancels still work.","details":{"reason":"TRADING_PAUSED","scope":"api_key"}},"meta":{"timestampMs":1791741600000,"requestId":"4b8e1f27-9c3d-4a62-8e05-d7f9a1c3b640"}}},"Venue unavailable":{"title":"Venue unavailable","summary":"Retry later with the same client_order_id","value":{"success":false,"error":{"code":"UPSTREAM_ERROR","message":"Hyperliquid upstream request failed"},"meta":{"timestampMs":1791741600000,"requestId":"9d2f6b18-3e7a-4c05-b8d1-4f0a7e2c6b93"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"c7e5b678-a356-44de-a8fa-4ee7f0d1c1fd":{"apiKey":{"type":"http","scheme":"bearer","description":"A Lean API key, sent as `Authorization: Bearer \u003ckey>`. A test key (`lean_sk_test_...`) simulates orders and fills with no money; a live key (`lean_sk_live_...`) trades for real within the key's limits. Every successful response says which mode answered in `data.livemode`.","scopes":[],"schemeName":"apiKey"}}},"servers":{"b9d200f3-058d-4de6-ac62-d3daef380488":{"url":"{baseUrl}/v1","description":"Lean API","variables":{"baseUrl":{"default":"https://api.lean.xyz","description":"The Lean API base URL, without /v1. Same value as LEAN_API_URL in the guides."}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"A Lean API key, sent as `Authorization: Bearer \u003ckey>`. A test key (`lean_sk_test_...`) simulates orders and fills with no money; a live key (`lean_sk_live_...`) trades for real within the key's limits. Every successful response says which mode answered in `data.livemode`.","scopes":[],"schemeName":"apiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"A Lean API key, sent as `Authorization: Bearer \u003ckey>`. A test key (`lean_sk_test_...`) simulates orders and fills with no money; a live key (`lean_sk_live_...`) trades for real within the key's limits. Every successful response says which mode answered in `data.livemode`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"apiKey","name":"Authorization"}],"title":"apiKey"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"lean","siteName":"Lean API","title":"Create an order - Lean API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T23:47:19.418Z","originalFileLocation":"api-reference/orders/create-order.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Lean API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lean/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lean/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lean/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/lean/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create an order - Lean API\">\u003cmeta data-mint-head property=\"og:description\" content=\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Lean API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://lean.mintlify.app/api-reference/orders/create-order\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lean.mintlify.site/_mintlify/api/og/v2?division=Orders\u0026amp;title=Create+an+order\u0026amp;description=The+default+way+to+buy+across+venues%2C+in+one+call.+Lean+places+the+order+on+the+venues+that+can+fill+it.+A+buy+the+account+cannot+pay+for+on+those+venues+is+bou\u0026amp;theme=479271959554d25dc0271270\u0026amp;signature=cb545b364af92df12bd90972867fe7921ef79eb36d5250160a448f3bb5aacfb7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create an order - Lean API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lean.mintlify.site/_mintlify/api/og/v2?division=Orders\u0026amp;title=Create+an+order\u0026amp;description=The+default+way+to+buy+across+venues%2C+in+one+call.+Lean+places+the+order+on+the+venues+that+can+fill+it.+A+buy+the+account+cannot+pay+for+on+those+venues+is+bou\u0026amp;theme=479271959554d25dc0271270\u0026amp;signature=cb545b364af92df12bd90972867fe7921ef79eb36d5250160a448f3bb5aacfb7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/lean/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Lean API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2F5BFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://lean.mintlify.app/api-reference/orders/create-order\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/orders/create-order.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://lean.mintlify.app/#organization\",\"name\":\"Lean API\",\"url\":\"https://lean.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lean/aK_dPkAAQjEsgndO/logo/light.svg?fit=max\u0026auto=format\u0026n=aK_dPkAAQjEsgndO\u0026q=85\u0026s=6f5d064937ce6cfedc8198e9ba927287\"}},{\"@type\":\"WebSite\",\"@id\":\"https://lean.mintlify.app#website\",\"name\":\"Lean API\",\"url\":\"https://lean.mintlify.app\",\"publisher\":{\"@id\":\"https://lean.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://lean.mintlify.app/api-reference/orders/create-order#webpage\",\"url\":\"https://lean.mintlify.app/api-reference/orders/create-order\",\"name\":\"Create an order\",\"description\":\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.\",\"dateModified\":\"2026-11-12T23:47:19.418Z\",\"isPartOf\":{\"@id\":\"https://lean.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://lean.mintlify.app/api-reference/orders/create-order#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://lean.mintlify.app/api-reference/orders/create-order#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Orders\",\"item\":\"https://lean.mintlify.app/api-reference/orders/preview-order\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create an order\",\"item\":\"https://lean.mintlify.app/api-reference/orders/create-order\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://lean.mintlify.app/api-reference/orders/create-order#apireference\",\"headline\":\"Create an order\",\"name\":\"Create an order\",\"description\":\"The default way to buy across venues, in one call. Lean places the order on the venues that can fill it. A buy the account cannot pay for on those venues is bought through a route across venues instead when routing is on and the key has the route scope: Lean moves the money from the funding venue and buys on the execution venue, and route names both. A live key also needs the account to have enabled trading in the Lean app, because Lean signs the payment with its delegated signer; a test key routes against the simulator and never signs. Without a route, a buy the account cannot pay for is refused. To sign route payments yourself, use POST /v1/routed-orders and POST /v1/routed-orders/{id}/execute instead.\",\"url\":\"https://lean.mintlify.app/api-reference/orders/create-order\",\"mainEntityOfPage\":{\"@id\":\"https://lean.mintlify.app/api-reference/orders/create-order#webpage\"},\"dateModified\":\"2026-11-12T23:47:19.418Z\",\"publisher\":{\"@id\":\"https://lean.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://lean.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Lean API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Lean API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/orders/create-order.md","siteName":"Lean API","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"Use cases","pages":[{"title":"Use cases","href":"/use-cases"}]},{"tab":"API reference","groups":[{"group":"Markets","pages":[{"title":"List markets","openapi":"api-reference/openapi.json GET /markets","href":"/api-reference/markets/list-markets"},{"title":"Get a market","openapi":"api-reference/openapi.json GET /markets/{id}","href":"/api-reference/markets/retrieve-market"},{"title":"Quote a market","openapi":"api-reference/openapi.json GET /markets/{id}/quote","href":"/api-reference/markets/quote-market"},{"title":"Get a market orderbook","openapi":"api-reference/openapi.json GET /markets/{id}/book","href":"/api-reference/markets/retrieve-market-book"},{"title":"Get recent trades","openapi":"api-reference/openapi.json GET /markets/{id}/trades","href":"/api-reference/markets/list-market-trades"},{"title":"Get price candles","openapi":"api-reference/openapi.json GET /markets/{id}/candles","href":"/api-reference/markets/get-market-candles"},{"title":"Get prices","openapi":"api-reference/openapi.json GET /prices","href":"/api-reference/markets/list-prices"}]},{"group":"Orders","pages":[{"title":"Preview an order","openapi":"api-reference/openapi.json POST /orders/preview","href":"/api-reference/orders/preview-order"},{"title":"Preview several orders","openapi":"api-reference/openapi.json POST /orders/preview-batch","description":"Previews up to 25 order bodies in one call, each exactly as POST /v1/orders/preview previews it, and runs them at once, so a batch takes about as long as its slowest preview. Each body is previewed on its own: the batch does not add the notional of one body to another's limit checks. One body that cannot be previewed does not stop the rest; its result carries the status and error the single preview answers with. Results are in the order the bodies were sent. Nothing is placed or reserved, and the call counts once against the key's rate limit.","href":"/api-reference/orders/preview-orders-batch"},{"title":"Create an order","openapi":"api-reference/openapi.json POST /orders","href":"/api-reference/orders/create-order"},{"title":"List orders","openapi":"api-reference/openapi.json GET /orders","description":"Orders placed through the API on this key’s trading account, newest first. Each order names its `market_id`, `title` and `outcome`; the title and outcome are null for a market whose fixture started more than 7 days ago. Filter by status, venue, market, text in the market title or `client_order_id`, and pass `next_cursor` back as `cursor` for the next page.","href":"/api-reference/orders/list-orders"},{"title":"Retrieve an order","openapi":"api-reference/openapi.json GET /orders/{id}","href":"/api-reference/orders/retrieve-order"},{"title":"Amend an order","openapi":"api-reference/openapi.json PATCH /orders/{id}","href":"/api-reference/orders/amend-order"},{"title":"Cancel an order","openapi":"api-reference/openapi.json POST /orders/{id}/cancel","href":"/api-reference/orders/cancel-order"},{"title":"Cancel every open order","openapi":"api-reference/openapi.json POST /orders/cancel-all","href":"/api-reference/orders/cancel-all-orders"},{"title":"Set a cancel timer","openapi":"api-reference/openapi.json POST /orders/cancel-after","href":"/api-reference/orders/set-cancel-after"},{"title":"Cancel several orders","openapi":"api-reference/openapi.json POST /orders/cancel-batch","href":"/api-reference/orders/cancel-orders-batch"},{"title":"List fills","openapi":"api-reference/openapi.json GET /fills","href":"/api-reference/orders/list-fills"},{"title":"Place a routed order","openapi":"api-reference/openapi.json POST /routed-orders","href":"/api-reference/orders/create-routed-order"},{"title":"Execute a routed order","openapi":"api-reference/openapi.json POST /routed-orders/{id}/execute","href":"/api-reference/orders/execute-routed-order"}]},{"group":"Stop losses","pages":[{"title":"Create a stop loss or take profit","openapi":"api-reference/openapi.json POST /stop-losses","href":"/api-reference/stop-losses/create-stop-loss"},{"title":"List stop losses","openapi":"api-reference/openapi.json GET /stop-losses","href":"/api-reference/stop-losses/list-stop-losses"},{"title":"Get a stop loss","openapi":"api-reference/openapi.json GET /stop-losses/{id}","href":"/api-reference/stop-losses/retrieve-stop-loss"},{"title":"Cancel a stop loss","openapi":"api-reference/openapi.json DELETE /stop-losses/{id}","href":"/api-reference/stop-losses/cancel-stop-loss"}]},{"group":"Limit chases","pages":[{"title":"Create a limit chase","openapi":"api-reference/openapi.json POST /limit-chases","href":"/api-reference/limit-chases/create-limit-chase"},{"title":"List limit chases","openapi":"api-reference/openapi.json GET /limit-chases","href":"/api-reference/limit-chases/list-limit-chases"},{"title":"Get a limit chase","openapi":"api-reference/openapi.json GET /limit-chases/{id}","href":"/api-reference/limit-chases/retrieve-limit-chase"},{"title":"Cancel a limit chase","openapi":"api-reference/openapi.json DELETE /limit-chases/{id}","href":"/api-reference/limit-chases/cancel-limit-chase"}]},{"group":"Account","pages":[{"title":"List positions","openapi":"api-reference/openapi.json GET /positions","href":"/api-reference/account/list-positions"},{"title":"Close positions","openapi":"api-reference/openapi.json POST /positions/close","href":"/api-reference/account/close-positions"},{"title":"List balances","openapi":"api-reference/openapi.json GET /balances","href":"/api-reference/account/list-balances"},{"title":"Get profit and loss","openapi":"api-reference/openapi.json GET /pnl","href":"/api-reference/account/get-pnl"},{"title":"Get profit and loss history","openapi":"api-reference/openapi.json GET /pnl/history","href":"/api-reference/account/get-pnl-history"},{"title":"Get risk","openapi":"api-reference/openapi.json GET /risk","href":"/api-reference/account/get-risk"},{"title":"Get account configuration","openapi":"api-reference/openapi.json GET /account/config","href":"/api-reference/account/retrieve-account-config"},{"title":"Lower this key's limits","openapi":"api-reference/openapi.json POST /account/limits","href":"/api-reference/account/lower-key-limits"},{"title":"Pause order placement","openapi":"api-reference/openapi.json POST /account/pause","href":"/api-reference/account/pause-trading"}]},{"group":"Deposits","pages":[{"title":"List deposit assets","openapi":"api-reference/openapi.json GET /deposits/assets","href":"/api-reference/deposits/list-deposit-assets"},{"title":"Get deposit addresses","openapi":"api-reference/openapi.json GET /deposits/addresses","href":"/api-reference/deposits/list-deposit-addresses"},{"title":"Create deposit addresses","openapi":"api-reference/openapi.json POST /deposits/addresses","href":"/api-reference/deposits/create-deposit-addresses"}]},{"group":"Withdrawals","pages":[{"title":"Withdraw cash","openapi":"api-reference/openapi.json POST /withdrawals","href":"/api-reference/withdrawals/create-withdrawal"},{"title":"List withdrawals","openapi":"api-reference/openapi.json GET /withdrawals","href":"/api-reference/withdrawals/list-withdrawals"},{"title":"Get a withdrawal","openapi":"api-reference/openapi.json GET /withdrawals/{id}","href":"/api-reference/withdrawals/retrieve-withdrawal"}]},{"group":"Transfers","pages":[{"title":"Quote a transfer","openapi":"api-reference/openapi.json POST /transfers/quote","href":"/api-reference/transfers/quote-transfer"},{"title":"Create a transfer","openapi":"api-reference/openapi.json POST /transfers","href":"/api-reference/transfers/create-transfer"},{"title":"Execute a transfer","openapi":"api-reference/openapi.json POST /transfers/{id}/execute","href":"/api-reference/transfers/execute-transfer"},{"title":"List transfers","openapi":"api-reference/openapi.json GET /transfers","href":"/api-reference/transfers/list-transfers"},{"title":"Get a transfer","openapi":"api-reference/openapi.json GET /transfers/{id}","href":"/api-reference/transfers/retrieve-transfer"}]},{"group":"Streaming","pages":[{"title":"Create a stream ticket","openapi":"api-reference/openapi.json POST /ws/token","href":"/api-reference/streaming/create-stream-ticket"},{"title":"WebSocket","href":"/api-reference/streaming/websocket"}]},{"group":"Test mode","pages":[{"title":"Reset test mode","openapi":"api-reference/openapi.json POST /test/reset","href":"/api-reference/test-mode/reset-test-mode"}]},{"group":"API keys","pages":[{"title":"Create an API key","openapi":"api-reference/openapi.json POST /api-keys","href":"/api-reference/api-keys/create-api-key"},{"title":"List API keys","openapi":"api-reference/openapi.json GET /api-keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Revoke an API key","openapi":"api-reference/openapi.json DELETE /api-keys/{id}","href":"/api-reference/api-keys/revoke-api-key"},{"title":"Change an API key's limits","openapi":"api-reference/openapi.json PATCH /api-keys/{id}/limits","href":"/api-reference/api-keys/update-api-key-limits"},{"title":"Pause an API key","openapi":"api-reference/openapi.json PUT /api-keys/{id}/suspension","href":"/api-reference/api-keys/pause-api-key"},{"title":"Resume an API key","openapi":"api-reference/openapi.json DELETE /api-keys/{id}/suspension","href":"/api-reference/api-keys/resume-api-key"},{"title":"Get a trading account's API limits","openapi":"api-reference/openapi.json GET /api-keys/accounts/{tradingAccountId}/limits","href":"/api-reference/api-keys/retrieve-account-limits"},{"title":"Set a trading account's API limits","openapi":"api-reference/openapi.json PUT /api-keys/accounts/{tradingAccountId}/limits","href":"/api-reference/api-keys/update-account-limits"},{"title":"List trading pauses","openapi":"api-reference/openapi.json GET /api-keys/suspensions","href":"/api-reference/api-keys/list-trading-pauses"},{"title":"Pause API trading on a trading account","openapi":"api-reference/openapi.json PUT /api-keys/accounts/{tradingAccountId}/suspension","href":"/api-reference/api-keys/pause-account-api-trading"},{"title":"Resume API trading on a trading account","openapi":"api-reference/openapi.json DELETE /api-keys/accounts/{tradingAccountId}/suspension","href":"/api-reference/api-keys/resume-account-api-trading"}]}]}]},"basePath":"","title":"Create an order - Lean API","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-jJHA3WSo.js","utils-DbZn3Mjn.js","cloneDeep-CnBnaSyy.js","_Uint8Array-CMQtTgBR.js","isObject-FP1Yky1u.js","utils-Bl2DvzOJ.js","addUniqueKeysToSchema-BwOLo9p1.js","snippetPresets-BBiPpKa-.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-C0px4Tml.js","isEqual-zAyttAAO.js","usePlaygroundInputsStore-Dell6dGw.js","shallow-0VKqkSqN.js","getApiPlaygroundDisplay-CP_ctPEB.js","CodeSnippet-5L35ic0s.js","CodeSnippets-DOXbNhJw.js","Page-DRLI_2Ue.js","getPastedJson-VhzT9m2P.js","icon-CD8_AtCO.js","MethodPill-DGgOMftG.js","DuplicateIcon-DZ6A_EtN.js","createIcon-DUl4oM5f.js","DynamicMarkdown-BGHukeRM.js","SectionHeading-ChrEUs8u.js","axios-vUo_bRtp.js","Markdown-Dj-na-_-.js","dist-C5gjFYHe.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","katex-YMM-FMeD.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","AssistantPageLink-DEBW87tT.js"]}