close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2010

Table Of Contents

6.3 Catalogs

As with categories and products, catalogs can be retrieved by their external ID. From a catalog, you may query the root category as well as child categories, up to a fixed depth. For example, the following query retrieves the root category and the first level of child categories:

{
  commerce {
    catalog(catalogId: "sfcc:///catalog/catalog/storefront-catalog-en",
            siteId: "sfra-en-gb") {
      name
      externalId
      rootCategory {
        ...CategoryFragment
        children {
          ...CategoryFragment
        }
      }
    }
  }
}

fragment CategoryFragment on Category {
  name
  externalId
  products {
    name
    listPrice
  }
}

It is also possible to query a list of all available catalogs for a given site:

{
  commerce {
    catalogs(siteId: "sfra-en-gb") {
      name
      externalId
    }
  }
}

Search Results

Table Of Contents