Skip to main content

Get all Hierarchies

GET 

https://euwest.api.elasticpath.com/catalogs/:catalog_id/releases/:release_id/hierarchies

Returns the hierarchies from a published catalog.

note

Currently, published catalogs are limited to the current release and two releases prior to the current release.

Filtering

This endpoint supports filtering. For general syntax, see Filtering.

OperatorDescriptionSupported AttributesExample
EqChecks if the values of two operands are equal. If they are, the condition is true.name, slugfilter=eq(name,some-name)
InChecks if the values are included in the specified string. If they are, the condition is true.idfilter=in(id,some-id)

Building breadcrumbs in a storefront

In a catalog, you can use the nodes directly attached to a product to build breadcrumbs in your storefront. This eliminates the need for additional queries to fetch hierarchy or parent node details. Each node contains all the necessary information in breadcrumbs metadata, such as its own details and the details of its parent hierarchy/node(s), to construct the complete breadcrumb path without requiring additional queries.

An example is shown below:

filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)

  • Specify the node IDs directly attached to the product in the filter expression.
  • You can include as many node IDs as required.
  • It does not matter what order you specify the node IDs. The nodes are returned in the order they were last updated.

Request

Path Parameters

    catalog_id stringrequired

    The catalog ID.

    release_id stringrequired

    The unique identifier of a published release of the catalog or latestPublished for the most recently published version.

Query Parameters

    filter string

    This endpoints supports filtering. See Filtering.

    page[limit] int64

    Possible values: >= 1

    The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the page length store setting is used.

    page[offset] int64

    Possible values: >= 0 and <= 10000

    The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the page length store setting is used.

Header Parameters

    accept-language string

    The language and locale your storefront prefers. See Accept-Language.

Responses

The hierarchies of a catalog.

Schema
    meta object

    Contains the results for the entire collection.

    results object

    Total number of results for the entire collection.

    totalinteger<int64>

    Total number of results for the entire collection.

    page object
    limitinteger<int64>

    The maximum number of records for all pages.

    offsetinteger<int64>

    The current offset by number of pages.

    currentinteger<int64>

    The current number of pages.

    totalinteger<int64>

    The total number of records for the entire collection.

    data object[]
  • Array [
  • attributes object

    Resource attributes of a catalog hierarchy.

    created_atstring<date-time>

    The date and time a hierarchy is created.

    Example: 1970-01-01T00:00:00.000
    published_atstring<date-time>nullable

    The date and time a hierarchy is published in a catalog.

    Example: 1970-01-01T00:00:00.000
    descriptionstring

    A description of a hierarchy.

    Example: Formal dresswear
    namestring

    The name of a hierarchy.

    Example: Formal dresswear
    slugstring

    A unique slug for a hierarchy.

    Example: formal
    shopper_attributes object

    A collection of key-value string pairs, viewable by shoppers.

    property name*string
    updated_atstring<date-time>

    The date and time a hierarchy was updated.

    Example: 1970-01-01T00:00:00.000
    idstring

    A unique identifier of a hierarchy.

    Example: e871df93-c769-49a9-9394-a6fd555b8e8a
    relationships object

    Relationships to child nodes, and products.

    products object

    A URL to all the products associated with a hierarchy.

    links object

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    relatedstringrequired

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    children object

    A URL to all the child products associated with a hierarchy.

    links objectrequired

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    relatedstringrequired

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    nodes object

    A URL to all the nodes associated with a hierarchy.

    links objectrequired

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    relatedstringrequired

    A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.

    typestring

    This represents the type of object being returned. Always hierarchy.

    Example: hierarchy
    meta object

    A hierarchy's metadata.

    languagestring

    Product Experience Manager supports localization of hierarchies. If your store supports multiple languages, you can localize hierarchy names and descriptions. This is three-letter language code that represents the name of the language you have used.

    Example: en-GB
    breadcrumbs object[]

    Hierarchy Breadcrumbs

  • Array [
  • idstring

    The unique identifier of a hierarchy.

    Example: e871df93-c769-49a9-9394-a6fd555b8e8a
    namestring

    The name of the hierarchy.

    Example: Formal dresswear
    slugstring

    A slug for the hierarchy.

    Example: formal
  • ]
  • has_childrenbooleannullable

    Indicates whether a node has child nodes. true if the node has at least one child, false if it has none.

    Example: true
  • ]
  • links object

    Links allow you to move between requests.

    selfstring<uri>nullable

    Single entities use a self parameter with a link the specific resource.

    firststring<uri>nullable

    Always the first page.

    laststring<uri>nullable

    This is null if there is only one page.

    prevstring<uri>nullable

    This is null if there is only one page.

    nextstring<uri>nullable

    This is null if there is only one page.

Authorization: Authorization

name: Authorizationtype: httpin: headerscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://euwest.api.elasticpath.com/catalogs/:catalog_id/releases/:release_id/hierarchies");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
— query
— query
— query
— header
ResponseClear

Click the Send API Request button above and see the response here!