---
title: Customer Groups
slug: indexing-apis/customer-groups
docTags: 
createdAt: 2023-10-12T15:16:41.783Z
---

If you support various customer groups for your e-commerce website and want to maintain different prices for them, you can do it using the "groups" attribute. Following is an example where group prices are added for “grp\_1” and “grp\_2”. To understand how to use them at Storefront API, please refer\:: [https://docs.klevu.com/apis/smart-search-examples#GI08Z](https://docs.klevu.com/apis/smart-search-examples#GI08Z)

## Group name Validations:

- It may consist of alphanumeric characters (letters and numbers) and underscores (`_`).
- Consecutive underscores (`__`) are not allowed.
- The group name must not be solely composed of underscores (`_`).

here are examples group names can be Sales\_Team, Marketing123, customer\_group

Example:

:::BlockQuote
\[
&#x20; \{
&#x20;   "id": "1",
&#x20;   "type": "KLEVU\_PRODUCT",
&#x20;   "attributes": \{
&#x20;     "name": \{ "default": "Product 1" }
&#x20;     }
&#x20;   "groups": \{
&#x20;           "grp\_1": \{
&#x20;               "attributes": \{
&#x20;                   "price": \{
&#x20;                       "GBP": \{
&#x20;                           "salePrice": 10.0,
&#x20;                           "defaultPrice": 11.0
&#x20;                       }
&#x20;                   }
&#x20;               }
&#x20;           },
&#x20;           "grp\_2": \{
&#x20;               "attributes": \{
&#x20;                   "price": \{
&#x20;                       "GBP": \{
&#x20;                           "salePrice": 20.0,
&#x20;                           "defaultPrice": 21.0
&#x20;                       }
&#x20;                   }
&#x20;               }
&#x20;           }
&#x20;     }
&#x20; }
]
:::

