v1
latestOpenAPI 3.0.02026-07-26166415635.8 KBTrading
Close a Position for an Account
Closes (liquidates) the account's open position for the given symbol. Works for both long and short positions.
delete/v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}
Query parameters
qtystring
Optional the number of shares to liquidate. Can accept up to 9 decimal points. Cannot work with percentage
percentagestring
percentage of position to liquidate. Must be between 0 and 100. Would only sell fractional if position is originally fractional. Can accept up to 9 decimal points. Cannot work with qty
Response
OK
Example response
{
"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",
"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",
"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"
}