• PXM Catalogs/
    PXM Shopper Catalog API/
    Get a Nodeʼs Children

    Get a Nodeʼs Children

    GET Get a Nodeʼs Children

    https://api.moltin.com/catalog/nodes/:nodeId/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 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 which parent nodes a node is associated with in the bread_crumb 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.

    You can curate the products in a node. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. You can do this using a filter. See Filtering.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    nodeIdRequiredstringThe unique identifier of a hierarchy node.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token to grant access to the API. Implicit Bearer token only returns products with live status; products with draft status are not included.
    X-Moltin-Customer-TokenOptionalstringThe unique identifier of a signed-in customer. Corresponds to the customer_ids attribute in a rule object.
    EP-ChannelOptionalstringThe channel, such as website or mobile app. Corresponds to the channel attribute in a rule object.
    EP-Context-TagOptionalstringA tag defined in the store, such as clearance. Corresponds to the tag attribute in a rule object.
    accept-languageOptionalstringThe natural language and locale that your storefront prefers. See accept-language.

    Query parameters

    NameRequiredTypeDescription
    page[limit]OptionalstringThe number of items to return per page. Minimum value is 1.
    page[offset]OptionalstringThe number of items to offset the results by. Offset is zero-based.

    Filtering

    The following table describes the supported operator and attributes when filtering on Get Node Children from a Catalog endpoint:

    OperatorDescriptionAttributes
    inReturns the specified product Ids in the order specified in the string. Wildcards are supported.product Id

    You should add the products IDs in the order you want them to be displayed in your node. The first product ID is displayed first in the product list.

    • 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.

    An example filter is shown below.

    /catalog/6dff977e-a8c4-4e32-8d2c-407266dde6dd/nodes/36bb85d0-4b7c-4667-a933-a4ff714f9282/products?filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)

    Request Example

    curl -X GET https://api.moltin.com/catalog/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007/relationships/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",
                    "curated_products": [
                      "57ddfc7c-81c1-4855-88a5-2dd9d2055897",
                      "42d940f9-fe26-4eed-9070-5e00234febe5",
                      "2ab84aa8-232c-4199-8cc5-e1554ff58884"
                    ],
                    "updated_at": "2021-03-05T21:48:32.874Z",
                    "published_at": "2021-04-13T02:36:16.505Z"
                },
                "meta": {
                    "bread_crumb": [
                      "04e748f1-83db-4013-85c8-9edfb0e1b5fa",
                      "94b882fa-85de-470e-acb3-5b11358e02de",
                      "a96a898b-444c-40b6-9c27-5fc74d08e685"
                    ]
                },
                "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"
                },
                "meta": {
                  "bread_crumb": [
                      "e5a64eae-56c2-48cd-b8b1-f5d3be734d52"
                  ]
                },
                "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/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007/relationships/children?page[offset]=0&page[limit]=25&",
            "last": "/catalog/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007/relationships/children?page[offset]=0&page[limit]=25&",
            "self": "/catalog/nodes/0e119de2-5fb0-4bca-9b84-b3fc6c903007/relationships/children"
          }
    }
    

    Was this helpful?

    Previous
    Get a Node