mutation SaveShopCustomerGroups($request: SaveShopCustomerGroupsCommandRequestInput!) {
SaveShopCustomerGroups(request: $request) {
customerGroups {
customerGroupId
isAssigned
isDefault
}
resyncFailed
resyncError
}
}{
"request": {
"salesChannelId": "string",
"customerGroups": [
{
"customerGroupId": "id",
"isDefault": true
}
]
}
}{
"data": {
"SaveShopCustomerGroups": {
"customerGroups": [
{
"customerGroupId": "id",
"isAssigned": true,
"isDefault": true
}
],
"resyncFailed": true,
"resyncError": "string"
}
}
}SaveShopCustomerGroups
Declaratively replaces the complete set of tenant-wide customer groups assigned to a shop. The request describes the full desired state - every customer group contained in it is assigned and every customer group not contained in it is unassigned. Exactly one assignment must be marked as the default customer group, and the list must not be empty. When an assigned customer group is removed and still has customers assigned to it, the request must name a replacement customer group for it via Replacements - all affected groups are reported together in a single batched error rather than one at a time. Note on the response shape: unlike a command that returns only the minimal necessary data, this one echoes the complete resulting assignment list, matching the existing sales channel precedent (see SaveShopCurrencies) and the declarative-replace example in ADR-57. Concurrency: this write is last-writer-wins, like SaveShopCurrencies - it takes no If-Match header and no row version, so two concurrent calls for the same shop overwrite each other without a conflict being reported.
SaveShopCustomerGroups(request: SaveShopCustomerGroupsCommandRequestInput!): SaveShopCustomerGroupsCommandResponse!Arguments
The persisted customer group assignments, in the order submitted.
Whether the outbound customer resync push to the shop failed after the customer group assignments were already persisted. The assignments are unaffected either way - this only reports the live push outcome, it is not retried automatically.
Generic, client-facing description of why ResyncFailed is true. Empty when ResyncFailed is false.
mutation SaveShopCustomerGroups($request: SaveShopCustomerGroupsCommandRequestInput!) {
SaveShopCustomerGroups(request: $request) {
customerGroups {
customerGroupId
isAssigned
isDefault
}
resyncFailed
resyncError
}
}{
"request": {
"salesChannelId": "string",
"customerGroups": [
{
"customerGroupId": "id",
"isDefault": true
}
]
}
}{
"data": {
"SaveShopCustomerGroups": {
"customerGroups": [
{
"customerGroupId": "id",
"isAssigned": true,
"isDefault": true
}
],
"resyncFailed": true,
"resyncError": "string"
}
}
}Was this page helpful?