Skip to main content
GET
/
accounts
/
{account_id}
/
holdings
List Holdings
curl --request GET \
  --url https://api.example.com/accounts/{account_id}/holdings \
  --header 'Content-Type: application/json' \
  --data '
{
  "bond_coupon_rate": "<string>",
  "bond_maturity_date": "<string>",
  "cost_basis": 123,
  "currency_code": "<string>",
  "cusip": "<string>",
  "daily_change": 123,
  "description": "<string>",
  "equity_classification": "<string>",
  "fixed_income_classification": "<string>",
  "holding_type": "<string>",
  "id": "<string>",
  "isin": "<string>",
  "market_value": 123,
  "metadata": "<string>",
  "purchase_price": 123,
  "sector": "<string>",
  "sedol": "<string>",
  "shares": 123
}
'
import requests

url = "https://api.example.com/accounts/{account_id}/holdings"

payload = {
"bond_coupon_rate": "<string>",
"bond_maturity_date": "<string>",
"cost_basis": 123,
"currency_code": "<string>",
"cusip": "<string>",
"daily_change": 123,
"description": "<string>",
"equity_classification": "<string>",
"fixed_income_classification": "<string>",
"holding_type": "<string>",
"id": "<string>",
"isin": "<string>",
"market_value": 123,
"metadata": "<string>",
"purchase_price": 123,
"sector": "<string>",
"sedol": "<string>",
"shares": 123
}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
bond_coupon_rate: '<string>',
bond_maturity_date: '<string>',
cost_basis: 123,
currency_code: '<string>',
cusip: '<string>',
daily_change: 123,
description: '<string>',
equity_classification: '<string>',
fixed_income_classification: '<string>',
holding_type: '<string>',
id: '<string>',
isin: '<string>',
market_value: 123,
metadata: '<string>',
purchase_price: 123,
sector: '<string>',
sedol: '<string>',
shares: 123
})
};

fetch('https://api.example.com/accounts/{account_id}/holdings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/accounts/{account_id}/holdings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'bond_coupon_rate' => '<string>',
'bond_maturity_date' => '<string>',
'cost_basis' => 123,
'currency_code' => '<string>',
'cusip' => '<string>',
'daily_change' => 123,
'description' => '<string>',
'equity_classification' => '<string>',
'fixed_income_classification' => '<string>',
'holding_type' => '<string>',
'id' => '<string>',
'isin' => '<string>',
'market_value' => 123,
'metadata' => '<string>',
'purchase_price' => 123,
'sector' => '<string>',
'sedol' => '<string>',
'shares' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.example.com/accounts/{account_id}/holdings"

payload := strings.NewReader("{\n \"bond_coupon_rate\": \"<string>\",\n \"bond_maturity_date\": \"<string>\",\n \"cost_basis\": 123,\n \"currency_code\": \"<string>\",\n \"cusip\": \"<string>\",\n \"daily_change\": 123,\n \"description\": \"<string>\",\n \"equity_classification\": \"<string>\",\n \"fixed_income_classification\": \"<string>\",\n \"holding_type\": \"<string>\",\n \"id\": \"<string>\",\n \"isin\": \"<string>\",\n \"market_value\": 123,\n \"metadata\": \"<string>\",\n \"purchase_price\": 123,\n \"sector\": \"<string>\",\n \"sedol\": \"<string>\",\n \"shares\": 123\n}")

req, _ := http.NewRequest("GET", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.example.com/accounts/{account_id}/holdings")
.header("Content-Type", "application/json")
.body("{\n \"bond_coupon_rate\": \"<string>\",\n \"bond_maturity_date\": \"<string>\",\n \"cost_basis\": 123,\n \"currency_code\": \"<string>\",\n \"cusip\": \"<string>\",\n \"daily_change\": 123,\n \"description\": \"<string>\",\n \"equity_classification\": \"<string>\",\n \"fixed_income_classification\": \"<string>\",\n \"holding_type\": \"<string>\",\n \"id\": \"<string>\",\n \"isin\": \"<string>\",\n \"market_value\": 123,\n \"metadata\": \"<string>\",\n \"purchase_price\": 123,\n \"sector\": \"<string>\",\n \"sedol\": \"<string>\",\n \"shares\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/accounts/{account_id}/holdings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"bond_coupon_rate\": \"<string>\",\n \"bond_maturity_date\": \"<string>\",\n \"cost_basis\": 123,\n \"currency_code\": \"<string>\",\n \"cusip\": \"<string>\",\n \"daily_change\": 123,\n \"description\": \"<string>\",\n \"equity_classification\": \"<string>\",\n \"fixed_income_classification\": \"<string>\",\n \"holding_type\": \"<string>\",\n \"id\": \"<string>\",\n \"isin\": \"<string>\",\n \"market_value\": 123,\n \"metadata\": \"<string>\",\n \"purchase_price\": 123,\n \"sector\": \"<string>\",\n \"sedol\": \"<string>\",\n \"shares\": 123\n}"

response = http.request(request)
puts response.read_body
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

page
integer
required
The page of holdings to return to MX.

Response Fields

bond_coupon_rate
string
bond_maturity_date
string
cost_basis
decimal
currency_code
string
cusip
string
daily_change
decimal
description
string
required
equity_classification
string
fixed_income_classification
string
holding_type
string
id
string
required
isin
string
market_value
decimal
required
metadata
string
purchase_price
decimal
sector
string
sedol
string
shares
decimal