---
schema_version: "1"
id: 73ed3e6636e91dbb82ba48722b32c5c2ea1a9f5755473d21573b5589a752a424
title: Einstein Activities
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/einstein/references/generated-api-specs/einstein-activities.md
canonical_url: https://developer.salesforce.com/docs/commerce/einstein-api/references/einstein-activities
source_site: developer.salesforce.com
content_type: documentation
content_hash: 23c2f594496bcf9618b01774f287aa05e855b7f4e3d7cf90bb061e602b4cd3f7
products:
  - B2C Commerce Einstein API
  - Salesforce APIs
---
Einstein Activities

# Einstein Activities

Use the Einstein engine to track shopper activity.

**Version:** v3

## Servers

*   `https://api.cquotient.com/v3`

Protocols: HTTPS.

## /activities (Activities)

## Operations

### POST sendViewReco

`POST /activities/{siteId}/viewReco`

Display name: viewReco.

Tells the Einstein engine when a user views a set of recommendations.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `recommenderName` (_string_, required) The name of the recommender used in the recommendation request.
*   `__recoUUID` (_string_, required) The UUID that was returned in the recommendation response.
*   `products` (_array of ProductForView_, required) The product recommendations that the user viewed.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendClickReco

`POST /activities/{siteId}/clickReco`

Display name: clickReco.

Tells the Einstein engine when a user clicks a recommendation.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `recommenderName` (_string_, required) The name of the recommender used in the recommendation request.
*   `__recoUUID` (_string_, required) The UUID that was returned in the recommendation response.
*   `product` (_ProductForView_, required)
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendViewProduct

`POST /activities/{siteId}/viewProduct`

Display name: viewProduct.

Tells the Einstein engine when a user opens a product page.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `product` (_ProductForView_, required)
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendAddToCart

`POST /activities/{siteId}/addToCart`

Display name: addToCart.

Tells the Einstein engine when a user adds an item to their cart.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `products` (_array of object_, required) The products that the user has added to their cart.
    *   `id` (_string_, required) A unique identifier for the given product.
    *   `sku` (_string_, required) A unique identifier for a sellable unit of the given product, when applicable.
    *   `price` (_number_, required) The discounted or negotiated price of each individual unit of the product.
    *   `originalPrice` (_number_, required) The price of each individual unit of the product.
    *   `quantity` (_integer_, required) The total number of items in the cart for the product.
*   `source` (_SourceParam_) The page or site location where the Add to Cart button was clicked. Accepted values are `pdp`, `plp`, `recs`, `quick add` and `wishlist`.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendViewSearch

`POST /activities/{siteId}/viewSearch`

Display name: viewSearch.

Tells the Einstein engine when a user is looking at the results of their search.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `locale` (path, string) A descriptor that combines language and country codes. If using [Einstein Search Recommendations](https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_search_recommendations.htm), the locale must match a locale defined in Business Manager. The locale typically follows ISO standards, such as ISO 639 for the language and ISO 3166 for the country. The locale can also just refer to a language code as a default if there is no specific match for a country.
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `searchText` (_string_, required) The text that the user searched for.
*   `products` (_array of ProductForView_, required) The products that the user is viewing on a search results page.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.
*   `correlationId` (_CorrelationIDParam_) Identifies the search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.
*   `sortingRule` (_SortingRuleData_)
*   `itemRange` (_ItemRangeData_) Represents pagination. Use the `start` property for the rank of the first product that is displayed.
*   `locale` (_string_) A descriptor that combines language and country codes. If using [Einstein Search Recommendations](https://help.salesforce.com/s/articleView?id=cc.b2c_einstein_search_recommendations.htm), the locale must match a locale defined in Business Manager. The locale typically follows ISO standards, such as ISO 639 for the language and ISO 3166 for the country. The locale can also just refer to a language code as a default if there is no specific match for a country.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendClickSearch

`POST /activities/{siteId}/clickSearch`

Display name: clickSearch.

Tells the Einstein engine when a user clicks a search result.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `searchText` (_string_, required) The text that the user searched for.
*   `product` (_ProductForView_, required)
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.
*   `correlationId` (_CorrelationIDParam_) Identifies the search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendViewPage

`POST /activities/{siteId}/viewPage`

Display name: viewPage.

Tells the Einstein engine when a user views a page that doesn't fit another activity.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendViewCategory

`POST /activities/{siteId}/viewCategory`

Display name: viewCategory.

Tells the Einstein engine when a user is looking at a category listing page.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `category` (_CategoryParam_, required) A grouping of products within the catalog.
*   `products` (_array of ProductForView_, required) The products that the user is viewing on a category listing page.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.
*   `correlationId` (_CorrelationIDCategoryParam_) Identifies the category of a search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.
*   `sortingRule` (_SortingRuleData_)
*   `itemRange` (_ItemRangeData_) Represents pagination. Use the `start` property for the rank of the first product that is displayed.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendClickCategory

`POST /activities/{siteId}/clickCategory`

Display name: clickCategory.

Tells the Einstein engine when a user clicks a product from the category listing page and not when the user clicks a category from the navigation bar.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `ClickCategoryActivityData (extended)`.

Includes all fields of `ClickCategoryActivityData`.

*   `category` (_CategoryParam_, required) A grouping of products within the catalog.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.
*   `correlationId` (_CorrelationIDCategoryParam_) Identifies the category of a search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendBeginCheckout

`POST /activities/{siteId}/beginCheckout`

Display name: beginCheckout.

Tells the Einstein engine when a user starts a checkout process but hasn't completed it yet.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `products` (_array of ProductForCheckout_, required) The products whose purchase has been initiated.
*   `amount` (_AmountParam_, required) The total checkout amount of the purchase, including taxes and discounts.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

### POST sendCheckoutStep

`POST /activities/{siteId}/checkoutStep`

Display name: checkoutStep.

Tells the Einstein engine when a user performs one of the site's checkout steps.

#### Parameters

*   `siteId` (path, EinsteinSiteIdParam, required)
*   `x-cq-client-id` (header, ClientIdParam, required)

#### Request body

Media type: `application/json`. Schema: `object`.

*   `stepName` (_string_, required) The name of the step being performed by the user within the checkout process. For example, `Billing`, `OrderSummary`, `ShippingMethod`.
*   `stepNumber` (_string_, required) The number of the step being performed by the user within the checkout process. For example, `2`, `3`, `6`.
*   `basketId` (_string_, required) The basket ID of the user's current basket.
*   `userId` (_UserIdParam_) A unique identifier for logged-in users (hashed) that is provided by the application.
*   `cookieId` (_CookieIdParam_, required) The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**
*   `clientIp` (_ClientIpParam_) The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.
*   `clientUserAgent` (_ClientUserAgentParam_) The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.
*   `realm` (_RealmParam_) A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

#### Responses

*   **200** A successful response contains a UUID for the given user.
    
    Media type: `application/json`. Schema: `ActivityResponse`.
    
*   **400** A validation error response contains an array of invalid parameters.
    
    Media type: `application/json`. Schema: `ValidationError`.
    

## Schemas

### EinsteinSiteIdParam

The Einstein site ID. Locate this ID in the upper-right corner of the [Einstein Configurator](https://configurator.cquotient.com). The ID has the format `xxxx-<Commerce Cloud Site ID>`.

Type: `string`.

### ClientIdParam

Make sure to pass the `x-cq-client-id` header with your API Client ID from Account Manager. Locate this value in Business Manager under **Administration** > **Site Development** > **Open Commerce API Settings**. This settings page displays a JSON object containing the current OCAPI configuration. You can use any of the values in a `client_id` field, but it's better to create one specifically for Einstein API calls.

Type: `string`.

### ProductForView

*   `id` (_string_, required) A unique identifier for the given product.
*   `sku` (_string_) A unique identifier for a sellable unit of the given product, when applicable.
*   `altId` (_string_) An alternate identifier for the given product. You must specify a type in the `altIdType` field.
*   `altIdType` (_string_) The type of alternate identifier.  
    Allowed values: `vgroup`.

### UserIdParam

A unique identifier for logged-in users (hashed) that is provided by the application.

Type: `string`.

### CookieIdParam

The unique identifier of an anonymous shopper. **If you're making API requests from a traditional B2C Commerce storefront, pass the `dwanonymous_*` cookie value (See [Browser-Based Local Data Storage](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2FDataProtectionAndPrivacy%2FLocalDataStorage.html&resultof=%22%64%77%61%6e%6f%6e%79%6d%6f%75%73%22%20%22%64%77%61%6e%6f%6e%79%6d%22%20) for more information).**

Type: `string`.

### ClientIpParam

The IP address of the end user. Use this parameter if you're sending activities on the server side for a client application.

Type: `string`.

### ClientUserAgentParam

The User Agent of the end user. Use this paramenter if you're sending activities on the server side for a client application.

Type: `string`.

### RealmParam

A unique, four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein site ID. If your site changes realms, the Einstein site ID won’t use the correct realm.

Type: `string`.

### ActivityResponse

*   `uuid` (_string_, required) The unique identifier for the end user. If you don't already have identifiers associated with a user, you can use this value in subsequent requests.  
    Example: `ce035cc0-2cbb-4d9e-95ed-c67fa55d1eb8`.

### ValidationError

*   `code` (_string_, required) A short error code to classify types of errors.  
    Example: `ValidationError`.
*   `errors` (_array of object_, required) A set of invalid parameters.
    *   `location` (_string_, required) The location of the invalid parameter.  
        Example: `body`.
    *   `msg` (_string_, required) A message describing why the parameter is invalid.  
        Example: ``Must provide a `products` array.``.
    *   `param` (_string_, required) The name of the invalid parameter.  
        Example: `products`.
*   `msg` (_string_, required) A descriptive message about the error that you can use to troubleshoot.  
    Example: ``There was a problem validating the request. See `errors`.``.

### SourceParam

The page or site location where the Add to Cart button was clicked. Accepted values are `pdp`, `plp`, `recs`, `quick add` and `wishlist`.

Type: `string`.

### CorrelationIDParam

Identifies the search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.

Type: `string`.

### SortingRuleData

Array of `object`.

*   `attribute` (_string_, required)
*   `direction` (_string_, required)

_Example_

```
-
  attribute: price
  direction: ascending
```

### ItemRangeData

Represents pagination. Use the `start` property for the rank of the first product that is displayed.

*   `start` (_number_, required)

_Example_

```
start: 17
```

### CategoryParam

A grouping of products within the catalog.

*   `id` (_string_, required) A unique identifier for the given category.

### CorrelationIDCategoryParam

Identifies the category of a search request. Ensure that the ID matches in viewSearch and clickSearch. Must be unique. Generating a UUID is recommended.

Type: `string`.

### ClickCategoryActivityData

*   `category` (_object_, required)
    
    Includes all fields of `CategoryParam`.
    
*   `product` (_object_, required) The product on the category page that the user clicked.
    
    Includes all fields of `ProductForView`.
    
*   `userId` (_UserIdParam (string)_)
*   `cookieId` (_CookieIdParam (string)_)
*   `clientIp` (_ClientIpParam (string)_)
*   `clientUserAgent` (_ClientUserAgentParam (string)_)
*   `realm` (_RealmParam (string)_)
*   `correlationId` (_CorrelationIDCategoryParam (string)_)

### ProductForCheckout

*   `id` (_string_, required) A unique identifier for the given product.
*   `sku` (_string_, required) A unique identifier for a sellable unit of the given product, when applicable.
*   `price` (_number_, required) The price of each individual unit of the product.
*   `quantity` (_integer_, required) The total number of items purchased for the product.

### AmountParam

The total checkout amount of the purchase, including taxes and discounts.

Type: `number`.