> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Holdings

> Holdings are retrieved by making a GET request to /accounts/holdings.

**Example 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.

## Query Parameters

<ParamField query="page" type="integer" required>
  The page of holdings to return to MX.
</ParamField>

## Response Fields

<ParamField body="bond_coupon_rate" type="string" />

<ParamField body="bond_maturity_date" type="string" />

<ParamField body="cost_basis" type="decimal" />

<ParamField body="currency_code" type="string" />

<ParamField body="cusip" type="string" />

<ParamField body="daily_change" type="decimal" />

<ParamField body="description" type="string" required />

<ParamField body="equity_classification" type="string" />

<ParamField body="fixed_income_classification" type="string" />

<ParamField body="holding_type" type="string" />

<ParamField body="id" type="string" required />

<ParamField body="isin" type="string" />

<ParamField body="market_value" type="decimal" required />

<ParamField body="metadata" type="string" />

<ParamField body="purchase_price" type="decimal" />

<ParamField body="sector" type="string" />

<ParamField body="sedol" type="string" />

<ParamField body="shares" type="decimal" />
