> For the complete documentation index, see [llms.txt](https://docs.variational.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.variational.io/api-specification/orders.md). Agents can also search and read this documentation through its [MCP server](https://docs.variational.io/~gitbook/mcp).

# Orders

Placing, canceling, and reading orders.

## List open orders

> Lists \`queued\`, \`open\`, and \`untriggered\` orders, newest first. Not paginated.\
> Filter by \`symbol\`, or use \`client\_order\_id\` to retrieve one order in any status.\
> The filters cannot be combined; an unknown client ID returns an empty list.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["read"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"Page_Order":{"description":"Results in the endpoint's documented order.","properties":{"next":{"description":"Cursor for the next page. Omitted at the end of the results and for lists that are not paginated.","type":["string","null"]},"prev":{"description":"Cursor for the previous page. Omitted on an empty first page and for unpaginated lists.","type":["string","null"]},"results":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"}},"required":["results"],"type":"object"},"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"InsufficientScope":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The API key lacks the required scope (`insufficient_scope`).","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"UnknownSymbol":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"No instrument matches this symbol (`unknown_symbol`).","headers":{}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RequestTimeout":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The request took too long and was abandoned (`request_timeout`). It changed nothing and can be sent again.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders":{"get":{"description":"Lists `queued`, `open`, and `untriggered` orders, newest first. Not paginated.\nFilter by `symbol`, or use `client_order_id` to retrieve one order in any status.\nThe filters cannot be combined; an unknown client ID returns an empty list.","operationId":"list_orders","parameters":[{"description":"List only the orders on this instrument. Case-insensitive.","in":"query","name":"symbol","required":false,"schema":{"type":"string"}},{"description":"Return the one order that has this client identifier, whatever its status.","in":"query","name":"client_order_id","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Order"}}},"description":"Returns the orders, from newest to oldest.","headers":{}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The query combines `symbol` with `client_order_id`, has a parameter the endpoint does not accept, or has a malformed `client_order_id` (`invalid_query`).","headers":{}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/InsufficientScope"},"418":{"$ref":"#/components/responses/Banned"},"422":{"$ref":"#/components/responses/UnknownSymbol"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/RequestTimeout"}},"summary":"List open orders","tags":["orders"]}}}}
```

## Place an order

> Places a market, limit, take-profit, or stop-loss order. Market and limit orders may include\
> attached take-profit and stop-loss orders; all are accepted together or none are created.\
> \
> A 202 response confirms acceptance, not execution. Check the order with\
> \`GET /v1/orders/{order\_id}\` or \`GET /v1/orders?client\_order\_id=YOUR\_ID\`.\
> Later execution failures set \`status\` to \`rejected\` with a \`RejectReason\` in \`reason\`;\
> they do not produce an HTTP error. \`RejectReason\` and HTTP \`error\_code\` are separate\
> enums, even where their names overlap.\
> \
> For safe retries, reuse the same \`client\_order\_id\` with a new timestamp and signature.\
> If the order exists, \`duplicate\_client\_order\_id\` includes it in the response.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["trade"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"PlaceOrderBody":{"description":"Select an order with `type`: `market`, `limit`, `take_profit`, or `stop_loss`.\nOnly fields defined for that type are accepted. See Data formats in the API overview\nfor decimal encoding.","discriminator":{"mapping":{"limit":"#/components/schemas/PlaceLimitOrder","market":"#/components/schemas/PlaceMarketOrder","stop_loss":"#/components/schemas/PlaceStopLossOrder","take_profit":"#/components/schemas/PlaceTakeProfitOrder"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/PlaceMarketOrder"},{"$ref":"#/components/schemas/PlaceLimitOrder"},{"$ref":"#/components/schemas/PlaceTakeProfitOrder"},{"$ref":"#/components/schemas/PlaceStopLossOrder"}]},"PlaceMarketOrder":{"additionalProperties":false,"description":"A market order. It is executed as soon as it is placed, and it is filled in full or rejected.","properties":{"client_order_id":{"description":"Client-supplied order identifier: 1–36 ASCII letters, digits, `_`, `:`, or `-`.\nUnique per account, even after the order ends. Reuse on placement retries;\nsee `POST /v1/orders`.","type":["string","null"]},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price.\nFor example, `\"0.01\"` allows a fill up to 1% away. The value must be greater than zero and\nat most 1. The order is rejected if its fill price would be further away.","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.\nDefaults to false.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Size in underlying-asset units. Must be positive and a multiple of the instrument's\n`size_step` (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"stop_loss":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ChildOrderBody","description":"Optional stop-loss order attached to this parent order."}]},"symbol":{"description":"Public instrument symbol. Case-insensitive.","type":"string"},"take_profit":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ChildOrderBody","description":"Optional take-profit order attached to this parent order."}]},"type":{"enum":["market"],"type":"string"}},"required":["symbol","side","size","max_slippage","type"],"type":"object"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"ChildOrderBody":{"additionalProperties":false,"description":"A take-profit or stop-loss order attached to a market or limit order (the parent order).\nIts side is opposite the parent's side, its size matches the parent's size, and it is\nalways reduce-only. Do not include `side`, `size`, or `reduce_only` in this object.","properties":{"max_slippage":{"description":"Maximum deviation from the execution-time mark price, as a fraction (`\"0.01\"` = 1%).\nRequired; use null for no user-defined limit. Otherwise, `0 < value <= 1`.\nExecution remains blocked beyond 20% deviation from the mark price.","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy"},"trigger_price":{"description":"Trigger price, in USDC. It can be no more precise than the instrument's `price_precision`\nallows (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"}},"required":["trigger_price","trigger_by","max_slippage"],"type":"object"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"PlaceLimitOrder":{"additionalProperties":false,"description":"A limit order. It waits until the price reaches `price`.","properties":{"client_order_id":{"description":"Client-supplied order identifier: 1–36 ASCII letters, digits, `_`, `:`, or `-`.\nUnique per account, even after the order ends. Reuse on placement retries;\nsee `POST /v1/orders`.","type":["string","null"]},"max_slippage":{"description":"Maximum deviation from the execution-time mark price, as a fraction (`\"0.01\"` = 1%).\nRequired; use null for no user-defined limit. Otherwise, `0 < value <= 1`.\nExecution remains blocked beyond 20% deviation from the mark price.","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":["string","null"]},"price":{"description":"Limit price, in USDC. It can be no more precise than the instrument's `price_precision`\nallows (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.\nDefaults to false.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Size in underlying-asset units. Must be positive and a multiple of the instrument's\n`size_step` (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"stop_loss":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ChildOrderBody","description":"Optional stop-loss order attached to this parent order."}]},"symbol":{"description":"Public instrument symbol. Case-insensitive.","type":"string"},"take_profit":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ChildOrderBody","description":"Optional take-profit order attached to this parent order."}]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy"},"type":{"enum":["limit"],"type":"string"}},"required":["symbol","side","size","price","trigger_by","max_slippage","type"],"type":"object"},"PlaceTakeProfitOrder":{"additionalProperties":false,"description":"A standalone take-profit or stop-loss order for an existing position.\nIt waits until the price selected by `trigger_by` reaches `trigger_price`.\nThese orders are always reduce-only. Do not include `reduce_only`, `take_profit`, or\n`stop_loss` in the request.","properties":{"client_order_id":{"description":"Client-supplied order identifier: 1–36 ASCII letters, digits, `_`, `:`, or `-`.\nUnique per account, even after the order ends. Reuse on placement retries;\nsee `POST /v1/orders`.","type":["string","null"]},"max_slippage":{"description":"Maximum deviation from the execution-time mark price, as a fraction (`\"0.01\"` = 1%).\nRequired; use null for no user-defined limit. Otherwise, `0 < value <= 1`.\nExecution remains blocked beyond 20% deviation from the mark price.","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":["string","null"]},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Size in underlying-asset units. Must be positive and a multiple of the instrument's\n`size_step` (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"symbol":{"description":"Public instrument symbol. Case-insensitive.","type":"string"},"trigger_by":{"$ref":"#/components/schemas/TriggerBy"},"trigger_price":{"description":"Trigger price, in USDC. It can be no more precise than the instrument's `price_precision`\nallows (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"type":{"enum":["take_profit"],"type":"string"}},"required":["symbol","side","size","trigger_price","trigger_by","max_slippage","type"],"type":"object"},"PlaceStopLossOrder":{"additionalProperties":false,"description":"A standalone take-profit or stop-loss order for an existing position.\nIt waits until the price selected by `trigger_by` reaches `trigger_price`.\nThese orders are always reduce-only. Do not include `reduce_only`, `take_profit`, or\n`stop_loss` in the request.","properties":{"client_order_id":{"description":"Client-supplied order identifier: 1–36 ASCII letters, digits, `_`, `:`, or `-`.\nUnique per account, even after the order ends. Reuse on placement retries;\nsee `POST /v1/orders`.","type":["string","null"]},"max_slippage":{"description":"Maximum deviation from the execution-time mark price, as a fraction (`\"0.01\"` = 1%).\nRequired; use null for no user-defined limit. Otherwise, `0 < value <= 1`.\nExecution remains blocked beyond 20% deviation from the mark price.","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":["string","null"]},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Size in underlying-asset units. Must be positive and a multiple of the instrument's\n`size_step` (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"symbol":{"description":"Public instrument symbol. Case-insensitive.","type":"string"},"trigger_by":{"$ref":"#/components/schemas/TriggerBy"},"trigger_price":{"description":"Trigger price, in USDC. It can be no more precise than the instrument's `price_precision`\nallows (see `GET /v1/instruments`).","pattern":"^[0-9]{1,16}(\\.[0-9]{1,12})?$","type":"string"},"type":{"enum":["stop_loss"],"type":"string"}},"required":["symbol","side","size","trigger_price","trigger_by","max_slippage","type"],"type":"object"},"PlacedOrders":{"description":"Orders accepted by a placement request.","properties":{"placed":{"description":"The parent order, followed by its attached take-profit and stop-loss orders, if supplied,\nin that order. Each attached order has its own `order_id` and identifies its parent\nin `parent_order_id`.","items":{"$ref":"#/components/schemas/Order"},"type":"array"}},"required":["placed"],"type":"object"},"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"AccountNotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"No trading account exists for the owner of this API key (`account_not_found`). Log in to Omni and make a first deposit before using this endpoint.","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"OutcomeUnknown":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The write may have succeeded (`outcome_unknown`). Check order state before retrying; see Errors and retries in the API overview.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders":{"post":{"description":"Places a market, limit, take-profit, or stop-loss order. Market and limit orders may include\nattached take-profit and stop-loss orders; all are accepted together or none are created.\n\nA 202 response confirms acceptance, not execution. Check the order with\n`GET /v1/orders/{order_id}` or `GET /v1/orders?client_order_id=YOUR_ID`.\nLater execution failures set `status` to `rejected` with a `RejectReason` in `reason`;\nthey do not produce an HTTP error. `RejectReason` and HTTP `error_code` are separate\nenums, even where their names overlap.\n\nFor safe retries, reuse the same `client_order_id` with a new timestamp and signature.\nIf the order exists, `duplicate_client_order_id` includes it in the response.","operationId":"place_order","parameters":[{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceOrderBody"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlacedOrders"}}},"description":"The order was placed. Returns the order and any take-profit or stop-loss placed with it.","headers":{}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Missing or unsupported Content-Type, invalid JSON, or an invalid order body shape (`invalid_body`). Use `Content-Type: application/json`.","headers":{}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The account is not permitted to trade this instrument (`instrument_not_permitted`).\n\nThe API key lacks the required scope (`insufficient_scope`).","headers":{}},"404":{"$ref":"#/components/responses/AccountNotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The order conflicts with the state of the account:\n\n- `account_pending`: The account is not ready yet: it has not made its first deposit, or that deposit is still being confirmed. Deposit through Omni if you have not, then retry.\n- `conflicting_order`: The order conflicts with a take-profit or stop-loss that is open on the instrument.\n- `duplicate_client_order_id`: The account already has an order with this `client_order_id`. The response's `order` field is that order.\n\nA request with this signature was already received (`replayed_request`). This duplicate request was not processed. Check the original request's outcome before retrying with a new timestamp and signature.","headers":{}},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The body is larger than 64 KiB (`body_too_large`).","headers":{}},"418":{"$ref":"#/components/responses/Banned"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Request refused; no order was created:\n\n- `validation_failed`: Invalid fields are listed in `error_fields`.\n- `unknown_symbol`: No instrument matches this symbol.\n- `invalid_price_increment`: A price is more precise than the instrument's `price_precision` allows (see `GET /v1/instruments`). The response's `error_fields` names the price.\n- `invalid_size_increment`: The size is not a multiple of the instrument's `size_step`, or is larger than the instrument accepts.\n- `invalid_trigger_price`: A take-profit or stop-loss placed with the order has its trigger price on the wrong side of the order's entry price. On a buy, a take-profit must be at or above the entry price and a stop-loss at or below it. On a sell, it is the other way around. The response's `error_fields` names the trigger price.\n- `below_min_notional`: The order's notional amount is below the instrument's minimum.\n- `above_max_notional`: The order's notional amount is above the maximum.\n- `market_not_trading`: The market is closed or halted.\n- `instrument_not_supported`: The instrument is listed but cannot be traded right now.\n- `reduce_only_required`: The market accepts only orders that reduce a position.\n- `no_position_to_reduce`: No position to reduce on this market.\n- `reduce_only_wrong_side`: Order side would increase the position.\n- `reduce_only_exceeds_position`: Order size exceeds the position.\n- `too_many_orders`: The account already has as many open orders of this type as the instrument allows.\n- `market_limit_exceeded`: The order would take the market beyond one of its risk limits.\n- `size_exceeds_liquidity`: The size is larger than the available liquidity can fill.","headers":{}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`, `market_status_unavailable`, `risk_check_unavailable`, or `quote_unavailable`). The order was not placed. Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"504":{"$ref":"#/components/responses/OutcomeUnknown"}},"summary":"Place an order","tags":["orders"]}}}}
```

## Cancel an order

> Cancels the order identified by exactly one of \`order\_id\` or \`client\_order\_id\`.\
> Returns that order; its attached orders are canceled shortly afterward with reason\
> \`parent\_canceled\`.\
> \
> Canceling an already canceled order succeeds. Reuse the order identifier on retries;\
> see Errors and retries in the API overview.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["trade"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"InsufficientScope":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The API key lacks the required scope (`insufficient_scope`).","headers":{}},"OrderNotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The account has no order with this identifier (`order_not_found`).","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"OutcomeUnknown":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The write may have succeeded (`outcome_unknown`). Check order state before retrying; see Errors and retries in the API overview.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders":{"delete":{"description":"Cancels the order identified by exactly one of `order_id` or `client_order_id`.\nReturns that order; its attached orders are canceled shortly afterward with reason\n`parent_canceled`.\n\nCanceling an already canceled order succeeds. Reuse the order identifier on retries;\nsee Errors and retries in the API overview.","operationId":"cancel_order","parameters":[{"description":"The identifier of the order to cancel.","in":"query","name":"order_id","required":false,"schema":{"format":"uuid","type":"string"}},{"description":"The identifier that the client gave the order when placing it.","in":"query","name":"client_order_id","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Returns the canceled order.","headers":{}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The query does not name exactly one order, or the `client_order_id` is malformed (`invalid_query`).","headers":{}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/InsufficientScope"},"404":{"$ref":"#/components/responses/OrderNotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The order can no longer be canceled. The response's `order` field is the order as it stands.\n\n- `order_filled`: The order was filled.\n- `order_rejected`: The order was rejected.\n- `order_queued`: The order is being executed. A market order is always in this state until it is filled or rejected.\n\nA request with this signature was already received (`replayed_request`). This duplicate request was not processed. Check the original request's outcome before retrying with a new timestamp and signature.","headers":{}},"418":{"$ref":"#/components/responses/Banned"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/OutcomeUnknown"}},"summary":"Cancel an order","tags":["orders"]}}}}
```

## Cancel all orders

> Cancels all cancelable orders. Supply exactly one of \`all=true\` or \`symbol\`.\
> \
> Orders already executing are omitted and may still fill. Their attached take-profit and\
> stop-loss orders are canceled, potentially leaving new positions without protection.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["trade"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"CanceledOrders":{"description":"Orders canceled by a cancellation request.","properties":{"canceled":{"description":"Every order that the request canceled. The list is empty when there was nothing to\ncancel. Each attached take-profit or stop-loss order identifies its parent in\n`parent_order_id`.","items":{"$ref":"#/components/schemas/Order"},"type":"array"}},"required":["canceled"],"type":"object"},"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"InsufficientScope":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The API key lacks the required scope (`insufficient_scope`).","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"UnknownSymbol":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"No instrument matches this symbol (`unknown_symbol`).","headers":{}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"OutcomeUnknown":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The write may have succeeded (`outcome_unknown`). Check order state before retrying; see Errors and retries in the API overview.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders/batch":{"delete":{"description":"Cancels all cancelable orders. Supply exactly one of `all=true` or `symbol`.\n\nOrders already executing are omitted and may still fill. Their attached take-profit and\nstop-loss orders are canceled, potentially leaving new positions without protection.","operationId":"cancel_orders","parameters":[{"description":"Send `true` to cancel the account's orders on every instrument.","in":"query","name":"all","required":false,"schema":{"type":"boolean"}},{"description":"Cancel only the orders on this instrument. Case-insensitive.","in":"query","name":"symbol","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanceledOrders"}}},"description":"Returns every order that the request canceled. The list is empty when there was nothing to cancel.","headers":{}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The query does not send exactly one of `all=true` and `symbol` (`invalid_query`).","headers":{}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/InsufficientScope"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A request with this signature was already received (`replayed_request`). This duplicate request was not processed. Check the original request's outcome before retrying with a new timestamp and signature.","headers":{}},"418":{"$ref":"#/components/responses/Banned"},"422":{"$ref":"#/components/responses/UnknownSymbol"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/OutcomeUnknown"}},"summary":"Cancel all orders","tags":["orders"]}}}}
```

## List order history

> Lists orders in all statuses, newest first. See Pagination in the API overview.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["read"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"Page_Order":{"description":"Results in the endpoint's documented order.","properties":{"next":{"description":"Cursor for the next page. Omitted at the end of the results and for lists that are not paginated.","type":["string","null"]},"prev":{"description":"Cursor for the previous page. Omitted on an empty first page and for unpaginated lists.","type":["string","null"]},"results":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"}},"required":["results"],"type":"object"},"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"InvalidPageQuery":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The query has a parameter the endpoint does not accept or an `end` earlier than `start` (`invalid_query`), or the cursor was not issued by this API (`invalid_cursor`).","headers":{}},"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"InsufficientScope":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The API key lacks the required scope (`insufficient_scope`).","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InvalidPageRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"No instrument matches this symbol (`unknown_symbol`), or `limit` is outside 1 to 500 (`validation_failed`).","headers":{}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RequestTimeout":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The request took too long and was abandoned (`request_timeout`). It changed nothing and can be sent again.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders/history":{"get":{"description":"Lists orders in all statuses, newest first. See Pagination in the API overview.","operationId":"list_order_history","parameters":[{"description":"Return only the orders on this instrument. Case-insensitive.","in":"query","name":"symbol","required":false,"schema":{"type":"string"}},{"description":"Return only orders placed at or after this time, in epoch milliseconds.","in":"query","name":"start","required":false,"schema":{"format":"int64","type":"integer"}},{"description":"Return only orders placed at or before this time, in epoch milliseconds. It cannot be earlier than `start`.","in":"query","name":"end","required":false,"schema":{"format":"int64","type":"integer"}},{"description":"The largest number of orders to return, from 1 to 500. Defaults to 100.","in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":500,"minimum":1,"type":"integer"}},{"description":"Cursor from this endpoint. See Pagination in the API overview.","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Page_Order"}}},"description":"Returns one page of orders, from newest to oldest.","headers":{}},"400":{"$ref":"#/components/responses/InvalidPageQuery"},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/InsufficientScope"},"418":{"$ref":"#/components/responses/Banned"},"422":{"$ref":"#/components/responses/InvalidPageRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/RequestTimeout"}},"summary":"List order history","tags":["orders"]}}}}
```

## Get an order

> Returns one of the account's orders by its identifier, whatever its status.

```json
{"openapi":"3.1.0","info":{"title":"Variational Omni API","version":"1.0.0"},"tags":[{"description":"Placing, canceling, and reading orders.","name":"orders"}],"servers":[{"description":"Production. Sign requests with the environment name `prod`.","url":"https://api.omni.variational.io"},{"description":"Testnet. Sign requests with the environment name `testnet`.","url":"https://api.omni.testnet.variational.io"}],"security":[{"signed_request":["read"]}],"components":{"securitySchemes":{"signed_request":{"description":"Signed requests require an Ed25519 API key. See Authentication in the API overview for signing instructions.","in":"header","name":"x-variational-key","type":"apiKey"}},"parameters":{"XRequestTimestampMs":{"description":"Request time in epoch milliseconds. See Authentication in the API overview for the accepted window.","in":"header","name":"x-request-timestamp-ms","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},"XVariationalSignature":{"description":"Ed25519 signature of the request. See Authentication in the API overview for the string to sign.","in":"header","name":"x-variational-signature","required":true,"schema":{"pattern":"^0x[0-9a-fA-F]{128}$","type":"string"}}},"schemas":{"Order":{"description":"Order details, including its type and current status. A field that applies to the\norder's `type` and `status` is always present, and is null when it has no value. A field that\ndoes not apply is omitted.","properties":{"client_order_id":{"description":"Client-supplied order identifier. Null when no identifier was supplied, including for\nattached take-profit and stop-loss orders.","type":["string","null"]},"created_at":{"description":"Time the order was placed, in epoch milliseconds.","format":"int64","type":"integer"},"detail":{"description":"Account limit exceeded. Null if no account limit caused the rejection or amounts are unavailable. Present when `status` is `rejected`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectDetail"}]},"fill_price":{"description":"Price at which the order was filled, in USDC. Present when `status` is `filled`.","type":"string"},"max_slippage":{"description":"How far the fill price may be from the mark price, as a fraction of the mark price. For\nexample, `\"0.01\"` allows a fill up to 1% away. Null when the order sets no limit.","type":["string","null"]},"order_id":{"format":"uuid","type":"string"},"parent_order_id":{"description":"Identifier of the parent order for an attached take-profit or stop-loss order.\nNull for standalone orders.","format":"uuid","type":["string","null"]},"price":{"description":"Limit price, in USDC. Present when `type` is `limit` or `stop_limit`.","type":"string"},"reason":{"description":"When `status` is `rejected`: Why the order was rejected. Null when no reason was recorded. When `status` is `canceled`: Why the order was canceled. Present when `status` is `rejected` or `canceled`.","oneOf":[{"type":"null"},{"$ref":"#/components/schemas/RejectReason"},{"$ref":"#/components/schemas/CancelReason"}]},"reduce_only":{"description":"Whether the order may only reduce an existing position, and never open or increase one.","type":"boolean"},"side":{"$ref":"#/components/schemas/Side"},"size":{"description":"Order size, in units of the underlying asset. Null for an order that takes the size of the\nposition when it triggers and has not triggered yet.","type":["string","null"]},"status":{"description":"Current order status and execution or cancellation details.\n\n- `queued`: Execution pending or in progress; cannot be canceled. Market orders enter this state on placement, other orders when execution starts. Remains queued until filled or rejected.\n- `open`: A limit order that is waiting for the price to reach its limit price.\n- `untriggered`: A take-profit, stop-loss, or stop-limit order that is waiting for its trigger.\n- `filled`: The order was filled.\n- `rejected`: The order was rejected while it was being executed.\n- `canceled`: The order was canceled.","enum":["queued","open","untriggered","filled","rejected","canceled"],"type":"string"},"symbol":{"description":"Instrument symbol, retained after delisting. Null if the market cannot be identified\nor its instrument type is unsupported.","type":["string","null"]},"trigger_by":{"$ref":"#/components/schemas/TriggerBy","description":"Present when `type` is `limit`, `take_profit`, `stop_loss`, or `stop_limit`."},"trigger_price":{"description":"Trigger price, in USDC. Present when `type` is `take_profit`, `stop_loss`, or `stop_limit`.","type":"string"},"type":{"description":"Order type and associated price parameters.\n\n- `market`: A market order, which is executed as soon as it is placed.\n- `limit`: A limit order, which waits until the price reaches its limit price.\n- `take_profit`: A take-profit order, which waits until the price reaches its trigger price.\n- `stop_loss`: A stop-loss order, which waits until the price reaches its trigger price.\n- `stop_limit`: A stop-limit order. Stop-limit orders can be placed only through the web app, and this API shows them when it lists the account's orders.","enum":["market","limit","take_profit","stop_loss","stop_limit"],"type":"string"}},"required":["order_id","client_order_id","parent_order_id","symbol","side","size","reduce_only","max_slippage","created_at","type","status"],"type":"object"},"RejectDetail":{"description":"The account limit that a rejected order would have exceeded, with the amounts involved.","properties":{"limit":{"$ref":"#/components/schemas/AccountLimit"},"max":{"description":"The limit, as a notional amount in USDC.","type":"string"},"value":{"description":"The notional amount, in USDC, that the order would have brought the account to. The\n`limit` field says which notional amount this is.","type":"string"}},"required":["limit","max","value"],"type":"object"},"AccountLimit":{"description":"One of the account's own limits. Each one caps a notional amount, which is a size multiplied\nby a price, in USDC.\n\n- `gross_notional`: The sum of the absolute notional amounts of the account's positions after\n  the order.\n- `net_notional`: The account's long notional amount minus its short notional amount after the\n  order.\n- `market_notional`: The notional amount of the order itself, compared with the account's\n  limit for the market. It counts the order alone, not the position that the order adds to.\n- `leverage_tier_notional`: The notional amount of the account's position on the market after\n  the order, compared with the maximum of the account's margin tier.","enum":["gross_notional","net_notional","market_notional","leverage_tier_notional"],"type":"string"},"RejectReason":{"description":"Why an order was rejected.\n\n- `slippage_exceeded`: The fill price was beyond the order's `max_slippage`.\n- `insufficient_margin`: The account did not have enough margin for the fill.\n- `reduce_only_violated`: The order was reduce-only and would have increased the position.\n- `invalid_order`: The order failed validation while it was being executed.\n- `quote_unavailable`: The liquidity provider declined the order, or its quote expired before\n  the order was filled.\n- `settlement_failed`: The trade could not be settled.\n- `account_limit_exceeded`: The fill would have taken the account beyond its position limits.\n- `leverage_limit_exceeded`: The fill would have taken the account beyond its leverage limit\n  for the market.\n- `market_limit_exceeded`: The fill would have taken the market beyond one of its risk\n  limits.\n- `price_check_failed`: The quote was too far from the mark price, or was on the wrong side of\n  the order's limit price.\n- `trading_disabled`: Trading was disabled.\n- `market_not_trading`: The market closed or was halted before the order was filled.\n- `internal_error`: An error occurred on Variational's side.","enum":["slippage_exceeded","insufficient_margin","reduce_only_violated","invalid_order","quote_unavailable","settlement_failed","account_limit_exceeded","leverage_limit_exceeded","market_limit_exceeded","price_check_failed","trading_disabled","market_not_trading","internal_error"],"type":"string"},"CancelReason":{"description":"Why an order was canceled.\n\n- `user_canceled`: The account canceled the order.\n- `parent_canceled`: The parent order of this attached take-profit or stop-loss order was canceled.\n- `parent_rejected`: The parent order of this attached take-profit or stop-loss order was rejected.\n- `no_position_to_reduce`: The order was reduce-only, and no position was left to reduce.\n- `reduce_only_wrong_side`: The order was reduce-only, and it was on the side that would have\n  increased the position.\n- `reduce_only_exceeds_position`: The order was reduce-only, and it was larger than the\n  position that was left.\n- `market_delisted`: The order's market was delisted.\n- `system_canceled`: The system canceled the order, for example because the order could no\n  longer be executed.","enum":["user_canceled","parent_canceled","parent_rejected","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","market_delisted","system_canceled"],"type":"string"},"Side":{"description":"The side of an order or a trade: `buy` or `sell`.","enum":["buy","sell"],"type":"string"},"TriggerBy":{"description":"Which price decides when a waiting order is executed. The order's limit price or trigger\nprice is compared with this price.\n\n- `mark`: The market's mark price.\n- `quote`: The price at which the order itself would be filled at that moment.","enum":["mark","quote"],"type":"string"},"ErrorBody":{"description":"Standard error response. Optional fields are omitted when they do not apply.","properties":{"error_code":{"$ref":"#/components/schemas/ErrorCode"},"error_fields":{"description":"Field-level errors. Present for `validation_failed`, which lists every field that failed,\nand for `invalid_price_increment` and `invalid_trigger_price`, which name one field.","items":{"$ref":"#/components/schemas/InvalidField"},"type":"array"},"error_message":{"description":"Human-readable explanation. This text may change; use `error_code` for programmatic handling.","type":"string"},"order":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/Order","description":"The order associated with this error, or `null` if its details could not be retrieved. Present only for\n`duplicate_client_order_id`, `order_filled`, `order_rejected`, and `order_queued`."}]},"request_id":{"description":"Request identifier from the response's `x-request-id` header. Include it when contacting support.","type":["string","null"]},"retry_after_ms":{"description":"Milliseconds to wait before retrying. Present only for `rate_limited`, `banned`,\n`overloaded`, and `service_unavailable`.","format":"int64","minimum":0,"type":["integer","null"]},"server_time_ms":{"description":"Server time used to validate the request timestamp, in epoch milliseconds. Use it to\ncorrect client clock skew. Present only for `timestamp_out_of_window`.","format":"int64","minimum":0,"type":["integer","null"]}},"required":["error_code","error_message"],"type":"object"},"ErrorCode":{"description":"Machine-readable error code. See Errors and retries in the API overview.","enum":["not_found","method_not_allowed","request_timeout","outcome_unknown","invalid_query","invalid_path","invalid_body","validation_failed","invalid_cursor","body_too_large","unknown_symbol","missing_credentials","malformed_credentials","timestamp_out_of_window","unknown_key","invalid_signature","key_revoked","key_expired","insufficient_scope","replayed_request","rate_limited","banned","overloaded","account_not_found","account_pending","invalid_price_increment","market_not_trading","market_status_unavailable","instrument_not_permitted","instrument_not_supported","reduce_only_required","no_position_to_reduce","reduce_only_wrong_side","reduce_only_exceeds_position","invalid_trigger_price","conflicting_order","too_many_orders","below_min_notional","above_max_notional","invalid_size_increment","market_limit_exceeded","risk_check_unavailable","size_exceeds_liquidity","quote_unavailable","duplicate_client_order_id","order_not_found","order_filled","order_rejected","order_queued","service_unavailable","internal_error"],"type":"string"},"InvalidField":{"description":"Validation error for a request field, identified by its dotted path and a machine-readable\nerror code.","properties":{"code":{"type":"string"},"field":{"type":"string"}},"required":["field","code"],"type":"object"}},"responses":{"Unauthenticated":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Authentication failed because credentials are missing, invalid, expired, or revoked (`missing_credentials`, `malformed_credentials`, `timestamp_out_of_window`, `unknown_key`, `invalid_signature`, `key_revoked`, or `key_expired`).","headers":{}},"InsufficientScope":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The API key lacks the required scope (`insufficient_scope`).","headers":{}},"OrderNotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The account has no order with this identifier (`order_not_found`).","headers":{}},"Banned":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Temporarily banned for repeated rate limit violations (`banned`). The ban covers every endpoint. Wait `retry_after_ms` milliseconds before sending another request. During a ban, orders and positions can still be managed in the Omni web app. `x-rate-limits` gives the ban schedule.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Rate limit exceeded (`rate_limited`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"InternalError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Something went wrong on the server (`internal_error`). Include the `x-request-id` response header when contacting support.","headers":{}},"ServiceUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"A required service is unavailable (`service_unavailable`). Wait `retry_after_ms` milliseconds before retrying.","headers":{"retry-after":{"$ref":"#/components/headers/RetryAfter"}}},"RequestTimeout":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The request took too long and was abandoned (`request_timeout`). It changed nothing and can be sent again.","headers":{}}},"headers":{"RetryAfter":{"description":"Time to wait before retrying, in whole seconds: the error's `retry_after_ms`, rounded up. Present when the error has a `retry_after_ms`.","schema":{"type":"integer"}}}},"paths":{"/v1/orders/{order_id}":{"get":{"description":"Returns one of the account's orders by its identifier, whatever its status.","operationId":"get_order","parameters":[{"description":"The identifier of the order.","in":"path","name":"order_id","required":true,"schema":{"format":"uuid","type":"string"}},{"$ref":"#/components/parameters/XRequestTimestampMs"},{"$ref":"#/components/parameters/XVariationalSignature"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Returns the order.","headers":{}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"The identifier in the path is not a UUID (`invalid_path`).","headers":{}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/InsufficientScope"},"404":{"$ref":"#/components/responses/OrderNotFound"},"418":{"$ref":"#/components/responses/Banned"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"},"504":{"$ref":"#/components/responses/RequestTimeout"}},"summary":"Get an order","tags":["orders"]}}}}
```
