# Update of customer group

Updates an existing customer group with specified settings. Returns the full list of customer groups including the updated one.

Note: To use wholesale features (registrationAllowed, wholesale, tableLayout, fullProfileRequired), the Wholesale module must be active in the e-shop.

Endpoint: PATCH /api/customers/groups/{id}
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Header parameters:

  - `Content-Type` (string, required)

## Path parameters:

  - `id` (integer, required)
    Customer group ID
    Example: 1

## Query parameters:

  - `language` (string)
    Specifies the language of updated customer group. If not provided, the default language of the e-shop will be used.
This parameter is relevant only if the "Foreign Languages" module is enabled on the current e-shop.
    Example: "cs"

## Request fields (application/json):

  - `data` (object, required)

  - `data.name` (string)
    Customer group name

  - `data.description` (string,null)
    Description of customer group

  - `data.defaultPricelistId` (integer,null)
    ID of default pricelist for this group

  - `data.emailNotification` (boolean)
    Whether e-mail will be sent on new customer registration in this group. This option can only be enabled if the Wholesale module is active or for the default group.

  - `data.authRequired` (boolean)
    Whether authorization of new customer by eshop administrator is required. This option can only be enabled if the Wholesale module is active or for the default group.

  - `data.maxDiscount` (string,null)
    Ratio of maximal discount (0.5500 -> 55% max discount)

  - `data.defaultDueDays` (integer,null)
    Default maturity for documents in days (0-365)

  - `data.registrationAllowed` (boolean)
    Whether customers can register to this group. Requires Wholesale module to be active and cannot be false for the default group.

  - `data.wholesale` (boolean)
    Whether customers and their orders in this group are marked as wholesale. Requires Wholesale module to be active.

  - `data.tableLayout` (boolean)
    Whether table layout will be shown instead to classical layout. Might not be supported by all templates. Requires Wholesale module to be active.

  - `data.fullProfileRequired` (boolean)
    Whether full profile (billing information and address) is needed for customer. Requires Wholesale module to be active.

## Response 200 fields (application/json):

  - `data` (object, required)

  - `data.customerGroups` (array, required)

  - `data.customerGroups.id` (integer, required)
    Customer group ID

  - `data.customerGroups.name` (string, required)
    Customer group name

  - `data.customerGroups.customerGroupCode` (string,null, required)
    index name of customer group used to identify group while insert/edit customer

  - `data.customerGroups.description` (string,null, required)
    description of customer group.

  - `data.customerGroups.defaultPricelistId` (integer,null, required)
    ID of default pricelist for this group

  - `data.customerGroups.maxDiscount` (any, required)
    Ratio of maximal discount (0.5500 -> 55% max discount). Maximum 0.9999. Null when no maximal discount is set.

  - `data.customerGroups.priority` (integer,null, required)
    Priority of customer group

  - `data.customerGroups.emailNotification` (boolean, required)
    whether e-mail will be sent on new customer registration in this group.

  - `data.customerGroups.authRequired` (boolean, required)
    whether authorization of new customer by eshop administrator is be required

  - `data.customerGroups.registrationAllowed` (boolean, required)
    whether customers can register to this group.

  - `data.customerGroups.wholesale` (boolean, required)
    whether customers and their orders in this group are marked as wholesale

  - `data.customerGroups.tableLayout` (boolean, required)
    whether table layout will be shown instead to classical layout. Might not be supported by all templates.

  - `data.customerGroups.fullProfileRequired` (boolean, required)
    whether full profile is needed for customer.

  - `data.customerGroups.defaultDueDays` (integer,null)
    Default maturity for documents in days

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

## Response 403 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

## Response 404 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

## Response 422 fields (application/json):

  - `data` (object,null)

  - `errors` (array,null)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced


