v51

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-0175184292.5 KB
Trading

Cancel order

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

post/accounts/{accountId}/trading/cancel

Path parameters

accountIdstring uuid required

Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

Example:917c8734-8470-4a3e-a18f-57c3f2ee6631

Query parameters

userIdstring 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.

Example:snaptrade-user-123
userSecretstring 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.

Example:adf2aa34-8219-40f7-a6b3-60156985cc61

Request body

brokerage_order_idstring required

Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

Example request

{
  "brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e"
}

Response

OK

brokerage_order_idstring required

Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

raw_responseobject nullable

The raw response from the brokerage.

Example response

{
  "brokerage_order_id": "66a033fa-da74-4fcf-b527-feefdec9257e",
  "raw_response": {
    "order_id": "1234567890",
    "status": "CANCELLED"
  }
}