19 March 2025
CustomersGraphQL
You can now assign a Customer to up to 500
Customer Groups; previously, you could only assign a Customer to one Customer Group. Additionally, using the Customer Search API, you can now filter for Customers by their specific Customer Group assignments. This enhancement is available in public beta.
To transition from using a single Customer Group for a Customer to using multiple Customer Groups, see our migration guide.
Changes:
- [API] Added the
customerGroupAssignments
field to the Customer and CustomerDraft types. - [API] Added the CustomerGroupAssignment and CustomerGroupAssignmentDraft types to the Customers API.
- [API] Added the Add CustomerGroupAssignment, Remove CustomerGroupAssignment, and Set CustomerGroupAssignments update actions to the Customers API.
- [API] Added the CustomerGroupAssignmentAdded, CustomerGroupAssignmentRemoved, and CustomerGroupAssignmentsSet Messages.
- [API] Added the
priceCustomerGroupAssignments
field to the ProductSearchProjectionParams type. - [API] Added
priceCustomerGroupAssignments
andcustomerGroupAssignments
as price selection parameters. - [API] Added
customerGroupAssignments.customerGroup.id
as a searchable field in Customer Search API. - [API] Added
customer.customerGroupAssignments.customerGroup.id
andcustomer.customerGroupAssignments.customerGroup.key
as field identifiers for Customer on Cart Predicates. - [GraphQL API] Added the
customerGroupAssignments
field to theCustomer
type. - [GraphQL API] Added the
customerGroupAssignments
input field to theCustomerSignUpDraft
type. - [GraphQL API] Added the
addCustomerGroupAssignment
,removeCustomerGroupAssignment
, andsetCustomerGroupAssignments
input fields to theCustomerUpdateAction
type. - [GraphQL API] Added the following types to the GraphQL schema:
CustomerGroupAssignment
,CustomerGroupAssignmentDraft
,AddCustomerGroupAssignment
,RemoveCustomerGroupAssignment
,SetCustomerGroupAssignments
,CustomerGroupAssignmentAdded
,CustomerGroupAssignmentRemoved
,CustomerGroupAssignmentsSet
. - [GraphQL API] Added the
customerGroupAssignmentIds
argument to theProductVariant.price
field.
The following changes were introduced in terms of GraphQL SDL:
extend type Customer {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
customerGroupAssignments: [CustomerGroupAssignment!]
}
extend input CustomerSignUpDraft {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
customerGroupAssignments: [CustomerGroupAssignmentDraft!]
}
extend input CustomerUpdateAction {
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
addCustomerGroupAssignment: AddCustomerGroupAssignment
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
removeCustomerGroupAssignment: RemoveCustomerGroupAssignment
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
setCustomerGroupAssignments: SetCustomerGroupAssignments
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input AddCustomerGroupAssignment {
customerGroupAssignment: CustomerGroupAssignmentDraft!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type CustomerGroupAssignment {
customerGroupRef: Reference
customerGroup: CustomerGroup
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type CustomerGroupAssignmentAdded implements MessagePayload {
customerGroupAssignment: CustomerGroupAssignment!
type: String!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input CustomerGroupAssignmentDraft {
customerGroup: ResourceIdentifierInput!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type CustomerGroupAssignmentRemoved implements MessagePayload {
customerGroupAssignment: CustomerGroupAssignment!
type: String!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type CustomerGroupAssignmentsSet implements MessagePayload {
customerGroupAssignments: [CustomerGroupAssignment!]!
type: String!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input RemoveCustomerGroupAssignment {
customerGroup: ResourceIdentifierInput!
}
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input SetCustomerGroupAssignments {
customerGroupAssignments: [CustomerGroupAssignmentDraft!]!
}