---
title: "Cancels an existing order based on the provided request."
method: POST
path: "/api/Order/cancel"
tags: ["Order"]
---

# Cancels an existing order based on the provided request.

`POST /api/Order/cancel`

## Request body

- CancelOrderRequest
  - `accountId` integer, required
  - `orderId` integer, required

## Response `200`

A response with order cancellation details.

- CancelOrderResponse
  - `success` boolean, required
  - `errorCode` 0 | 1 | 2 | 3 | 4 | 5 | 6, required — 0 = Success 1 = AccountNotFound 2 = OrderNotFound 3 = Rejected 4 = Pending 5 = UnknownError 6 = AccountRejected
  - `errorMessage` string

---

[API](https://skmtc.dev/topstepx/apis/projectx-gateway-api.md) · [All operations](https://skmtc.dev/topstepx/apis/projectx-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/topstepx/projectx-gateway-api/revisions/688252f4f704/schema)
