# Customer Groups

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Customer Groups in the platform.**

## Queries

### Query Customer Groups

[fetch SDL for query customerGroups](#graphql-partial-sdls).

### Get Customer Group

[fetch SDL for query customerGroup](#graphql-partial-sdls).

## Mutations

### Create Customer Group

[fetch SDL for mutation createCustomerGroup](#graphql-partial-sdls).

### Update Customer Group

[fetch SDL for mutation updateCustomerGroup](#graphql-partial-sdls).

### Delete Customer Group

[fetch SDL for mutation deleteCustomerGroup](#graphql-partial-sdls).

## Output types

### CustomerGroup

[fetch SDL for type CustomerGroup](#graphql-partial-sdls).

### CustomerGroupQueryResult

[fetch SDL for type CustomerGroupQueryResult](#graphql-partial-sdls).

## Input types

### CustomerGroupDraft

[fetch SDL for type CustomerGroupDraft](#graphql-partial-sdls).

### CustomerGroupUpdateAction

[fetch SDL for type CustomerGroupUpdateAction](#graphql-partial-sdls).

### Update actions

#### Change Name

[fetch SDL for type ChangeCustomerGroupName](#graphql-partial-sdls).

#### Set Key

[fetch SDL for type SetCustomerGroupKey](#graphql-partial-sdls).

#### Set Custom Type

[fetch SDL for type SetCustomerGroupCustomType](#graphql-partial-sdls).

#### Set Custom Field

[fetch SDL for type SetCustomerGroupCustomField](#graphql-partial-sdls).

## Related pages

- [Search documentation and API specs](/search.md)