Configure Customer Group Pricing
Why customer group pricing matters
Section titled “Why customer group pricing matters”Not every customer pays the same price. Wholesale buyers expect volume discounts. Partner organizations negotiate custom rates. VIP members earn loyalty pricing. Commerce supports these scenarios through customer groups and segmented price lists, so you can maintain a single catalog while serving different price points to different audiences.
This guide covers creating customer groups, assigning group-specific prices, and configuring quantity-based tier pricing.
What you will do
Section titled “What you will do”- Create customer groups for different buyer segments
- Assign group-specific prices to variants
- Configure quantity-based tier pricing
- Verify price resolution for grouped customers
Create customer groups
Section titled “Create customer groups”Customer groups define segments of your buyer base. Each group can have its own price list, promotions, and catalog visibility rules.
In the Commerce UI:
- Navigate to Commerce > Administration > Customer Groups
- Click Add Group
- Enter a group name (e.g., “Wholesale”, “Partner”, “VIP”)
- Save the group
using Mediachase.Commerce.Customers;
public class CustomerGroupService
{
public void CreateGroup(string groupName)
{
var group = new CustomerGroup
{
Name = groupName
};
group.SaveChanges();
}
public void AssignCustomerToGroup(
Guid contactId, string groupName)
{
var contact = CustomerContext.Current
.GetContactById(contactId);
if (contact != null)
{
var groups = contact.CustomerGroup != null
? new List<string> { contact.CustomerGroup }
: new List<string>();
if (!groups.Contains(groupName))
{
contact.CustomerGroup = groupName;
contact.SaveChanges();
}
}
}
} Assign group-specific prices
Section titled “Assign group-specific prices”Each variant can have multiple price entries. The price resolver selects the best match based on the customer’s group, the market, currency, and quantity.
using Mediachase.Commerce;
using Mediachase.Commerce.Pricing;
public class GroupPricingService
{
private readonly IPriceDetailService _priceService;
public GroupPricingService(
IPriceDetailService priceService)
{
_priceService = priceService;
}
public void SetGroupPrices(string variantCode)
{
var prices = new List<IPriceDetailValue>
{
// Default price for all customers
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing =
CustomerPricing.AllCustomers,
MinQuantity = 0,
UnitPrice = new Money(99.99m, Currency.USD),
ValidFrom = DateTime.UtcNow,
ValidUntil = null
},
// Wholesale group price
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing = new CustomerPricing(
CustomerPricing.PriceType.PriceGroup,
"Wholesale"),
MinQuantity = 0,
UnitPrice = new Money(69.99m, Currency.USD),
ValidFrom = DateTime.UtcNow,
ValidUntil = null
},
// VIP group price
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing = new CustomerPricing(
CustomerPricing.PriceType.PriceGroup,
"VIP"),
MinQuantity = 0,
UnitPrice = new Money(84.99m, Currency.USD),
ValidFrom = DateTime.UtcNow,
ValidUntil = null
}
};
_priceService.Save(prices);
}
} Configure tier pricing
Section titled “Configure tier pricing”Tier pricing offers lower unit prices at higher quantities. Combine this with customer groups to create group-specific volume discounts.
public void SetTierPricing(string variantCode)
{
var prices = new List<IPriceDetailValue>
{
// 1-9 units: full price
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing = new CustomerPricing(
CustomerPricing.PriceType.PriceGroup,
"Wholesale"),
MinQuantity = 1,
UnitPrice = new Money(69.99m, Currency.USD),
ValidFrom = DateTime.UtcNow
},
// 10-49 units: 15% discount
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing = new CustomerPricing(
CustomerPricing.PriceType.PriceGroup,
"Wholesale"),
MinQuantity = 10,
UnitPrice = new Money(59.49m, Currency.USD),
ValidFrom = DateTime.UtcNow
},
// 50+ units: 30% discount
new PriceDetailValue
{
CatalogKey = new CatalogKey(variantCode),
MarketId = new MarketId("US"),
CustomerPricing = new CustomerPricing(
CustomerPricing.PriceType.PriceGroup,
"Wholesale"),
MinQuantity = 50,
UnitPrice = new Money(48.99m, Currency.USD),
ValidFrom = DateTime.UtcNow
}
};
_priceService.Save(prices);
} Price resolution order: Commerce selects the most specific matching price. A customer in the “Wholesale” group buying 25 units gets the MinQuantity=10 Wholesale price, not the AllCustomers price.
Common issues
Section titled “Common issues”| Issue | Cause | Fix |
|---|---|---|
| Customer sees default price instead of group price | Customer not assigned to the group | Verify CustomerGroup property on the contact |
| Tier pricing not applying | MinQuantity threshold not met | Check that cart quantity meets the minimum for the tier |
| Group price higher than default | Price entries misconfigured | Ensure group-specific prices are lower than AllCustomers prices |
| Multiple groups conflicting | Customer belongs to multiple segments | Commerce picks the lowest matching price; verify this is the intended behavior |