Skip to main content

Get a Node's Children

GET 

https://euwest.api.elasticpath.com/catalogs/:catalog_id/releases/:release_id/nodes/:node_id/relationships/children

Returns the child nodes for a node from a published catalog.

note

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

You can see the parent nodes a node is associated with in the breadcrumbs metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See Product and Node Associations in Breadcrumb Metadata.

In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. For more information, see Building breadcrumbs in a storefront.

The response lists the products associated with the nodes. If products are curated, they are displayed in curated_products. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront.

  • If you don't provide any curated_products, products are listed by their updated_at time in descending order, with the most recently updated product first.
  • If you configure curated_products for only a few products, the curated products are displayed first and the other products are displayed in the order of updated_at time.
  • You can only curate 20 products or less. You cannot have more than 20 curated products.
  • If a curated product is removed from a node, the product is also removed from the curated_products list.
  • A product that is curated has the "curated_product": true attribute displayed.

Filtering

This endpoint supports filtering. For general syntax, see Filtering. The following operators and attributes are available.

OperatorDescriptionAttributesExample
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,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)

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.

    node_id stringrequired

    The catalog node ID.

Query Parameters

    filter string

    This endpoint 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: <= 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 child nodes of a catalog node.

Schema
    meta object

    Contains the results for the entire collection.

    results object

    Total number of results for the entire collection.

    totalint64

    Total number of results for the entire collection.

    page object
    limitint64

    The maximum number of records for all pages.

    offsetint64

    The current offset by number of pages.

    currentint64

    The current number of pages.

    totalint64

    The total number of records for the entire collection.

    data object[]
  • Array [
  • attributes object

    Resource attributes of a catalog node.

    created_atdate-time

    The date and time a node was created.

    Example: 1970-01-01T00:00:00.000
    published_atdate-timenullable

    The date and time a node was published in a catalog.

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

    A description of a node.

    Example: Formal dresswear
    labelstring
    Example: category
    namestring

    The name of a node. Names must be unique among sibling nodes in a hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies.

    Example: Formal dresswear
    slugstring

    A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies.

    Example: formal
    curated_productsstring[]

    A list of curated products for a node. You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront.

    statusstring
    Example: live
    shopper_attributes object

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

    property name*string
    updated_atdate-time

    The date and time a node was updated.

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

    The unique identifier of a node.

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

    Relationships to parent and child nodes, and products.

    products object

    A URL to all products associated with a node.

    data object[]
  • Array [
  • iduuid

    A unique identifier for a product.

    typestring

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

    Possible values: [product]

    Example: product
  • ]
  • 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 child nodes associated with a node.

    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.

    parent object

    A URL to all parent nodes associated with a node.

    data objectrequired
    typestringrequired

    Possible values: [node]

    Example: node
    idstringrequired
    Example: 8fccaa19-dba9-4621-8d11-31a222a68c7c
    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.

    hierarchy object

    A URL to the hierarchies associated with a node.

    data objectrequired
    typestringrequired

    Possible values: [hierarchy]

    Example: hierarchy
    idstringrequired
    Example: 8fccaa19-dba9-4621-8d11-31a222a68c7c
    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.

    typestring

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

    Example: node
    meta object

    A node's metadata.

    languagestring

    The node details localized in the supported languages.

    Example: en-GB
    bread_crumbstring[]deprecated

    Helps you understand the association of products with nodes. It explains how products are associated with parent nodes and the relationship among the array of nodes. This is useful if you want to improve how your shoppers search within you store.

    breadcrumbs object[]

    Node Breadcrumbs

  • Array [
  • idstring

    The unique identifier of a hierarchy/node.

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

    The name of the hierarchy/node.

    Example: Formal dresswear
    slugstring

    A slug for the hierarchy/node.

    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.

    selfurinullable

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

    firsturinullable

    Always the first page.

    lasturinullable

    This is null if there is only one page.

    prevurinullable

    This is null if there is only one page.

    nexturinullable

    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/nodes/:node_id/relationships/children");
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
— pathrequired
— query
— query
— query
— header
ResponseClear

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