---
schema_version: "1"
id: b334e3edfca2224e5425e23a225a7f02aa6a7be44e5a4caf41048bf6b2d0f8ce
title: B2B Commerce Einstein Product Recommendations API
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-b2b-reco-api-ref.md
canonical_url: https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/b2b-b2c-comm-einstein-b2b-reco-api-ref.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ea9015aa0a1e469672ad206f7e873f278259f2b651e5e9b5628447ad76910065
products:
  - B2B Commerce Developer Guide
  - Salesforce APIs
---
# B2B Commerce Einstein Product Recommendations API

Calls to the Product Recommendation API deliver Einstein recommendations. The API is accessed using a Connect API to provide data to a Lightning web component. The Connect API returns a set of products to populate the Commerce Einstein Recommb2b_b2c_comm_einstein_reco_api_refendations component.

## Commerce Einstein Webstore Recommendations Resource

The Commerce Einstein Recommendations Connect API resource (`/commerce/webstores/{webstoreId}/ai/recommendations`) returns Einstein product recommendations.

## Recommender Names and Anchors

You can add one or more Einstein Recommendations components to any page in B2B Commerce stores. When using a product recommender, such as `SimilarProducts` or `ComplementaryProducts`, specify product IDs. When using a category recommender, such as `MostViewedByCategory` or `TopSellingByCategory`, specify category IDs. All other anchors are supported on any page, but they’re intended for use on certain pages.

B2B recommenders don’t require that you specify an anchor type. The Connect API automatically determines the anchor type based on the anchor values and the recommendation use case that you specify.

| Anchor Type | Anchor Value                                                                                                                   | Fields Returned                                                                                                                                                         |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No anchor   | Any value that evaluates to false. For example: null or undefined.                                                             | <ul><li>RecentlyViewed</li><li>TopSelling</li><li>PersonalizedForShopper</li></ul>                                                                                      |
| Product ID  | A list of one or more 18-character product IDs. For example: `01t000000000000001`, `01t000000000000002`, `01t000000000000003`  | <ul><li>RecentlyViewed</li><li>SimilarProducts</li><li>ComplementaryProducts</li><li>CustomersWhoBoughtAlsoBought</li><li>Upsell (not supported at this time)</li></ul> |
| Category ID | A list of one or more 18-character category IDs. For example: `0ZG000000000000001`, `0ZG000000000000002`, `0ZG000000000000003` | <ul><li>RecentlyViewed</li><li>MostViewedByCategory</li><li>TopSellingByCategory</li></ul>                                                                              |

For example, a URL containing an anchor value for the connect API looks like this.

```nolang
/services/data/v55.0/commerce/webstores/0ZERM00000009eR/ai/recommendations?recommender=SimilarProducts&anchorValues=01tRM000000R8DnYAK,01tRM000000R8DWYA0
```

**See Also**

- [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 B2B 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_b2b_cust_ein_reco_comp.htm)
- [Commerce Einstein Webstore Recommendations](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_commerce_webstore_ai_recommendations.htm)
