Trading

Cancel all Open Orders For an Account

Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled.

delete/v1/trading/accounts/{account_id}/orders

Request

  • Base URL
    https://broker-api.giftcity.sandbox.in.alpaca.markets
  • URL
    https://broker-api.giftcity.sandbox.in.alpaca.markets/v1/trading/accounts/{account_id}/orders
  • Auth
    HTTP basic

Response

HTTP 207 Multi-Status with body, which is an array of objects that include the order id, http status code and an order object for each cancellation request.

idstring uuid required

UUID of the order that was canceled

statusinteger required

Http status code for the attempt to close this Order

Example response

[
  {
    "body": {
      "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "cancel_requested_at": "2021-03-16T18:38:01.942282Z",
      "canceled_at": "2021-03-16T18:38:01.942282Z",
      "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "commission": "3.14",
      "commission_bps": "10",
      "commission_type": "qty",
      "created_at": "2021-03-16T18:38:01.942282Z",
      "expired_at": "2021-03-16T18:38:01.942282Z",
      "extended_hours": true,
      "failed_at": "2021-03-16T18:38:01.942282Z",
      "filled_at": "2021-03-16T18:38:01.942282Z",
      "filled_avg_price": "4.2",
      "filled_qty": "4.2",
      "group_id": "3f1c2b7e-8d4a-4c6e-9f2a-5b7d1e0c9a84",
      "group_role": "take_profit",
      "hwm": "3.14",
      "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "legs": [
        {
          "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "canceled_at": "2021-03-16T18:38:01.942282Z",
          "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "commission": "3.14",
          "commission_bps": "10",
          "commission_type": "qty",
          "created_at": "2021-03-16T18:38:01.942282Z",
          "expired_at": "2021-03-16T18:38:01.942282Z",
          "extended_hours": true,
          "failed_at": "2021-03-16T18:38:01.942282Z",
          "filled_at": "2021-03-16T18:38:01.942282Z",
          "filled_avg_price": "4.2",
          "filled_qty": "4.2",
          "group_id": "3f1c2b7e-8d4a-4c6e-9f2a-5b7d1e0c9a84",
          "group_role": "take_profit",
          "hwm": "3.14",
          "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "limit_price": "3.14",
          "notional": "4.2",
          "order_type": "market",
          "position_intent": "buy_to_open",
          "qty": "4.2",
          "replaced_at": "2021-03-16T18:38:01.942282Z",
          "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "side": "buy",
          "status": "filled",
          "stop_price": "3.14",
          "submitted_at": "2021-03-16T18:38:01.942282Z",
          "symbol": "AALP",
          "time_in_force": "gtc",
          "trail_percent": "5.0",
          "trail_price": "3.14",
          "type": "market",
          "updated_at": "2021-03-16T18:38:01.942282Z"
        }
      ],
      "limit_price": "3.14",
      "notional": "4.2",
      "order_type": "market",
      "position_intent": "buy_to_open",
      "qty": "4.2",
      "replaced_at": "2021-03-16T18:38:01.942282Z",
      "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "side": "buy",
      "status": "filled",
      "stop_price": "3.14",
      "submitted_at": "2021-03-16T18:38:01.942282Z",
      "symbol": "AALP",
      "time_in_force": "gtc",
      "trail_percent": "5.0",
      "trail_price": "3.14",
      "type": "market",
      "updated_at": "2021-03-16T18:38:01.942282Z"
    }
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.