# Creation of customer group

Creates a new customer group with specified settings. The customer group name must be unique. Returns the full list of customer groups including the newly created one.

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

Endpoint: POST /api/customers/groups
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, required)

  - `data.name` (string, required)
    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. Can only be enabled when wholesale module is active.

  - `data.authRequired` (boolean)
    Whether authorization of new customer by eshop administrator is required. Can only be enabled when wholesale module is active.

  - `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.

  - `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 201 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 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


