Skip to content

CancelOrder ​

Cancel a specific open order by its order ID.

Endpoint URL ​

http
Local Host   :  POST http://127.0.0.1:5000/api/v1/cancelorder
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/cancelorder
Custom Domain:  POST https://<your-custom-domain>/api/v1/cancelorder

Sample API Request ​

json
{
  "apikey": "<your_app_apikey>",
  "orderid": "250408001002736",
  "strategy": "Python"
}

Sample cURL Request ​

bash
curl -X POST http://127.0.0.1:5000/api/v1/cancelorder \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "orderid": "250408001002736",
  "strategy": "Python"
}'

Sample API Response ​

json
{
  "orderid": "250408001002736",
  "status": "success"
}

Request Body ​

ParameterDescriptionMandatory/OptionalDefault Value
apikeyYour Tradeboard API keyMandatory-
orderidOrder ID to cancelMandatory-
strategyStrategy identifierMandatory-

CancelOrderSchema declares exactly these three fields and all three are required. Omitting strategy returns HTTP 400, and any additional field returns HTTP 400 as well.

Response Fields ​

FieldTypeDescription
statusstring"success" or "error"
orderidstringCancelled order ID
messagestringError message (on failure)
modestring"analyze" in analyzer mode. The key is absent in live mode; there is no "mode": "live"

Notes ​

  • Only open/pending orders can be cancelled
  • Completed orders cannot be cancelled
  • Orders that are being processed (in transit) may not be cancellable
  • If the order is already cancelled, the API returns success
  • For AMO (After Market Orders), cancellation rules may differ

Error Scenarios ​

ErrorCause
Order not foundInvalid order ID
Order not cancellableOrder already executed
Order in transitOrder being processed at exchange

Back to: API Documentation