API reference · Customers
Create Customer Group
https://api.sandbox.cws.digital/customer/groupDescription
Creates a customer group in your store.
The group defines which document type it applies to and which delivery and payment methods are restricted for those in it.
Request body
application/jsonRequired| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| name | string | Yes | Group name. Unique in your store. | |
| enableGroupDisplayInRegistration | boolean | Yes | Whether the group is shown in the customer registration. | |
| enableGroupDisplayInMyAccount | boolean | Yes | Whether the group is shown in the customer's account. | |
| applicationGroupDocumentType | object | Yes | Which document type the group applies to. Exactly one Fields in applicationGroupDocumentType | |
| restrictionDeliveryType | object | Yes | Delivery restriction. Exactly one Fields in restrictionDeliveryType | |
| restrictionPaymentType | object | Yes | Payment restriction. Exactly one Fields in restrictionPaymentType | |
| showToSeller | boolean | No | Whether the group is shown to the seller. | |
| externalId | string | No | Group id in your system. Unique in the store, maximum 20 characters. | |
| colorHexadecimal | string | No | Group color in hexadecimal, without | |
| groupTypeId | string | No | External id of a group type already registered in your store. Maximum 20 characters. | |
| groupTypeName | string | No | Name of a group type already registered in your store. Maximum 70 characters. | |
| anonymousCustomer | boolean | No | Marks the group as the anonymous customer group. Only one per store. |
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| all | boolean | No | ||
| pj | boolean | No | ||
| iepr | boolean | No | ||
| pf | boolean | No |
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| no_restriction | boolean | No | ||
| restrict_all_except_pickup_in_store | boolean | No | ||
| restrict_all_except_carrier | boolean | No | ||
| restrict_all_except_deliveries | boolean | No |
| Field | Type | Required | Description | Value |
|---|---|---|---|---|
| no_restriction | boolean | No | ||
| restrict_online_payment | boolean | No | ||
| restrict_offline_payment | boolean | No |
Business rules
Exactly one true key in each object
In the three objects, one and only one key can be true. None and more than one are rejected, with different messages — Pelo menos uma das opções ... deve ser definida como true. and Somente uma das opções ... deve ser definida como true.
The group type must exist beforehand
groupTypeId and groupTypeName do not create a group type: they reference one that is already registered in your store.
A value without a match is rejected with Tipo Grupo de id X e name Y não cadastrado!.
When sending both, both must point to the same type.
Responses
- 401
Missing, malformed or expired token.