Get Market tree

Description

This service retrieves a hierarchical tree of all active elements for a given market, including brand families, brands, products, and SKUs. You can use optional parameters to filter the results and retrieve a specific portion of the tree.


Request

Endpoint

GET https://<server-url>/api/v4/referencedata/markets-tree

Parameters

All parameters for this endpoint are optional and are sent via the query string.

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint making the request. If sent as a header, the name must be Thalamus-Touchpoint.

token

Query / Header

The authentication token for the API. If sent as a header, the name must be Thalamus-Token.

marketid

Query

Optional. An integer used to retrieve the tree for a specific market by its ID.

brandfamilyid

Query

Optional. An integer used to retrieve the tree for a specific brand family by its ID.

brandid

Query

Optional. An integer used to retrieve the tree for a specific brand by its ID.

market

Query

Optional. A string used to retrieve the tree for a specific market by its code.

skipskucodes

Query

Optional. A boolean (true or false, defaults to false). If true, the skus array for each product will not be included in the response.

Content-Type

Header

Specifies the content type of the request body. Must be application/json.

Full URL Example

https://<server-url>/api/v4/referencedata/markets-tree?marketid=1&brandfamilyid=1&brandid=1&skipskucodes=true&touchpoint=test&token=...

https://<server-url>/api/v4/referencedata/markets-tree?market=market-code&touchpoint=test&token=...

Request Body

This request does not have a body.


Response

✅ Successful Response: 200 OK

A JSON object is returned, representing the hierarchical structure of the requested market data. The structure nests from the top-level market down through brandFamilies, brands, products, and skus.

JSON

{
  "name": "market",
  "id": 1,
  "code": "market",
  "description": "market",
  "active": true,
  "brandFamilies": [
    {
      "name": "brandFamily",
      "id": 1,
      "code": "brandFamily",
      "ageRestriction": false,
      "brands": [
        {
          "name": "brand",
          "id": 1,
          "products": [
            {
              "name": "product1",
              "id": 1,
              "code": "product1",
              "description": "product1",
              "brand": {
                "name": "brand",
                "id": 1,
                "products": []
              },
              "skus": [
                {
                  "name": "sku1",
                  "id": 2,
                  "code": "",
                  "description": "sku1",
                  "codes": {
                    "tires": "1"
                  },
                  "product": {
                    "name": "product",
                    "id": 1,
                    "code": "product",
                    "description": "product",
                    "brand": {
                      "name": "brand",
                      "id": 1,
                      "products": []
                    },
                    "skus": []
                  },
                  "relatedSkuIds": []
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Last updated

Was this helpful?