Customer Groups
A Customer can be a member of a customer group (for example reseller, gold member). Special prices can be assigned to specific products based on a customer group.
A maximum number of 1 000 customer groups can be created per project. Learn more about this limit.
Representations
CustomerGroup
id
- String
The unique ID of the customer group.key
- String - Optional
User-specific unique identifier for the customer group.version
- Number
The current version of the customer group.createdAt
- DateTimecreatedBy
- CreatedBy BETA
Present on resources created after 2019-02-01 except for events not tracked.lastModifiedAt
- DateTimelastModifiedBy
- LastModifiedBy BETA
Present on resources updated after 2019-02-01 except for events not tracked.name
- String
Unique within the project.custom
- CustomFields - Optional
CustomerGroup fields that can be used in query predicates: name
.
CustomerGroupDraft
key
- String - Optional
User-specific unique identifier for the customer group.groupName
- String - Required
Unique value which must be different from any value used forname
in CustomerGroup in the project. If not, aDuplicateField
error is thrown.custom
- CustomFieldsDraft - Optional
Get CustomerGroup
Get CustomerGroup by ID
Endpoint: /{projectKey}/customer-groups/{id}
Method: GET
OAuth 2.0 Scopes: view_customers:{projectKey}
or view_customer_groups:{projectKey}
Response Representation: CustomerGroup
Get CustomerGroup by Key
Gets a customer group by Key.
Endpoint: /{projectKey}/customer-groups/key={key}
Method: GET
OAuth 2.0 Scopes: view_customers:{projectKey}
or view_customer_groups:{projectKey}
Response Representation: CustomerGroup
Query CustomerGroups
Endpoint: /{projectKey}/customer-groups
Method: GET
OAuth 2.0 Scopes: view_customers:{projectKey}
or view_customer_groups:{projectKey}
Response Representation: PagedQueryResult with results
containing an array of CustomerGroup
Query Parameters:
where
- Query Predicate - Optionalsort
- Sort - Optionalexpand
- Expansion - Optionallimit
- Number - Optionaloffset
- Number - Optional
Create a CustomerGroup
Endpoint: /{projectKey}/customer-groups
Method: POST
OAuth 2.0 Scopes: manage_customers:{projectKey}
or manage_customer_groups:{projectKey}
Request Representation: CustomerGroupDraft
Response Representation: CustomerGroup
Update CustomerGroup
Update CustomerGroup by ID
Endpoint: /{projectKey}/customer-groups/{id}
Method: POST
OAuth 2.0 Scopes: manage_customers:{projectKey}
or manage_customer_groups:{projectKey}
Response Representation: CustomerGroup
Fields:
version
- Number - Required
The expected version of the customer group on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.actions
- Array of UpdateAction - Required
The list of update actions to be performed on the customer group.
Update CustomerGroup by Key
Updates a customer group by Key.
Endpoint: /{projectKey}/customer-groups/key={key}
Method: POST
OAuth 2.0 Scopes: manage_customers:{projectKey}
or manage_customer_groups:{projectKey}
Response Representation: CustomerGroup
Fields:
version
- Number - Required
The expected version of the customer group on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.actions
- Array of UpdateAction - Required
The list of update actions to be performed on the customer group.
Update Actions
Change Name
action
- String -"changeName"
name
- String - Required
User-specific unique name for the customer group.
Set Key
action
- String -"setKey"
key
- String - Optional
User-specific unique identifier for the customer group.
Set Custom Type
This action sets or removes the custom type for an existing customer group. If present, this action overwrites any existing custom type and fields.
action
- String -"setCustomType"
type
- ResourceIdentifier to a Type - Optional
If absent, the custom type and any existing CustomFields are removed.fields
- * - Optional
A valid JSON object, based on the FieldDefinitions of the Type. Sets the custom fields to this value.
Set Custom Field
action
- String -"setCustomField"
name
- String - Requiredvalue
- Value - Optional
Ifvalue
is absent ornull
, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. Ifvalue
is provided, set thevalue
of the field defined by thename
.
Delete CustomerGroup
Delete CustomerGroup by ID
Endpoint: /{projectKey}/customer-groups/{id}
Method: DELETE
OAuth 2.0 Scopes: manage_customers:{projectKey}
or manage_customer_groups:{projectKey}
Query Parameters:
version
- Number - Required
Delete CustomerGroup by Key
Deletes a customer group by Key.
Endpoint: /{projectKey}/customer-groups/key={key}
Method: DELETE
OAuth 2.0 Scopes: manage_customers:{projectKey}
or manage_customer_groups:{projectKey}
Query Parameters:
version
- Number - Required