---
updatedAt: 2026-03-26T12:27:31.000Z
agentTools:
  projectIndex: https://public-api.tradelocker.com/llms.txt
---

# Cancel an existing order

Cancel an existing order. Only available before an order is executed.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Trading API",
    "version": "2.11.0",
    "title": "Trading API",
    "contact": {}
  },
  "tags": [
    {
      "name": "Trading",
      "description": "Creating, modifying and deleting orders."
    }
  ],
  "paths": {
    "/trade/orders/{orderId}": {
      "delete": {
        "tags": [
          "Trading"
        ],
        "summary": "Cancel an existing order",
        "description": "Cancel an existing order. Only available before an order is executed.",
        "operationId": "cancelOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "description": "Order identifier.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "accNum",
            "in": "header",
            "description": "Account number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "developer-api-key",
            "in": "header",
            "description": "developer-api-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://demo.tradelocker.com/backend-api"
    },
    {
      "url": "https://live.tradelocker.com/backend-api"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "SuccessResponse": {
        "type": "object",
        "required": [
          "s"
        ],
        "properties": {
          "s": {
            "type": "string",
            "example": "ok",
            "description": "Status will always be `ok`."
          }
        },
        "title": "SuccessResponse"
      }
    }
  }
}
```