BuyerGroupEvaluationService Class
Namespace
Consideration
When implementing the BuyerGroupEvaluationService, remember these key points:
- The number of buyer groups that can be assigned to a user is determined by the limit set in your Salesforce org. See Shopper Buyer Groups and Accounts Data Limits Groups.
- Supported for B2B stores and D2C stores with custom checkout enabled. It isn't available for stores using managed checkout. See Configure Custom Checkout for a B2B or D2C Store.
- Buyer group assignments may not take effect immediately if caching is enabled.
To make sure the buyer group extensibility service functions properly and to
avoid caching-related issues, disable both the Salesforce Content Delivery
Network (CDN) and Salesforce Edge Network.
Test these changes in your sandbox org before applying them in production. Go to My Domain Settings and disable both options for enhanced domains.
See Considerations for the Salesforce CDN and Considerations for Salesforce Edge Network.
Usage
Use the BuyerGroupEvaluationService to implement custom logic for assigning users to buyer groups. By integrating your logic with this service, you can evaluate and assign buyer groups in real time based on criteria specific to your organization.
- Define Custom Logic—Create your own business rules to evaluate and assign users to appropriate Buyer Groups.
- Integration with the Service—Integrate your custom logic into the BuyerGroupEvaluationService to dynamically determine buyer group membership at runtime.
- Test and Validate—Test your implementation to ensure it behaves as expected and doesn’t introduce errors or inconsistencies in group assignments.
Example
For an example implementation of the CommerceBuyGrp.BuyerGroupEvaluationService class, see Commerce Extensibility.
BuyerGroupEvaluationService Methods
The following are methods for BuyerGroupEvaluationService.
getBuyerGroupIds(request)
Signature
public CommerceBuyGrp.BuyerGroupResponse getBuyerGroupIds(CommerceBuyGrp.BuyerGroupRequest request)
Parameters
- request
- Type: CommerceBuyGrp.BuyerGroupRequest
Return Value
Type: CommerceBuyGrp.BuyerGroupResponseCommerceBuyGrp.BuyerGroupResponse