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/cancelorderSample 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
| Parameter | Description | Mandatory/Optional | Default Value |
|---|---|---|---|
| apikey | Your Tradeboard API key | Mandatory | - |
| orderid | Order ID to cancel | Mandatory | - |
| strategy | Strategy identifier | Mandatory | - |
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
| Field | Type | Description |
|---|---|---|
| status | string | "success" or "error" |
| orderid | string | Cancelled order ID |
| message | string | Error message (on failure) |
| mode | string | "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
| Error | Cause |
|---|---|
| Order not found | Invalid order ID |
| Order not cancellable | Order already executed |
| Order in transit | Order being processed at exchange |
Related Endpoints
- CancelAllOrder - Cancel all open orders at once
Back to: API Documentation
