---
schema_version: "1"
id: 9ff1389ede1e4516928250f902d29df9f3b46530dd2627c3a440ed9657968604
title: CommerceBuyGrp Namespace
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_namespace_CommerceBuyGrp.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_CommerceBuyGrp.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 322ed4f1e277ada654c4c83e3e88fda59f40b6c96da81b0c48384944f2b714ef
description: The CommerceBuyGrp namespace provides classes and methods for retrieving information about the buyer groups associated with a user.
---
# CommerceBuyGrp Namespace

The CommerceBuyGrp namespace provides classes and methods for retrieving information about the buyer groups associated with a user.

The following are the classes in the CommerceBuyGrp namespace.

- **[BuyerGroupEvaluationService Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceBuyGrp_BuyerGroupEvaluationService.htm#apex_class_CommerceBuyGrp_BuyerGroupEvaluationService)**  
    The BuyerGroupEvaluationService class allows you define and execute custom business logic for dynamically assigning users to buyer groups. Unlike out-of-the-box configurations limited to account, market, or data segment-based buyer groups, this service supports extensibility and empowers you to implement tailored buyer group evaluation strategies. It supports both guest and logged-in user scenarios, enabling highly customizable and context-specific buyer group determination.
- **[BuyerGroupRequest Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceBuyGrp_BuyerGroupRequest.htm#apex_class_CommerceBuyGrp_BuyerGroupRequest)**  
    Contains methods to retrieve account and store details used to identify the buyer groups associated with a user.
- **[BuyerGroupResponse Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_CommerceBuyGrp_BuyerGroupResponse.htm#apex_class_CommerceBuyGrp_BuyerGroupResponse)**  
    Contains constructors and methods to retrieve the buyer groups associated with a user.

#### See Also

- [_Salesforce B2B Commerce and D2C Commerce_: Assign Users to Buyer Groups](https://help.salesforce.com/s/articleView?id=commerce.comm_buyer_group_extension.htm&language=en_US "Salesforce B2B Commerce and D2C Commerce: Assign Users to Buyer
    Groups - HTML (New Window)")
- [_B2B Commerce and D2C Commerce Developer Guide_: Available Domain Extensions](https://developer.salesforce.com/docs/commerce/salesforce-commerce/guide/available-extensions.html "B2B Commerce and D2C Commerce Developer Guide: Available Domain
    Extensions - HTML (New Window)")