Skip to main content
PUT
Save Shop Customer Groups

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

x-tenant-id
string<uuid>
required

The tenant ID for the target ERP instance.

Path Parameters

salesChannelId
string
required

Sales channel id of the Wawi-managed shop whose customer groups are replaced. This is a tenant-local, composite identifier and not a UUID (ADR-69) - it is opaque to the caller and must be taken verbatim from a sales channel listing; the internal shop key (kShop) is never accepted here.

Body

application/json

Request model for SaveShopCustomerGroups command endpoint. Route parameters bind from the route, query parameters from the query string, everything else from the body.

customerGroups
object[]
required

The complete desired set of customer groups for the shop. Any customer group currently assigned but not contained in this list is unassigned. Must contain at least one entry, exactly one of which is marked as the default.

replacements
object[]

For every removed customer group that still has assigned customers, names the customer group taking over those customers. Optional and empty by default - only required when a removal actually needs one.

Response

Successfully replaced the shop customer groups. Returns the resulting assignments.

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. - Response

customerGroups
object[]
required

The persisted customer group assignments, in the order submitted.