---
schema_version: "1"
id: d364881a96c53c5ad873e20a4e74c4068d23c087ac73a83f40d235d6b5c24254
title: Untitled
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/salesforce-commerce/guides/d2c-commerce/b2b-b2c-comm-einstein-b2c-reco-api-ref.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-b2c-comm-einstein-b2c-reco-api-ref.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8acbf1ed4b8b68159e70bac62601fb37fed3428f3cc369e89b5140615010392b
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
<!--# D2C Commerce Einstein Product Recommendations API

Calls to the Product Recommendation API deliver Einstein recommendations. The API is accessed using a wire adapter to provide data to a Lightning web component. In this case, the Product Recommendation API returns a set of products to populate the Einstein Recommendations component.-->

## ProductRecommendationsAdapter Wire Adapter

The ProductRecommendationsAdapter returns Einstein product recommendations. Implement this wire adapter by importing it from the `einsteinAPI` module within the commerce namespace (`commerce/einsteinAPI`) and then declaring its required parameters with the `@wire` decorator.

Parameters

- Recommender Name—The name of the recommender. This parameter determines what kind of product results you see. It must be one of the recommender names listed in the Recommender Names and Anchors table.
- Anchor Type—The anchor type is either PRODUCT, CATEGORY, or NO_CONTEXT. A product recommendation with an anchor type PRODUCT bases its results on the product IDs that you pass.
- Anchor Value—If the anchor type is PRODUCT, the value is a list of 18-character product IDs. If the anchor type is CATEGORY, the value is a list of 18-character category IDs. If the anchor type is NO_CONTEXT, there’s no anchor value; it can be null or undefined.

Result

- products—A list of product details.
- recoUUID—A string representing the unique ID for the recommendation response. Use this value when you trigger the viewReco and clickReco activities.

Constants

- ANCHOR_TYPE.PRODUCT
- ANCHOR_TYPE.CATEGORY
- ANCHOR_TYPE.NO_CONTEXT

## Recommender Names and Anchors

Each recommender name requires a specific anchor type and anchor value. For example, if you use the recommender name “similar-products,” the anchor type must be PRODUCT, and the anchor value must be a list of product IDs. This table shows the anchor type and value associated with each recommender name.

| Anchor Type | Anchor Value                                                                                                                        | Recommender Names                                                                                                                                 |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| NO_CONTEXT  | Any value that evaluates to false. For example: null or undefined.                                                                  | <ul><li>personalized-for-shopper</li><li>recently-viewed</li><li>top-selling</li></ul>                                                            |
| PRODUCT     | A list of one or more 18-character product IDs. For example: `['01t000000000000001', '01t000000000000002', '01t000000000000003']`.  | <ul><li>complementary-products</li><li>customers-who-bought-also-bought</li><li>recently-viewed</li><li>similar-products</li><li>upsell</li></ul> |
| CATEGORY    | A list of one or more 18-character category IDs. For example: `['0ZG000000000000001', '0ZG000000000000002', '0ZG000000000000003']`. | <ul><li>most-viewed-by-category</li><li>recently-viewed</li><li>top-selling-by-category</li></ul>                                                 |

**See Also**

- [Einstein Recommendations Component (LWR) for B2C Stores](https://help.salesforce.com/s/articleView?id=commerce.comm_einstein_component.htm)
- [Commerce Einstein APIs](https://developer.salesforce.com/docs/atlas.en-us.b2b_b2c_comm_dev.meta/b2b_b2c_comm_dev/b2b_b2c_comm_einstein_apis.htm)
- [Prepare Commerce Einstein to Use Custom Components](https://developer.salesforce.com/docs/atlas.en-us.b2b_b2c_comm_dev.meta/b2b_b2c_comm_dev/b2b_b2c_comm_prepare_einstein_custom_comps.htm)
- [Create a Custom Recommendations Component for B2C Stores Using Commerce Einstein APIs](https://developer.salesforce.com/docs/atlas.en-us.b2b_b2c_comm_dev.meta/b2b_b2c_comm_dev/b2b_b2c_comm_create_b2c_cust_ein_reco_comp.htm)
