# Mutations / Customer Groups

# Customer Groups

**Mutation**
## createCustomerGroup — Returns [CustomerGroup](/documentation/Objects/Customers#CustomerGroup)

**Scopes required:** create_customer_groups

| Arguments | Type | Description |
| --- | --- | --- |
| name | *String!* | The name of the customer group |
| loyaltyEnabled | *Boolean* | Whether loyalty is enabled or not |
| disablePromotions | *Boolean* | Whether promotions are disabled for this customer group |
| priceList | [ID](/documentation/Types/UUID#UUID) | The price list that this customer group uses |
| allowAccountSales | *Boolean* | Whether account sales are allowed for this customer group |
| accountLimit | *Float* | The total amount that this customer can have unpaid on account at any time |
| autoPrintReceipt | *Boolean* | Whether this customer group should automatically print receipts |
| autoPrintPaymentReceipt | *Boolean* | Whether this customer group should automatically print account payment receipts |
| autoPrintParkedReceipt | *Boolean* | Whether the customer group should automatically print parked sales receipts |
| autoEmailReceipt | *Boolean* | Whether email receipts should be automatically sent |
| defaultReceipt | [ID](/documentation/Types/UUID#UUID) | The default receipt to use for sales |
| emailReceipt | [ID](/documentation/Types/UUID#UUID) | The default email receipt to use for sales |
| requireOrderReference | *Boolean* | Whether the customer group requires a reference number to complete a sale |
| paymentReceipt | [ID](/documentation/Types/UUID#UUID) | The receipt to use when making payments |
| creditTerms | [[TimePeriod]](/documentation/Types/Time-Period#TimePeriod) | The credit term periods for this customer group |

**Example Mutation**

```graphql
mutation CreateCustomerGroup($name: String!) {
    createCustomerGroup(name: $name) {
        id,
        name,
        loyaltyEnabled,
        loyaltyRate,
        disablePromotions
    }
}

# Example variables
{
    "name": "<NAME>"
}
```

**Mutation**
## deleteCustomerGroup — Returns [CustomerGroup](/documentation/Objects/Customers#CustomerGroup)

**Scopes required:** delete_customer_groups

Delete an existing customer group, this will not delete any customers

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the customer display to delete |

**Example Mutation**

```graphql
mutation DeleteCustomerGroup($id: ID!) {
    deleteCustomerGroup(id: $id) {
        id,
        name,
        loyaltyEnabled,
        loyaltyRate,
        disablePromotions
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Mutation**
## updateCustomerGroup — Returns [CustomerGroup](/documentation/Objects/Customers#CustomerGroup)

**Scopes required:** adjust_customer_group

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the customer group to update |
| name | *String!* | The name of the customer group |
| loyaltyEnabled | *Boolean* | Whether loyalty is enabled or not |
| disablePromotions | *Boolean* | Whether promotions are disabled for this customer group |
| priceList | [ID](/documentation/Types/UUID#UUID) | The price list that this customer group uses |
| allowAccountSales | *Boolean* | Whether account sales are allowed for this customer group |
| accountLimit | *Float* | The total amount that this customer can have unpaid on account at any time |
| autoPrintReceipt | *Boolean* | Whether this customer group should automatically print receipts |
| autoPrintPaymentReceipt | *Boolean* | Whether this customer group should automatically print account payment receipts |
| autoPrintParkedReceipt | *Boolean* | Whether the customer group should automatically print parked sales receipts |
| autoEmailReceipt | *Boolean* | Whether email receipts should be automatically sent |
| defaultReceipt | [ID](/documentation/Types/UUID#UUID) | The default receipt to use for sales |
| emailReceipt | [ID](/documentation/Types/UUID#UUID) | The default email receipt to use for sales |
| statementTemplate | [ID](/documentation/Types/UUID#UUID) | The default statement template to use when generating account statements |
| paymentReceipt | [ID](/documentation/Types/UUID#UUID) | The receipt to use when making payments |
| requireOrderReference | *Boolean* | Whether the customer requires a reference number to complete a sale |
| creditTerms | [[TimePeriod]](/documentation/Types/Time-Period#TimePeriod) | The credit term periods for this customer group |

**Example Mutation**

```graphql
mutation UpdateCustomerGroup($id: ID!, $name: String!) {
    updateCustomerGroup(id: $id, name: $name) {
        id,
        name,
        loyaltyEnabled,
        loyaltyRate,
        disablePromotions
    }
}

# Example variables
{
    "id": "<ID>",
    "name": "<NAME>"
}
```