---
title: "Cancel order"
method: POST
path: "/accounts/{accountId}/trading/cancel"
tags: ["Trading"]
---

# Cancel order

`POST /accounts/{accountId}/trading/cancel`

Cancels an order in the specified account. Accepts order IDs for all asset types.

## Path parameters

- `accountId` string, uuid, required — Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

## Query parameters

- `userId` string, required — SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
- `userSecret` string, required — SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).

## Request body

- object
  - `brokerage_order_id` string, required — Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

## Response `200`

OK

- CancelOrderResponse
  - `brokerage_order_id` string, required — Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
  - `raw_response` object, nullable — The raw response from the brokerage.

## Other responses

- `400` — Invalid request
- `500` — Unexpected Error

---

[API](https://skmtc.net/passiv/apis/snaptrade.md) · [All operations](https://skmtc.net/passiv/apis/snaptrade/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/passiv/snaptrade/versions/993e058b557e/schema)
