Get a Hierarchyʼs Child Nodes
GET
Get the Child Nodes of a Hierarchy
https://api.moltin.com/catalog/hierarchies/:hierarchyId/children
Returns the child nodes for the root node of the specified hierarchy.
If you have multiple catalog rules defined, the rule that best matches the shopperʼs context is used to determine which catalog is retrieved. For information about how rules are matched, see Resolving Catalog Rules.
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. For more information, see Catalog Releases Overview.
Parameters
Path parameters
Name | Required | Type | Description |
---|---|---|---|
hierarchyId | Required | string | The unique identifier of a hierarchy. |
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token to grant access to the API. The Implicit Bearer token returns only resources with the live status. |
X-Moltin-Customer-Token | Optional | string | The unique identifier of a signed-in customer. Corresponds to the customer_ids attribute in a rule object. |
EP-Channel | Optional | string | The channel, such as website or mobile app. Corresponds to the channel attribute in a rule object. |
EP-Context-Tag | Optional | string | A tag defined in the store, such as clearance . Corresponds to the tag attribute in a rule object. |
Query parameters
Name | Required | Type | Description |
---|---|---|---|
page[limit] | Optional | string | The number of items to return per page. Minimum value is 1 . |
page[offset] | Optional | string | The number of items to offset the results by. Offset is zero-based. |
Request Example
curl -X GET https://api.moltin.com/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007/children \
-H "Authorization: Bearer XXXX" \
-H "EP-Channel: web store" \
Response Example
200 OK
{
"data": [
{
"id": "e2f3372c-89ed-49ae-a9c7-0dc1888f10ec",
"type": "node",
"attributes": {
"created_at": "2021-03-05T21:48:32.874Z",
"description": "All stoves and ovens",
"name": "Ranges",
"slug": "Ranges-MA1",
"updated_at": "2021-03-05T21:48:32.874Z",
"published_at": "2021-04-13T02:36:16.505Z"
},
"meta": {
"bread_crumbs": {
"04e748f1-83db-4013-85c8-9edfb0e1b5fa": [
"e5a64eae-56c2-48cd-b8b1-f5d3be734d52",
"94b882fa-85de-470e-acb3-5b11358e02de"
],
"a96a898b-444c-40b6-9c27-5fc74d08e685": [
"e5a64eae-56c2-48cd-b8b1-f5d3be734d52"
]
},
"relationships": {
"children": {
"links": {
"related": "/catalog/nodes/e2f3372c-89ed-49ae-a9c7-0dc1888f10ec/relationships/children"
}
},
"hierarchy": {
"data": {
"id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
"type": "hierarchy"
},
"links": {
"related": "/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007"
}
},
"parent": {
"data": {
"id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
"type": "node"
},
"links": {
"related": "/catalog/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007"
}
},
"products": {
"links": {
"related": "/catalog/nodes/e2f3372c-89ed-49ae-a9c7-0dc1888f10ec/relationships/products"
}
}
}
},
{
"id": "39f96a3f-5577-473f-a263-f21fb2013469",
"type": "node",
"attributes": {
"created_at": "2021-03-08T17:50:14.629Z",
"description": "All cooling units for food",
"name": "Refrigerators",
"slug": "Refrigerators-MA1",
"updated_at": "2021-03-08T17:50:14.629Z",
"published_at": "2021-04-13T02:36:16.505Z"
},
"relationships": {
"children": {
"links": {
"related": "/catalog/nodes/39f96a3f-5577-473f-a263-f21fb2013469/relationships/children"
}
},
"hierarchy": {
"data": {
"id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
"type": "hierarchy"
},
"links": {
"related": "/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007"
}
},
"parent": {
"data": {
"id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
"type": "node"
},
"links": {
"related": "/catalog/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007"
}
},
"products": {
"links": {
"related": "/catalog/nodes/39f96a3f-5577-473f-a263-f21fb2013469/relationships/products"
}
}
}
}
],
"links": {
"first": "/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007/children?page[offset]=0&page[limit]=25&",
"last": "/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007/children?page[offset]=0&page[limit]=25&",
"self": "/catalog/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007/children"
}
}
<