/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 answers403. - 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.
https://api.upscale.tradeParameters
orderIdstring · uuidrequiredIdentifier of the order to cancel.
00000000-0000-4000-8000-000000000000Examples
curl --request DELETE 'https://api.upscale.trade/orders/{orderId}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY'const response = await fetch("https://api.upscale.trade/orders/{orderId}", {
method: "DELETE",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
});
console.log(response.status, await response.text());import requests
response = requests.request(
"DELETE",
"https://api.upscale.trade/orders/{orderId}",
headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
timeout=30,
)
print(response.status_code, response.text)Responses
Order cancelled
Unauthorized
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).
No order with this identifier.
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.