# Vend\CustomerGroupsApi



All URIs are relative to https://example.retail.lightspeed.app/api/2026-07, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**addCustomersToCustomerGroup()**](CustomerGroupsApi.md#addCustomersToCustomerGroup) | **POST** /customer_groups/{customer_group_id}/customers | Add customers to customer group |
| [**createCustomerGroup()**](CustomerGroupsApi.md#createCustomerGroup) | **POST** /customer_groups | Create new customer group |
| [**deleteCustomersFromCustomerGroup()**](CustomerGroupsApi.md#deleteCustomersFromCustomerGroup) | **DELETE** /customer_groups/{customer_group_id}/customers | Delete customers from customer group |
| [**getCustomerGroupById()**](CustomerGroupsApi.md#getCustomerGroupById) | **GET** /customer_groups/{customer_group_id} | Get single customer group |
| [**getCustomerGroupCustomers()**](CustomerGroupsApi.md#getCustomerGroupCustomers) | **GET** /customer_groups/{customer_group_id}/customers | Get customers for customer group |
| [**listCustomerGroups()**](CustomerGroupsApi.md#listCustomerGroups) | **GET** /customer_groups | List customer groups |
| [**updateCustomerGroup()**](CustomerGroupsApi.md#updateCustomerGroup) | **PUT** /customer_groups/{customer_group_id} | Update the given customer group |


## `addCustomersToCustomerGroup()`

```php
addCustomersToCustomerGroup($customer_group_id, $add_customers_to_customer_group_request): bool
```

Add customers to customer group

Associates one or more customers with the given customer group  🔒 Requires: `customers:write` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group_id = 'customer_group_id_example'; // string | The customer group id
$add_customers_to_customer_group_request = new \Vend\Model\AddCustomersToCustomerGroupRequest(); // \Vend\Model\AddCustomersToCustomerGroupRequest

try {
    $result = $apiInstance->addCustomersToCustomerGroup($customer_group_id, $add_customers_to_customer_group_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->addCustomersToCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_id** | **string**| The customer group id | |
| **add_customers_to_customer_group_request** | [**\Vend\Model\AddCustomersToCustomerGroupRequest**](../Model/AddCustomersToCustomerGroupRequest.md)|  | |

### Return type

**bool**

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `createCustomerGroup()`

```php
createCustomerGroup($customer_group): \Vend\Model\CustomerGroupResponse
```

Create new customer group

Create a new customer group  🔒 Requires: `customers:write` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group = new \Vend\Model\CustomerGroup(); // \Vend\Model\CustomerGroup

try {
    $result = $apiInstance->createCustomerGroup($customer_group);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->createCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group** | [**\Vend\Model\CustomerGroup**](../Model/CustomerGroup.md)|  | |

### Return type

[**\Vend\Model\CustomerGroupResponse**](../Model/CustomerGroupResponse.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `deleteCustomersFromCustomerGroup()`

```php
deleteCustomersFromCustomerGroup($customer_group_id, $add_customers_to_customer_group_request): string
```

Delete customers from customer group

Deletes the given customers from the customer group.  **Note**: Only the link is deleted, the customers are not.  🔒 Requires: `customers:write` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group_id = 'customer_group_id_example'; // string | The customer group id
$add_customers_to_customer_group_request = new \Vend\Model\AddCustomersToCustomerGroupRequest(); // \Vend\Model\AddCustomersToCustomerGroupRequest

try {
    $result = $apiInstance->deleteCustomersFromCustomerGroup($customer_group_id, $add_customers_to_customer_group_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->deleteCustomersFromCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_id** | **string**| The customer group id | |
| **add_customers_to_customer_group_request** | [**\Vend\Model\AddCustomersToCustomerGroupRequest**](../Model/AddCustomersToCustomerGroupRequest.md)|  | |

### Return type

**string**

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getCustomerGroupById()`

```php
getCustomerGroupById($customer_group_id): \Vend\Model\CustomerGroupResponse
```

Get single customer group

Return given customer group  🔒 Requires: `customers:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group_id = 'customer_group_id_example'; // string | The customer group id

try {
    $result = $apiInstance->getCustomerGroupById($customer_group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->getCustomerGroupById: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_id** | **string**| The customer group id | |

### Return type

[**\Vend\Model\CustomerGroupResponse**](../Model/CustomerGroupResponse.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getCustomerGroupCustomers()`

```php
getCustomerGroupCustomers($customer_group_id, $after, $before, $page_size): \Vend\Model\CustomerCollection
```

Get customers for customer group

Returns a list of customers for the given Customer Group  🔒 Requires: `customers:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group_id = 'customer_group_id_example'; // string | The customer group id
$after = 56; // int | The lower limit for the version numbers to be included in the response.
$before = 56; // int | The upper limit for the version numbers to be included in the response.
$page_size = 56; // int | The maximum number of items to be returned in the response.

try {
    $result = $apiInstance->getCustomerGroupCustomers($customer_group_id, $after, $before, $page_size);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->getCustomerGroupCustomers: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_id** | **string**| The customer group id | |
| **after** | **int**| The lower limit for the version numbers to be included in the response. | [optional] |
| **before** | **int**| The upper limit for the version numbers to be included in the response. | [optional] |
| **page_size** | **int**| The maximum number of items to be returned in the response. | [optional] |

### Return type

[**\Vend\Model\CustomerCollection**](../Model/CustomerCollection.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `listCustomerGroups()`

```php
listCustomerGroups($after, $before, $page_size, $deleted): \Vend\Model\CustomerGroupCollection
```

List customer groups

Return a list of Customer Groups  🔒 Requires: `customers:read` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$after = 56; // int | The lower limit for the version numbers to be included in the response.
$before = 56; // int | The upper limit for the version numbers to be included in the response.
$page_size = 56; // int | The maximum number of items to be returned in the response.
$deleted = True; // bool | Indicates whether deleted items should be included in the response.

try {
    $result = $apiInstance->listCustomerGroups($after, $before, $page_size, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->listCustomerGroups: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **after** | **int**| The lower limit for the version numbers to be included in the response. | [optional] |
| **before** | **int**| The upper limit for the version numbers to be included in the response. | [optional] |
| **page_size** | **int**| The maximum number of items to be returned in the response. | [optional] |
| **deleted** | **bool**| Indicates whether deleted items should be included in the response. | [optional] |

### Return type

[**\Vend\Model\CustomerGroupCollection**](../Model/CustomerGroupCollection.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `updateCustomerGroup()`

```php
updateCustomerGroup($customer_group_id, $customer_group): \Vend\Model\CustomerGroupResponse
```

Update the given customer group

Update the given Customer Group  🔒 Requires: `customers:write` scope

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\CustomerGroupsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$customer_group_id = 'customer_group_id_example'; // string | The customer group id
$customer_group = new \Vend\Model\CustomerGroup(); // \Vend\Model\CustomerGroup

try {
    $result = $apiInstance->updateCustomerGroup($customer_group_id, $customer_group);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupsApi->updateCustomerGroup: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_id** | **string**| The customer group id | |
| **customer_group** | [**\Vend\Model\CustomerGroup**](../Model/CustomerGroup.md)|  | |

### Return type

[**\Vend\Model\CustomerGroupResponse**](../Model/CustomerGroupResponse.md)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
