Example Use Case

Let’s suppose that a customer wants to access information about the positions of a certain group of accounts filtered by the Master field for a specific date. From the position information, they are interested in knowing the Quantity, MarketValue, OriginalCost, and OriginalCostDate. Additionally, they need data about the Security of that position, specifically the SecurityTypeCode, PrimarySymbol, Cusip, and Sedol fields.

Example Request

// Endpoint URL and Query Options for this example

`https://api.wealthtechs.com/v2/odata/Accounts?$filter=Master eq '123456789'&$expand=Positions($top=3;$filter=ProcessDate eq 2023-09-13;$select=Quantity,MarketValue,OriginalCost,OriginalCostDate;$expand=Security($select=PrimarySymbol,Cusip,Sedol;$expand=SecurityType($select=Code)))&$select=Number,Master,Positions&$top=5`
// Example Request using JavaScript

var myHeaders = new Headers();

myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySW5mbyI6IntcIklkXCI6OTgxLFwiSWRlbnRpdHlJZFwiOlwiNjMyMzhhZTQtMzAyMC00NWI5LWEwODktOTE2ZTY4MDMyZTY3XCIsXCJVc2VyTmFtZVwiOlwiMF9URVNUX0NMSUVOVFwiLFwiRW1haWxcIjpcInRlc3RjbGllbnRAd2VhbHRodGVjaHMuY29tXCIsXCJGaXJzdE5hbWVcIjpcIlRlc3RcIixcIkxhc3ROYW1lXCI6XCJDbGllbnRcIixcIklzQ2xpZW50VXNlclwiOmZhbHNlfSIsIm5iZiI6MTY5NDcwMjU3OSwiZXhwIjoxOTI0OTIzNjAwLCJpc3MiOiJXZWFsdGhUZWNocyIsImF1ZCI6IkFQSVVzZXJzIn0.bNcP0ouNwtFoxrI7pYXw0WKiw0TN6w_R2-Ban5moo1A");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.wealthtechs.com/v2/odata/Accounts?$filter=Master eq '123456789'&$expand=Positions($top=3;$filter=ProcessDate eq 2023-09-13;$select=Quantity,MarketValue,OriginalCost,OriginalCostDate;$expand=Security($select=PrimarySymbol,Cusip,Sedol;$expand=SecurityType($select=Code)))&$select=Number,Master,Positions&$top=5", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Example Response

{
    "@odata.context": "https://api.wealthtechs.com/v2/odata/$metadata#Accounts(Number,Master,Positions,Positions(Quantity,MarketValue,OriginalCost,OriginalCostDate,Security(PrimarySymbol,Cusip,Sedol,SecurityType(Code))))",
    "value": [
        {
            "Number": "X72843476R",
            "Master": "123456789",
            "Positions": [
                {
                    "Quantity": 200000,
                    "MarketValue": 198655.8,
                    "OriginalCost": 199112,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00084928",
                        "Cusip": "C00084928",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "CD"
                        }
                    }
                },
                {
                    "Quantity": 200000,
                    "MarketValue": 193459,
                    "OriginalCost": 200011,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00085168",
                        "Cusip": "C00085168",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "CD"
                        }
                    }
                },
                {
                    "Quantity": 500000,
                    "MarketValue": 495545.5,
                    "OriginalCost": 500012,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00086468",
                        "Cusip": "C00086468",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "CD"
                        }
                    }
                }
            ]
        },
        {
            "Number": "Y41213443S",
            "Master": "123456789",
            "Positions": []
        },
        {
            "Number": "Z68397130T",
            "Master": "123456789",
            "Positions": [
                {
                    "Quantity": 80000,
                    "MarketValue": 74496,
                    "OriginalCost": 79945.8,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00843733",
                        "Cusip": "C00843733",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "MB"
                        }
                    }
                },
                {
                    "Quantity": 75000,
                    "MarketValue": 61266.75,
                    "OriginalCost": 73964.5,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00085617",
                        "Cusip": "C00085617",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "CB"
                        }
                    }
                },
                {
                    "Quantity": 100000,
                    "MarketValue": 89463.3,
                    "OriginalCost": 99871,
                    "OriginalCostDate": "1950-01-01T00:00:00-05:00",
                    "Security": {
                        "PrimarySymbol": "C00086397",
                        "Cusip": "C00086397",
                        "Sedol": null,
                        "SecurityType": {
                            "Code": "CB"
                        }
                    }
                }
            ]
        }
    ]
}

Other Use Cases

The examples below show various ways of acquiring data by using commonly used filters. For Javascript queries, please use the sample above and replace the URL with the samples below.

Filter by Date

// Endpoint URL and Query Options for this example

'https://api.wealthtechs.com/v2/odata/positions?filter=processdate eq 2024-04-05'

Filter by Custodian

// Endpoint URL and Query Options for this example

'https://api.wealthtechs.com/v2/odata/positions?filter= custodianid eq 36'

Filter by AccountId

// Endpoint URL and Query Options for this example

'https://api.wealthtechs.com/v2/odata/positions?filter= accountid eq 3922'

Filter by Date and Custodian

// Endpoint URL and Query Options for this example

'https://api.wealthtechs.com/v2/odata/positions?filter=processdate eq 2024-04-05 and custodianid eq 36'