# Sylius\CustomerGroupApi

Resource &#39;CustomerGroup&#39; operations.

All URIs are relative to http://localhost, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminCustomerGroupDelete()**](CustomerGroupApi.md#syliusApiAdminCustomerGroupDelete) | **DELETE** /api/v2/admin/customer-groups/{code} | Removes the CustomerGroup resource. |
| [**syliusApiAdminCustomerGroupGet()**](CustomerGroupApi.md#syliusApiAdminCustomerGroupGet) | **GET** /api/v2/admin/customer-groups/{code} | Retrieves a CustomerGroup resource. |
| [**syliusApiAdminCustomerGroupGetCollection()**](CustomerGroupApi.md#syliusApiAdminCustomerGroupGetCollection) | **GET** /api/v2/admin/customer-groups | Retrieves the collection of CustomerGroup resources. |
| [**syliusApiAdminCustomerGroupPost()**](CustomerGroupApi.md#syliusApiAdminCustomerGroupPost) | **POST** /api/v2/admin/customer-groups | Creates a CustomerGroup resource. |
| [**syliusApiAdminCustomerGroupPut()**](CustomerGroupApi.md#syliusApiAdminCustomerGroupPut) | **PUT** /api/v2/admin/customer-groups/{code} | Replaces the CustomerGroup resource. |


## `syliusApiAdminCustomerGroupDelete()`

```php
syliusApiAdminCustomerGroupDelete($code, $accept_language)
```

Removes the CustomerGroup resource.

Removes the CustomerGroup resource.

### Example

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


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


$apiInstance = new Sylius\Api\CustomerGroupApi(
    // 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
);
$code = 'code_example'; // string | CustomerGroup identifier
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $apiInstance->syliusApiAdminCustomerGroupDelete($code, $accept_language);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupApi->syliusApiAdminCustomerGroupDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CustomerGroup identifier | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

void (empty response body)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/problem+json`, `application/json`

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

## `syliusApiAdminCustomerGroupGet()`

```php
syliusApiAdminCustomerGroupGet($code, $accept_language): \Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow
```

Retrieves a CustomerGroup resource.

Retrieves a CustomerGroup resource.

### Example

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


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


$apiInstance = new Sylius\Api\CustomerGroupApi(
    // 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
);
$code = 'code_example'; // string | CustomerGroup identifier
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminCustomerGroupGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupApi->syliusApiAdminCustomerGroupGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CustomerGroup identifier | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow**](../Model/CustomerGroupJsonldSyliusAdminCustomerGroupShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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

## `syliusApiAdminCustomerGroupGetCollection()`

```php
syliusApiAdminCustomerGroupGetCollection($page, $items_per_page, $code, $name, $order_code, $order_name, $accept_language): \Sylius\Model\SyliusApiAdminCustomerGroupGetCollection200Response
```

Retrieves the collection of CustomerGroup resources.

Retrieves the collection of CustomerGroup resources.

### Example

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


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


$apiInstance = new Sylius\Api\CustomerGroupApi(
    // 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
);
$page = 1; // int | The collection page number
$items_per_page = 30; // int | The number of items per page
$code = 'code_example'; // string | 
$name = 'name_example'; // string | 
$order_code = ''; // string | 
$order_name = ''; // string | 
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminCustomerGroupGetCollection($page, $items_per_page, $code, $name, $order_code, $order_name, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupApi->syliusApiAdminCustomerGroupGetCollection: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **page** | **int**| The collection page number | [optional] [default to 1] |
| **items_per_page** | **int**| The number of items per page | [optional] [default to 30] |
| **code** | **string**|  | [optional] |
| **name** | **string**|  | [optional] |
| **order_code** | **string**|  | [optional] [default to &#39;&#39;] |
| **order_name** | **string**|  | [optional] [default to &#39;&#39;] |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\SyliusApiAdminCustomerGroupGetCollection200Response**](../Model/SyliusApiAdminCustomerGroupGetCollection200Response.md)

### Authorization

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

### HTTP request headers

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

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

## `syliusApiAdminCustomerGroupPost()`

```php
syliusApiAdminCustomerGroupPost($customer_group_sylius_admin_customer_group_create, $accept_language): \Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow
```

Creates a CustomerGroup resource.

Creates a CustomerGroup resource.

### Example

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


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


$apiInstance = new Sylius\Api\CustomerGroupApi(
    // 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_sylius_admin_customer_group_create = new \Sylius\Model\CustomerGroupSyliusAdminCustomerGroupCreate(); // \Sylius\Model\CustomerGroupSyliusAdminCustomerGroupCreate | The new CustomerGroup resource
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminCustomerGroupPost($customer_group_sylius_admin_customer_group_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupApi->syliusApiAdminCustomerGroupPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_group_sylius_admin_customer_group_create** | [**\Sylius\Model\CustomerGroupSyliusAdminCustomerGroupCreate**](../Model/CustomerGroupSyliusAdminCustomerGroupCreate.md)| The new CustomerGroup resource | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow**](../Model/CustomerGroupJsonldSyliusAdminCustomerGroupShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: `application/ld+json`, `application/json`
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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

## `syliusApiAdminCustomerGroupPut()`

```php
syliusApiAdminCustomerGroupPut($code, $customer_group_sylius_admin_customer_group_update, $accept_language): \Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow
```

Replaces the CustomerGroup resource.

Replaces the CustomerGroup resource.

### Example

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


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


$apiInstance = new Sylius\Api\CustomerGroupApi(
    // 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
);
$code = 'code_example'; // string | CustomerGroup identifier
$customer_group_sylius_admin_customer_group_update = new \Sylius\Model\CustomerGroupSyliusAdminCustomerGroupUpdate(); // \Sylius\Model\CustomerGroupSyliusAdminCustomerGroupUpdate | The updated CustomerGroup resource
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminCustomerGroupPut($code, $customer_group_sylius_admin_customer_group_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomerGroupApi->syliusApiAdminCustomerGroupPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CustomerGroup identifier | |
| **customer_group_sylius_admin_customer_group_update** | [**\Sylius\Model\CustomerGroupSyliusAdminCustomerGroupUpdate**](../Model/CustomerGroupSyliusAdminCustomerGroupUpdate.md)| The updated CustomerGroup resource | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\CustomerGroupJsonldSyliusAdminCustomerGroupShow**](../Model/CustomerGroupJsonldSyliusAdminCustomerGroupShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: `application/ld+json`, `application/json`
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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