Get a Node's Children
GEThttps://euwest.api.elasticpath.com/catalog/nodes/:node_id/relationships/children
Returns the child nodes for a node in the catalog.
If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see Resolving Catalog Rules.
You can see which 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.
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.
- A product that is curated has the "curated_product": true attribute displayed.
- If a curated product is removed from a node, the product is also removed from the curated_products list.
Filtering
This endpoint supports filtering. For general syntax, see Filtering. The following operators and attributes are available.
Operator | Description | Attributes | Example |
---|---|---|---|
Eq | Checks if the values of two operands are equal. If they are, the condition is true. | name , slug | filter=eq(name,some-name) |
in | Checks if the values are included in the specified string. If they are, the condition is true. | ||
Id | filter=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
The catalog node ID.
Query Parameters
This endpoint supports filtering, see Filtering.
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.
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
The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the EP-Channel
header in your requests.
Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the EP-Context-Tag
header.
The language and locale your storefront prefers. See Accept-Language.
Responses
- 200
- default
The child nodes of a catalog node.
- application/json
- Schema
- Example (auto)
Schema
meta object
data object[]
links object
{
"meta": {
"results": {
"total": 0
},
"page": {
"limit": 0,
"offset": 0,
"current": 0,
"total": 0
}
},
"data": [
{
"attributes": {
"created_at": "1970-01-01T00:00:00.000",
"published_at": "1970-01-01T00:00:00.000",
"description": "Formal dresswear",
"label": "category",
"name": "Formal dresswear",
"slug": "formal",
"curated_products": [
"8dbb35b2-ef04-477e-974d-e5f3abe6faae"
],
"status": "live",
"shopper_attributes": {},
"updated_at": "1970-01-01T00:00:00.000"
},
"id": "e871df93-c769-49a9-9394-a6fd555b8e8a",
"relationships": {
"products": {
"data": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "product"
}
],
"links": {
"related": "string"
}
},
"children": {
"links": {
"related": "string"
}
},
"parent": {
"data": {
"type": "node",
"id": "8fccaa19-dba9-4621-8d11-31a222a68c7c"
},
"links": {
"related": "string"
}
},
"hierarchy": {
"data": {
"type": "hierarchy",
"id": "8fccaa19-dba9-4621-8d11-31a222a68c7c"
},
"links": {
"related": "string"
}
}
},
"type": "node",
"meta": {
"language": "en-GB",
"breadcrumbs": [
{
"id": "e871df93-c769-49a9-9394-a6fd555b8e8a",
"name": "Formal dresswear",
"slug": "formal"
}
],
"has_children": true
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
The unexpected error.
- application/json
- Schema
- Example (auto)
Schema
errors object[]
{
"errors": [
{
"detail": "not processable",
"status": "422",
"title": "There was a problem processing your request."
}
]
}
Authorization: Authorization
name: Authorizationtype: httpin: headerscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://euwest.api.elasticpath.com/catalog/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());