# Retrieve Contract Tree Structure Summary
source: https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/data-management/query-cms-get-particular-data/retrieve-con-tree-struct-summary/index.md

## Overview {#overview}

This use case describes how you fetch a summary of contracts from the tree structure created in the CMS for the specified contract.

## Sequence diagram {#sequence-diagram}

Diagram retrieve-con-tree-struct-summary

### Explanation {#explanation}

1. The server sends a `GET` request to the `/contracts/{contract_id}/tree-summaries` endpoint to fetch a list of all technical accounts associated with the specified `contract_id` in the CMS. Note: The server must use `accountContractId` or `cardContractId` in place of `contract_id` in the path to fetch data for the account contract or card contract, respectively.
2. The API returns the summary containing the contract structure for the `contract_id` stored in the CMS. Refer to [Endpoint](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/data-management/query-cms-get-particular-data/retrieve-con-tree-struct-summary/index.md#endpoint) to check the complete list of data returned by the endpoint. Tip: The operation supports [pagination](https://developer.mastercard.com/mastercard-processing-core/documentation/api-basics-section/pagination-filtering/index.md). Note: The operation returns the summary of contracts created under the specified contract and upper-level contracts from the tree structure created in the CMS. For example, if there is one account contract (top account contract) with one subaccount under which three card contracts have been created in the CMS, then the API returns the contract tree summary containing:
   * five contracts (top account contract, subaccount contract, and all three card contracts) for the top account contract search
   * three contracts (top account contract, subaccount contract, and one card contract specified in the request) for the card contract search
   Refer to [Sandbox testing](https://developer.mastercard.com/mastercard-processing-core/documentation/sandbox-testing/data-management/query-cms-to-get-particular-data/retrieve-con-tree-struct-sum/index.md) for information on how to execute the use case in the Sandbox environment.

## Endpoint {#endpoint}


API Reference: `GET /contracts/{contract_id}/tree-summaries`

