Get all Hierarchies
GET/catalogs/:catalog_id/releases/:release_id/hierarchies
Returns the hierarchies from a published catalog.
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.
Operator | Description | Supported 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,some-id) |
Building breadcrumbs in a storefront
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. An example is shown below.
filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)
- Specify the node Ids in the filter expression.
- You can have as many node Ids as you want.
- 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 ID.
The unique identifier of a published release of the catalog or latestPublished
for the most recently published version.
Query Parameters
This endpoints 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 language and locale your storefront prefers. See Accept-Language.
Responses
- 200
- default
The hierarchies of a catalog.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
meta object
Contains the results for the entire collection.
results object
Total number of results for the entire collection.
Total number of results for the entire collection.
page object
The maximum number of records for all pages.
The current offset by number of pages.
The current number of pages.
The total number of records for the entire collection.
data object[]
attributes object
Resource attributes of a catalog hierarchy.
The date and time a hierarchy is created.
The date and time a hierarchy is published in a catalog.
A description of a hierarchy.
The name of a hierarchy.
A unique slug for a hierarchy.
The date and time a hierarchy was updated.
A unique identifier of a hierarchy.
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.
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.
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.
A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.
This represents the type of object being returned. Always hierarchy
.
meta object
A hierarchy's metadata.
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.
links object
Links allow you to move between requests.
Single entities use a self
parameter with a link the specific resource.
Always the first page.
This is null
if there is only one page.
This is null
if there is only one page.
This is null
if there is only one page.
{
"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",
"name": "Formal dresswear",
"slug": "formal",
"updated_at": "1970-01-01T00:00:00.000"
},
"id": "e871df93-c769-49a9-9394-a6fd555b8e8a",
"relationships": {
"products": {
"links": {
"related": "string"
}
},
"children": {
"links": {
"related": "string"
}
},
"nodes": {
"links": {
"related": "string"
}
}
},
"type": "hierarchy",
"meta": {
"language": "en-GB"
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
An unexpected error.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"detail": "not processable",
"status": "422",
"title": "There was a problem processing your request."
}
]
}