Shopper Products

GET Returns product details for multiple products.

GET /organizations/{organizationId}/products

Operation ID: getProducts. Security: ShopperToken (sfcc.shopper-products, sfcc.shopper-standard); ShopperClientContextToken (sfcc.shopper-products, sfcc.shopper-standard).

Allows access to multiple product details with a single request. Only products that are online and assigned to a site catalog are returned. The maximum number of product IDs that you can request is 24. In addition to product details, the availability, images, price, bundled_products, set_products, recommendations, product options, variations, shipping_methods, and promotions for the products are included, as applicable.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • ids (query, array of object, required, style: form, explode: false) The IDs of the requested products (comma-separated, max 24 IDs).
    Maximum items: 100.

    Example

    apple-ipod-shuffle,apple-ipod-nano

    Example

    [
      "apple-ipod-shuffle",
      "apple-ipod-nano"
    ]
  • inventoryIds (query, array of object, style: form, explode: false) The optional inventory list IDs, for which the availability should be shown (comma-separated, max 5 inventoryListIDs).
    Maximum items: 5.

    Example

    Site1InventoryList,Site2InventoryList,Site3InventoryList,Site4InventoryList,Site5InventoryList

    Example

    [
      "Site1InventoryList",
      "Site2InventoryList",
      "Site3InventoryList",
      "Site4InventoryList",
      "Site5InventoryList"
    ]
  • expand (query, array of string, style: form, explode: false) All expand parameters except page_meta_tags and slug are used for the request when no expand parameter is provided. The value "none" may be used to turn off all expand options. The page_meta_tags expand value is optional and available starting from B2C Commerce version 25.2. The availability expand is deprecated. Use the Shopper Availability API instead for better caching performance. The primary_category expand returns the full breadcrumb path (root to leaf) for each product's primary category. The slug expand populates the slug field on the product. Available starting from B2C Commerce version 26.8.
    Items: Allowed values: none, availability, bundled_products, links, promotions, options, images, prices, variations, set_products, recommendations, shipping_methods, page_meta_tags, primary_category, slug. Example: promotions.

    Example

    prices,promotions

    Example

    [
      "prices",
      "promotions"
    ]
  • allImages (query, boolean) The flag that indicates whether to retrieve the whole image model for the requested product.
    Example: true.
  • imgTypes (query, string) Filters product images by viewType with optional count limits per type. This parameter requires the images expand parameter. When used, the response includes the imageGroups property filtered by the specified image types. The format is a comma-separated list of image types with optional counts: :,:. If the count is omitted, all images of that type are returned. If specified, the count limits the number of images returned for that type. For example, imgTypes=large:2,small:1 returns up to 2 large images and 1 small image per product in the imageGroups. If imgTypes is used without expand=images, it is ignored and imageGroups aren't included in the response.
    Maximum length: 50. Example: large:3,small:1.

    Example

    large:3,small:1
  • perPricebook (query, boolean) The flag that indicates whether to retrieve the per PriceBook prices and tiered prices (if available) for requested Products. Available end of June, 2021.
    Example: true.
  • siteId (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

    Example: SiteId

    RefArch
  • select (query, Select)

    Example: select

    (**)
  • locale (query, LocaleCode) A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter Accept-Language following RFC 2616 & RFC 1766. This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

    Example: LanguageCountry

    en-US

    Example: CountryCode

    US
  • currency (query, CurrencyCode) A three letter uppercase currency code conforming to the ISO 4217 standard, or the string N/A indicating that a currency is not applicable.

    Example: CurrencyCode

    USD
  • sfdc_usid (header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.
    Example: 550e8400-e29b-41d4-a716-446655440000.
  • sfdc_dw_dnt (header, string) Do Not Track header for privacy preferences. Used with endpoints secured with ShopperClientContextToken. If this header is not passed with endpoints secured with ShopperClientContextToken default value of 0 will be used.
    Allowed values: 0, 1. Example: 1.
  • personalized (query, string)

    Controls whether personalization is applied to the response. Set to none to opt out of personalized response handling so the response is safe to cache at the CDN layer.

    When set to none, the server skips applying personalization to the response.

    Setting personalized=none is necessary but not sufficient for CDN caching: a response is only cached when the endpoint is also cacheable in the server-side web-tier cache, subject to its TTLs and invalidation. A call that is uncacheable in the web tier is not cached at the CDN either. See CDN caching.


    Allowed values: none. Example: none.
  • sfdc_shopper_context (header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.

Responses

  • 200 Success.

    Media type: application/json. Schema: ProductResult.

  • 400 Bad Request

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: GetProductsBadRequestResponseExample

    {
      "title": "Bad Request",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/validation",
      "detail": "Maximum number of products you can request in one call is 25."
    }

    Example: MalformedSelectorResponseExample

    {
      "title": "Malformed Selector",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/malformed-selector",
      "detail": "The property selector '(data.(name, imageGroups.(**))' is malformed.",
      "selector": "(data.(name, imageGroups.(**))"
    }
  • 401 Your access token is invalid or expired and can’t be used to identify a user.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: UnauthorizedExample

    {
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
      "title": "Unauthorized",
      "detail": "Unauthorized request"
    }