Personalized Promotions, Shipping, and Payment Methods
Use the Shopper Context API with other B2C Commerce APIs, such as Basket, Shipping, Payment, and Product, to set up personalized and customized promotions.
Consider a scenario where you want to personalize the products page based on a shopper’s device type by displaying certain products for shoppers whose device type is mobile.
- Follow the instructions in Set and Retrieve Shopper Context.
- The response of GET products has a new property, “Product Promotion”, which lists all the promotions associated with the product and matching the shopper context criteria, for example: the response might have a discounted price based on the shopper context.
- The merchant can set the effective date in Shopper Context to trigger special price books.
- The merchant can have a dynamic session-based customer group (for example, deviceType = mobile), which can trigger a promotion, such as a 10% discount.
Consider a scenario where you want to personalize your products page based on a shopper’s device type, for example: for shoppers using a mobile device, you can create a promotion that provides 10% off with free shipping and the option to pay using Google pay:
- Follow the instructions in Set and Retrieve Shopper Context.
- Create Session-based Customer Groups:
- The Shopper Context API works with session-based customer groups.
- Create a session-based customer group and make sure the attribute used in the customer group matches the shopper context qualifier.
The custom attribute set in the dynamic customer group in Business Manager and the custom qualifier set in the API must match. As a best practice, use only those qualifiers that exist in dynamic session-based customer groups and assignments. In this example, deviceType
is the attribute used in customer group and shopper context. This Shopper Context data is then used to retrieve customer groups to which a particular shopper belongs, and activates any experiences that are mapped to a particular customer group.
- Set Shopper Context Parameters
To set the context, use PUT
https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-context/v1/organizations/{organizationId}/shopper-context/{usid}
Shopper Context | B2C Commerce API | Salesforce Developers
Shopper Login (SLAS) | B2C Commerce API | Salesforce Developers