Developer Portal

Position HistoryGET

Return one page of the account's closed positions in an inclusive UTC-second range, newest creation time first. There is no maximum range. Pass the returned nextToken back unchanged, with the same from/to, to fetch the next page; it is empty on the last page.

View as Markdown
GET
/accounts/{id}/history/positions

Authorization

Authorization<token>

Bearer access token issued by the admin login flow.

In: header

Path Parameters

idRequiredstring

Query Parameters

fromstring

Inclusive lower bound, truncated to a UTC second. Omit for all history.

Format: "date-time"
tostring

Inclusive upper bound, truncated to a UTC second. Omit to use the current time.

Format: "date-time"
limitinteger

Page size (default: 25, max: 500; larger values are clamped)

Format: "int32"
nextTokenstring

Opaque cursor from the previous response; send it unchanged with the same from/to. Omit for the first page.

curl -X GET "https://example.com/accounts/<string>/history/positions?from=2019-08-24T14%3A15%3A22Z&to=2019-08-24T14%3A15%3A22Z&limit=0&nextToken=%3Cstring%3E" \
  -H "Authorization: <token>"

A successful response.

{
  "positions": [
    {
      "id": "string",
      "symbolId": "string",
      "accountId": "string",
      "orderId": "string",
      "symbolName": "string",
      "openPrice": 0.1,
      "openPriceRaw": 0.1,
      "closePrice": 0.1,
      "closePriceRaw": 0.1,
      "side": "TRADE_SIDE_UNSPECIFIED",
      "status": "POSITION_STATUS_UNSPECIFIED",
      "commission": 0.1,
      "swap": 0.1,
      "profit": 0.1,
      "units": 0.1,
      "qty": 0.1,
      "qtyClosed": 0.1,
      "comment": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "realizedPnl": 0.1,
      "unitsClosed": 0.1,
      "usdPnl": 0.1,
      "currentPrice": 0.1,
      "margin": 0.1,
      "fundingAccrued": 0.1,
      "route": "POSITION_ROUTE_UNSPECIFIED",
      "gatewayId": "string"
    }
  ],
  "nextToken": "string"
}