Get Positions
API URL: POST https://userapi-demo.s2f.projectx.com/DataExport/positions
API Reference: /DataExport/positions
Description
Retrieves a list of all positions. If a time is provided in the request, only updated positions will be returned.
Parameters
Name | Type | Description | Required | Nullable |
---|---|---|---|---|
after | datetime | Retrieves list of positions that have been created or updated after this time. | false | true |
Example Usage
Example Request
- Request
- cURL
{
"after": "2024-06-13T02:19:13.180Z"
}
curl -X 'POST' \
'https://userapi-demo.s2f.projectx.com/positions' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"after": "2024-06-13T02:19:13.180Z"
}'
Example Response
- Success
{
"data": [
{
"id": 1,
"symbolId": "F.US.EP",
"openPnl": 0,
"positionSize": -2,
"averagePrice": 5437.25,
"contract": "ESM4",
"contractGroup": "/ES",
"timestamp": "2024-06-13T02:45:55.677Z"
}
],
"success": true,
"errorMessage": null
}