Index Salesforce Commerce Cloud: Pull approach


The pull approach requires your source to use the Stream API, but not all sources may support it in the Commerce context.

If you decide to use this approach, reach out to your Customer Success Manager (CSM) to verify whether it’s possible in your case.

This article explains how to pull data from a Salesforce Commerce Cloud instance to a Coveo organization. The indexed data is then used in a Coveo-powered search interface implemented in your storefront.


Make sure that you have:

  • data in your Salesforce Commerce Cloud instance.

  • access to the B2C Account Manager (also known as Demandware). To get access, you have to contact an account administrator within your organization.

  • a SLAS client created.

Index a Salesforce Commerce Cloud

  1. Log in to the SLAS Admin UI by using your own short code.

  2. Once logged in, you can see the Client ID and Secret fields. Copy the values of these fields and store them somewhere locally.

  3. To create a token for indexing data, you need to make a POST request to the getAccessToken endpoint of the Shopper Login API.

    You can do it by using the Postman application.

    1. Use the Client ID and Secret values from the previous steps as Login and Password respectively.

    2. Specify Basic Auth as the Authentication Type.

    3. Substitute your shortCode and organizationId


      You’ll receive an SLAS token in a response.


      The SLAS token is valid only for 30 minutes. Once it expires, you have to create a new one.

  4. Go to your Coveo organization and add a REST API cloud source. In the Configuration tab, expand the Content to include section and paste the following JSON.

      "Services": [
          "Paging": {
            "PageSize": 200,
            "offset": 0,
            "OffsetType": "item",
            "Parameters": {
              "Limit": "limit",
              "Offset": "offset"
          "Url": "https://{shortCode}", 1
          "Endpoints": [
              "Headers": {
                "Authorization": "Bearer @ApiKey" 2
              "Path": "/search/shopper-search/v1/organizations/{organizationId}/product-search", 3
              "QueryParameters": {
                "q": "storefront-catalog-m-en",
                "limit": "200", 4
                "siteId": "RefArch" 5
              "Method": "GET",
              "ItemType": "products",
              "ItemPath": "hits",
              "Uri": "[productName]/%[productId].html", 6
              "ClickableUri": "[productName]/%[productId].html",
              "Title": "%[productName] %[productId]",
              "ModifiedDate": "%[modified_time]",
              "Body": "%[productName] %[price] %[currency]",
              "Metadata": {
                "ec_name": "%[productName]",
                "ec_price": "%[price]",
                "ec_productid": "%[productId]",
                "ec_colors": "%[variationAttributes[?('color')].values[:].name]"
              "SubQueries": [
                  "Method": "GET",
                  "Path": "/product/shopper-products/v1/organizations/f_ecom_zzte-053/products/%[coveo_parent.ec_productid]",
                  "Headers": {
                    "Authorization": "Bearer @ApiKey"
                  "QueryParameters": {
                    "siteId": "RefArch"
                  "metadata": {
                    "ec_brand": "%[brand]",
                    "ec_description": "%[longDescription]",
                    "ec_shortdesc": "%[shortDescription]",
                    "ec_category_code": "%[primaryCategoryId]"
              "SubItems": [
                  "ItemPath": "variationAttributes",
                  "ItemType": "variations",
                  "image": "%[]",
                  "Uri": "https://%[coveo_parent.raw.productId]/%[id]/%[name]",
                  "ClickableUri": "https://%[coveo_parent.raw.productName]/%[id]",
                  "Title": "%[coveo_parent.raw.productName] %[id]",
                  "ModifiedDate": "%[modified_time]",
                  "Body": "%[coveo_parent.raw.productName] %[coveo_parent.raw.price] %[coveo_parent.raw.currency] %[name]"
    1 Use your short code.
    2 Specify the SLAS token from the previous step.
    3 Use your organizationId.
    4 The maximum number of products to retrieve. This is a limit set by the Salesforce Shoppers APIs.
    5 Substitute your siteId.
    6 Use your Business Manager URL and siteId in this and the next fields.
  5. Click Add source.

  6. In the list of sources, select the source you just created.

  7. Click More above the source list, and then select Edit JSON.

  8. In the parameters section, add the following:

    "UseStreamApi": {
      "value": "true"
    The JSON configuration of a REST API source with a new parameter added
  9. Click Save and rebuild source.

On the Sources (platform-ca | platform-eu | platform-au) page, you can review the progress of your source addition or modification.

Once the source is built or rebuilt, you can review its content in the Content Browser.

Add the Coveo search to your storefront

Depending on what type of architecture you use, you can add the Coveo search to your storefront by following one of the following articles: