[Type] PositionsByGenericDate
Return
Returns details of user's investment positions filtered by a logical process date (such as βfirstβ, βlastβ, or βprevβ). This includes the quantity of each asset in a specific account and its current value.
Endpoint URL
https://api.wealthtechs.com/v2/graphql/
Parameters
Name | Type | Required | Description |
---|---|---|---|
date | string | Yes | A keyword for a temporal anchor. Valid values: first , last , prev . |
Authorization
// Authorization via JWT Token
Authorization: Bearer <YourToken>
Learn how to get access to our API V2.0 by clicking here.
You can copy and use our API v2.0 Public Token to get familiar with our API GraphQL Resources.
Responses
Code | Type |
---|---|
200 | Success |
204 | No Content |
400 | Bad Request |
401 | Unauthorized |
Example Code
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySW5mbyI6IntcIklkXCI6OTgxLFwiSWRlbnRpdHlJZFwiOlwiNjMyMzhhZTQtMzAyMC00NWI5LWEwODktOTE2ZTY4MDMyZTY3XCIsXCJVc2VyTmFtZVwiOlwiMF9URVNUX0NMSUVOVFwiLFwiRW1haWxcIjpcInRlc3RjbGllbnRAd2VhbHRodGVjaHMuY29tXCIsXCJGaXJzdE5hbWVcIjpcIlRlc3RcIixcIkxhc3ROYW1lXCI6XCJDbGllbnRcIixcIklzQ2xpZW50VXNlclwiOmZhbHNlfSIsIm5iZiI6MTY5NDcwMjU3OSwiZXhwIjoxOTI0OTIzNjAwLCJpc3MiOiJXZWFsdGhUZWNocyIsImF1ZCI6IkFQSVVzZXJzIn0.bNcP0ouNwtFoxrI7pYXw0WKiw0TN6w_R2-Ban5moo1A");
var graphql = JSON.stringify({
query: "query PositionsByGenericDate {\r\n positionsByGenericDate(date: "last") {\r\n nodes {\r\n custodianId\r\n customerId\r\n processDate\r\n accountId\r\n securityId\r\n shortPosition\r\n quantity\r\n marketValue\r\n originalCost\r\n originalCostDate\r\n originalFace\r\n }\r\n }\r\n}",
variables: {}
})
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: graphql,
redirect: 'follow'
};
fetch("https://api.wealthtechs.com/v2/graphql/", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Example Response
{
"data": {
"positionsByGenericDate": {
"nodes": [
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8492,
"shortPosition": false,
"quantity": 200000.0000000000,
"marketValue": 198652.8000000000,
"originalCost": 199112.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8516,
"shortPosition": false,
"quantity": 200000.0000000000,
"marketValue": 193444.6000000000,
"originalCost": 200011.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8646,
"shortPosition": false,
"quantity": 500000.0000000000,
"marketValue": 495548.0000000000,
"originalCost": 500012.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8648,
"shortPosition": false,
"quantity": 500000.0000000000,
"marketValue": 497752.0000000000,
"originalCost": 500012.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8661,
"shortPosition": false,
"quantity": 40000.0000000000,
"marketValue": 39959.0800000000,
"originalCost": 41533.1600000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8663,
"shortPosition": false,
"quantity": 150000.0000000000,
"marketValue": 148842.9000000000,
"originalCost": 152986.5000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8665,
"shortPosition": false,
"quantity": 400000.0000000000,
"marketValue": 379534.4000000000,
"originalCost": 400011.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8695,
"shortPosition": false,
"quantity": 400000.0000000000,
"marketValue": 399276.4000000000,
"originalCost": 400012.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 8740,
"shortPosition": false,
"quantity": 25000.0000000000,
"marketValue": 24566.0000000000,
"originalCost": 26724.0000000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
},
{
"custodianId": 0,
"customerId": 0,
"processDate": "2023-09-11T00:00:00.000-04:00",
"accountId": 12,
"securityId": 9090,
"shortPosition": false,
"quantity": 60000.0000000000,
"marketValue": 55335.1200000000,
"originalCost": 61317.0100000000,
"originalCostDate": "1950-01-01T00:00:00.000-05:00",
"originalFace": null
}
]
}
}
}