{"format":"opendoc-document","version":1,"url":"https://docs.upscale.trade/developers/operations/cancelorder","title":"Cancel order","description":"DELETE /orders/{orderId}: Cancels a pending order and releases whatever it had reserved. The order must still be active; one that has already executed or been cancelled answers…","kind":"api-operation","locale":"en","inLanguage":"en","lastModified":"2026-09-28T19:22:49.100Z","revision":"25c86f549328fcff320805d5945f4c9804e3927950d831e601d6e3b18c170f66","section":{"title":"Developers","url":"https://docs.upscale.trade/developers"},"representations":{"html":"https://docs.upscale.trade/developers/operations/cancelorder","markdown":"https://docs.upscale.trade/developers/operations/cancelorder.md","json":"https://docs.upscale.trade/developers/operations/cancelorder.json"},"translations":{"en":"https://docs.upscale.trade/developers/operations/cancelorder","ru":"https://docs.upscale.trade/ru/developers/operations/cancelorder","es":"https://docs.upscale.trade/es/developers/operations/cancelorder"},"operation":{"id":"cancelOrder","method":"DELETE","path":"/orders/{orderId}","summary":"Cancel order","description":"Cancels a pending order and releases whatever it had reserved.\n\n- The order must still be `active`; one that has already executed or been cancelled answers `403`.\n- Allowed while the account is locked by the managed capital limit — that lock only stops orders that would grow a position.\n- The market must not be paused.","tags":["Trading"],"deprecated":false,"parameters":[{"name":"orderId","location":"path","schema":{"type":"string · uuid","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid"},"properties":[],"variants":[]},"type":"string · uuid","required":true,"description":"Identifier of the order to cancel.","example":"00000000-0000-4000-8000-000000000000"}],"bodies":[],"responses":[{"status":"204","description":"Order cancelled","properties":[],"headers":[]},{"status":"401","description":"Unauthorized","properties":[],"headers":[]},{"status":"403","description":"The order is no longer active. The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`). Trading on the account is over in its current status (`challenge_closed`), or the account is locked by the managed capital limit (`funded_limit_trading_locked`). The market is paused (`market_paused`) or accepts closing orders only (`market_close_only`).","properties":[],"headers":[]},{"status":"404","description":"No order with this identifier.","properties":[],"headers":[]},{"status":"429","description":"Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","properties":[],"headers":[]}],"security":[{"name":"bearer","type":"http · bearer","description":"Personal API key, prefixed with `usk_`.","required":true,"scopes":[]}],"codeSamples":[{"label":"cURL","language":"bash","source":"curl --request DELETE 'https://api.upscale.trade/orders/{orderId}' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'"},{"label":"JavaScript","language":"javascript","source":"const response = await fetch(\"https://api.upscale.trade/orders/{orderId}\", {\n  method: \"DELETE\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());"},{"label":"Python","language":"python","source":"import requests\n\nresponse = requests.request(\n    \"DELETE\",\n    \"https://api.upscale.trade/orders/{orderId}\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)"}]},"breadcrumbs":[{"title":"What is Prop Trading","url":"https://docs.upscale.trade"},{"title":"Developers","url":"https://docs.upscale.trade/developers"},{"title":"Cancel order","url":"https://docs.upscale.trade/developers/operations/cancelorder"}],"headings":[{"depth":2,"id":"authorization","title":"Authorization"},{"depth":2,"id":"parameters","title":"Parameters"},{"depth":2,"id":"examples","title":"Examples"},{"depth":2,"id":"responses","title":"Responses"}],"markdown":"# Cancel order\n\n`DELETE /orders/{orderId}`\n\nCancels a pending order and releases whatever it had reserved.\n\n- The order must still be `active`; one that has already executed or been cancelled answers `403`.\n- Allowed while the account is locked by the managed capital limit — that lock only stops orders that would grow a position.\n- The market must not be paused.\n\n## Authorization\n\nbearer: http · bearer (required). Personal API key, prefixed with `usk_`.\n\n## Parameters\n\n- path: orderId (string · uuid; required). Identifier of the order to cancel.\n\nType: string · uuid\n\nformat: uuid\n\n## Example · cURL\n\n```bash\ncurl --request DELETE 'https://api.upscale.trade/orders/{orderId}' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY'\n```\n\n## Example · JavaScript\n\n```javascript\nconst response = await fetch(\"https://api.upscale.trade/orders/{orderId}\", {\n  method: \"DELETE\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\"\n  },\n});\nconsole.log(response.status, await response.text());\n```\n\n## Example · Python\n\n```python\nimport requests\n\nresponse = requests.request(\n    \"DELETE\",\n    \"https://api.upscale.trade/orders/{orderId}\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\"},\n    timeout=30,\n)\nprint(response.status_code, response.text)\n```\n\n## Response 204\n\n**204**  — Order cancelled\n\n## Response 401\n\n**401**  — Unauthorized\n\n## Response 403\n\n**403**  — The order is no longer active. The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`). Trading on the account is over in its current status (`challenge_closed`), or the account is locked by the managed capital limit (`funded_limit_trading_locked`). The market is paused (`market_paused`) or accepts closing orders only (`market_close_only`).\n\n## Response 404\n\n**404**  — No order with this identifier.\n\n## Response 429\n\n**429**  — Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","text":"Cancel order Cancels a pending order and releases whatever it had reserved. - The order must still be `active`; one that has already executed or been cancelled answers `403`. - Allowed while the account is locked by the managed capital limit — that lock only stops orders that would grow a position. - The market must not be paused. DELETE /orders/{orderId} Trading orderId Identifier of the order to cancel. string · uuid 204 Order cancelled 401 Unauthorized 403 The order is no longer active. The account belongs to another user (`account_access_denied`), or the request is authenticated with an API key while `api_trading` is disabled on the account (`api_trading_not_enabled`). Trading on the account is over in its current status (`challenge_closed`), or the account is locked by the managed capital limit (`funded_limit_trading_locked`). The market is paused (`market_paused`) or accepts closing orders only (`market_close_only`). 404 No order with this identifier. 429 Rate limit of the API key exceeded (`api_key_rate_limit_exceeded`). `Retry-After` says when to come back; the body carries the bucket (`read` / `write`), the window that tripped, its limit and `retryAt`.","api":{"title":"Upscale Public API","version":"d796ac9","documentation":"https://docs.upscale.trade/developers","playgroundServer":"https://api.upscale.trade"}}