close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2101

Table Of Contents

6.1 Products

One way to query products is to retrieve a list of products as a part of a category or catalog query, or by navigating from a CMProductTeaser or CMExternalProduct content query to the corresponding product. These kinds of queries will be discussed in the following sections. A more straightforward way to retrieve a product is to query them by their external ID:

{
  commerce {
    product(externalId: "sfcc:///catalog/product/25592211M",
            siteId: "sfra-en-gb") {
      name
      listPrice
      offerPrice
      locale
    }
  }
}

Products may also be queried by their SEO segment or technical ID.

Note

Client side Caching

Some existing graphql frameworks like Apollo do support client side caching. As caching usually requires a unique cache key, the 'externalId' of commerce objects is aliased additionally to the field 'id'.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.