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 1000 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 - DateTime
  • createdBy - CreatedBy BETA
    Present on resources created after 2019-02-01 except for events not tracked.
  • lastModifiedAt - DateTime
  • lastModifiedBy - 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 for name in CustomerGroup in the project. If not, a DuplicateField 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 the results array of CustomerGroup
Query Parameters:

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.

Set Custom Field

  • action - String - "setCustomField"
  • name - String - Required
  • value - Value - Optional
    If value is absent or null, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. If value is provided, set the value of the field defined by the name.

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