Customers

Learn how to enhance Customer Segmentation, Security, and Cart Management.

Ask about this Page
Copy for LLM
View as Markdown

After completing this page, you should be able to:

  • Describe how the new multiple Customer Group assignment feature improves customer segmentation and price resolution.

  • Explain the role of the Product Projections API in resolving the "best price" when a customer belongs to multiple groups.

  • Summarize the improvements to email verification and password reset flows, specifically regarding token validity and security.

  • Identify the platform's new behavior regarding Carts when a Customer is deleted and the associated data privacy considerations.

Multiple Customer Group assignments

Historically, a commercetools Customer object could only be assigned to a single Customer Group. This often forced integrators into complex workarounds to manage customers who qualified for multiple tiers or segmentation rules.

The new functionality shatters this limitation. A Customer can now belong to a number of Customer Groups (up to 500!).
This change introduces a new field on the Customer called customerGroupAssignments and allows for powerful segmentation where a single customer can benefit from multiple group affiliations simultaneously. For example, a customer could simultaneously belong to:
  • Tier: VIP Customers (eligible for standard group discounts).
  • Segment: Regional Promo Users (eligible for special regional pricing).
We can easily create those groups in the Merchant Center by navigating to Customers ➜ Customer Group list:
The Customer group list page in the Merchant Center
Once the Customer Groups are created, we can assign one of our Customers to both of them using the new Customer groups tab:
The Customer groups tab and the Customer Group Assignments section in the Merchant Center
Composable Commerce must now resolve the final price of a product by considering the rules of all assigned groups.
The Product Projections API is the primary way we fetch the final, viewable, and purchasable version of a product. With the introduction of multiple Customer Groups, the Product Projection API acts as the engine for resolving the final price based on the requesting customer's context.
When you query Product Projections, and the request is made on behalf of an authenticated customer, the API automatically checks all Customer Group IDs associated with that Customer. The projection then intelligently resolves the best possible price from all the available Prices that target any of the Customer Groups.
Example:

Let’s select a Product from our Product list and create two prices for our customer’s country, same currency and both Customer Groups:

The Prices tab for a Product Variant in the Product list page in the Merchant Center. Two prices of the variant are highlighted.
Once we use the Product Projections API to get the current projection of our product while providing appropriate price projection parameters for customerGroupAssignments, priceCurrency and priceCountry:
Requestbash
curl --get \
"https://api.{region}.commercetools.com/{projectKey}/product-projections/key=pink-abstract-painting?priceCurrency=EUR&priceCountry=DE&priceCustomerGroupAssignments=c241adfc-3fb8-4915-b3c1-be7eacdb786b&priceCustomerGroupAssignments=7ef1508d-5462-47c2-98a4-9deaafc5b341" \
--header "Authorization: Bearer {bearerToken}" \
| jq

We will see that the better of the two prices will be selected:

Resultbash
{
  "id": "0bc05ed4-b0bf-410a-8b0f-7849ff1393b1",
  "version": 7,
  "productType": {
    "typeId": "product-type",
    "id": "415bec3b-e1de-4bbd-8c62-e537937ec817"
  },
  "name": {
    "en-GB": "Pink Abstract Painting",
    "de-DE": "Abstrakte Rosa Malerei",
    "en-US": "Pink Abstract Painting"
  },
...
    "price": {
      "id": "e33a1f69-2c97-499e-b345-99cb4c55c074",
      "value": {
        "type": "centPrecision",
        "currencyCode": "EUR",
        "centAmount": 4500,
        "fractionDigits": 2
      },
      "country": "DE",
      "customerGroup": {
        "typeId": "customer-group",
        "id": "7ef1508d-5462-47c2-98a4-9deaafc5b341"
      }
    },
...
}
Multiple Customer Group Assignments fundamentally improves B2B and B2C pricing flexibility. Using the customerGroupAssignments field and intelligent Product Projections API price resolution, Functional Architects can simplify segmentation, eliminate client-side workarounds, and guarantee customers receive the best qualified price. This enhancement is crucial for scalable, personalized commerce and efficient price management.

Customer Cart preservation

Previously, when a Customer account was deleted, any associated B2C Carts were automatically deleted as well, while B2B Carts (owned by a Business Unit) were preserved.

We have now changed this behavior so that all Carts are preserved when a Customer is deleted. This enables merchants to finalize pending Orders and Payments, even if the Customer is deleted before the transaction is complete.

Test your knowledge