List Holdings
Example MX Request URL: https://mdx.yourdomain.com/acme/accounts/0034/holdings?page=1
Holdings are retrieved by making a GET request to /accounts/{account_id}/holdings.
When synchronizing holdings data, holdings will be requested for each account returned from the GET /accounts request that includes <has_holdings>true</has_holdings>. Holdings will not be requested for any account that does not indicate it has holdings.
If the provided account_id is invalid, a 404 Not Found error response should be returned.
The list holdings success response must contain an <account> element. The <account> element must contain an <id> field and a <holdings> element. Any other account fields will be ignored.
If the account contains no holdings, an empty or self-terminating <holdings> element (including the required attributes) should be returned in the <account> element.
Pagination
Holdings responses may be paginated when there are more than can conveniently be returned in a single response. You can return any number of holdings, but the response must be received in a timely manner. If MX doesn't receive a response within 60 seconds, the request will time out and the job will be terminated. If you need to retrieve holdings data from more than one data repository, then pagination can be used so that the holdings from each data repository can be retrieved separately.
An MX request to /accounts/{account_id}/holdings always includes a page parameter on the URL. Your response must include page and pages attributes in the <holdings> element. The page attribute will reflect the page being returned. MX always makes a request for page 1. The pages attribute returned in the response for page 1 indicates how many pages should be requested. If pages is greater than one, MX will request the additional pages.
You can cause MX to "break out" of these requests by returning pages="0" in any response. This is an indication that the last page has been reached and that MX should not request additional pages.
For example: Your response to page 1 indicates there will be 5 pages. MX will normally make additional requests for pages 2 through 5. However, if any of those requests returns pages="0" in the response, MX will not make any further page requests. This allows "dynamic paging" where a partner can signal to MX that there are no more pages even if the initial pages value has not yet been reached.
MX Request Query String Parameters
| Field | Required | Type |
|---|---|---|
page The page of holdings to return to MX. | Required | Integer |
Response Fields
| Field | Required | Type |
|---|---|---|
bond_coupon_rate | Optional | String |
bond_maturity_date | Optional | String |
cost_basis | Optional | Decimal |
currency_code | Optional | String |
cusip | Optional | String |
daily_change | Optional | Decimal |
description | Required | String |
equity_classification | Optional | String |
fixed_income_classification | Optional | String |
holding_type | Optional | String |
id | Required | String |
isin | Optional | String |
market_value | Required | Decimal |
metadata | Optional | String |
purchase_price | Optional | Decimal |
sector | Optional | String |
sedol | Optional | String |
shares | Optional | Decimal |