# Sylius\CatalogPromotionApi

Resource &#39;CatalogPromotion&#39; operations.

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminCatalogPromotionDelete()**](CatalogPromotionApi.md#syliusApiAdminCatalogPromotionDelete) | **DELETE** /api/v2/admin/catalog-promotions/{code} | Removes the CatalogPromotion resource. |
| [**syliusApiAdminCatalogPromotionGet()**](CatalogPromotionApi.md#syliusApiAdminCatalogPromotionGet) | **GET** /api/v2/admin/catalog-promotions/{code} | Retrieves a CatalogPromotion resource. |
| [**syliusApiAdminCatalogPromotionGetCollection()**](CatalogPromotionApi.md#syliusApiAdminCatalogPromotionGetCollection) | **GET** /api/v2/admin/catalog-promotions | Retrieves the collection of CatalogPromotion resources. |
| [**syliusApiAdminCatalogPromotionPost()**](CatalogPromotionApi.md#syliusApiAdminCatalogPromotionPost) | **POST** /api/v2/admin/catalog-promotions | Creates a CatalogPromotion resource. |
| [**syliusApiAdminCatalogPromotionPut()**](CatalogPromotionApi.md#syliusApiAdminCatalogPromotionPut) | **PUT** /api/v2/admin/catalog-promotions/{code} | Replaces the CatalogPromotion resource. |
| [**syliusApiShopCatalogPromotionGet()**](CatalogPromotionApi.md#syliusApiShopCatalogPromotionGet) | **GET** /api/v2/shop/catalog-promotions/{code} | Retrieves a CatalogPromotion resource. |


## `syliusApiAdminCatalogPromotionDelete()`

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

Removes the CatalogPromotion resource.

Removes the CatalogPromotion 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\CatalogPromotionApi(
    // 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 | CatalogPromotion 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->syliusApiAdminCatalogPromotionDelete($code, $accept_language);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiAdminCatalogPromotionDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CatalogPromotion 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)

## `syliusApiAdminCatalogPromotionGet()`

```php
syliusApiAdminCatalogPromotionGet($code, $accept_language): \Sylius\Model\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow
```

Retrieves a CatalogPromotion resource.

Retrieves a CatalogPromotion 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\CatalogPromotionApi(
    // 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 | CatalogPromotion 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->syliusApiAdminCatalogPromotionGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiAdminCatalogPromotionGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CatalogPromotion 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\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow**](../Model/CatalogPromotionJsonldSyliusAdminCatalogPromotionShow.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)

## `syliusApiAdminCatalogPromotionGetCollection()`

```php
syliusApiAdminCatalogPromotionGetCollection($page, $items_per_page, $name, $code, $state, $state2, $enabled, $start_date_before, $start_date_strictly_before, $start_date_after, $start_date_strictly_after, $end_date_before, $end_date_strictly_before, $end_date_after, $end_date_strictly_after, $channel, $order_code, $order_name, $order_start_date, $order_end_date, $order_priority, $accept_language): \Sylius\Model\SyliusApiAdminCatalogPromotionGetCollection200Response
```

Retrieves the collection of CatalogPromotion resources.

Retrieves the collection of CatalogPromotion 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\CatalogPromotionApi(
    // 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
$name = 'name_example'; // string | 
$code = 'code_example'; // string | 
$state = 'state_example'; // string | 
$state2 = array('state_example'); // string[] | 
$enabled = True; // bool | 
$start_date_before = 'start_date_before_example'; // string | 
$start_date_strictly_before = 'start_date_strictly_before_example'; // string | 
$start_date_after = 'start_date_after_example'; // string | 
$start_date_strictly_after = 'start_date_strictly_after_example'; // string | 
$end_date_before = 'end_date_before_example'; // string | 
$end_date_strictly_before = 'end_date_strictly_before_example'; // string | 
$end_date_after = 'end_date_after_example'; // string | 
$end_date_strictly_after = 'end_date_strictly_after_example'; // string | 
$channel = 'channel_example'; // string | 
$order_code = ''; // string | 
$order_name = ''; // string | 
$order_start_date = ''; // string | 
$order_end_date = ''; // string | 
$order_priority = ''; // 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->syliusApiAdminCatalogPromotionGetCollection($page, $items_per_page, $name, $code, $state, $state2, $enabled, $start_date_before, $start_date_strictly_before, $start_date_after, $start_date_strictly_after, $end_date_before, $end_date_strictly_before, $end_date_after, $end_date_strictly_after, $channel, $order_code, $order_name, $order_start_date, $order_end_date, $order_priority, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiAdminCatalogPromotionGetCollection: ', $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] |
| **name** | **string**|  | [optional] |
| **code** | **string**|  | [optional] |
| **state** | **string**|  | [optional] |
| **state2** | [**string[]**](../Model/string.md)|  | [optional] |
| **enabled** | **bool**|  | [optional] |
| **start_date_before** | **string**|  | [optional] |
| **start_date_strictly_before** | **string**|  | [optional] |
| **start_date_after** | **string**|  | [optional] |
| **start_date_strictly_after** | **string**|  | [optional] |
| **end_date_before** | **string**|  | [optional] |
| **end_date_strictly_before** | **string**|  | [optional] |
| **end_date_after** | **string**|  | [optional] |
| **end_date_strictly_after** | **string**|  | [optional] |
| **channel** | **string**|  | [optional] |
| **order_code** | **string**|  | [optional] [default to &#39;&#39;] |
| **order_name** | **string**|  | [optional] [default to &#39;&#39;] |
| **order_start_date** | **string**|  | [optional] [default to &#39;&#39;] |
| **order_end_date** | **string**|  | [optional] [default to &#39;&#39;] |
| **order_priority** | **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\SyliusApiAdminCatalogPromotionGetCollection200Response**](../Model/SyliusApiAdminCatalogPromotionGetCollection200Response.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)

## `syliusApiAdminCatalogPromotionPost()`

```php
syliusApiAdminCatalogPromotionPost($catalog_promotion_sylius_admin_catalog_promotion_create, $accept_language): \Sylius\Model\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow
```

Creates a CatalogPromotion resource.

Creates a CatalogPromotion 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\CatalogPromotionApi(
    // 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
);
$catalog_promotion_sylius_admin_catalog_promotion_create = new \Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionCreate(); // \Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionCreate | The new CatalogPromotion 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->syliusApiAdminCatalogPromotionPost($catalog_promotion_sylius_admin_catalog_promotion_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiAdminCatalogPromotionPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **catalog_promotion_sylius_admin_catalog_promotion_create** | [**\Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionCreate**](../Model/CatalogPromotionSyliusAdminCatalogPromotionCreate.md)| The new CatalogPromotion 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\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow**](../Model/CatalogPromotionJsonldSyliusAdminCatalogPromotionShow.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)

## `syliusApiAdminCatalogPromotionPut()`

```php
syliusApiAdminCatalogPromotionPut($code, $catalog_promotion_sylius_admin_catalog_promotion_update, $accept_language): \Sylius\Model\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow
```

Replaces the CatalogPromotion resource.

Replaces the CatalogPromotion 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\CatalogPromotionApi(
    // 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 | CatalogPromotion identifier
$catalog_promotion_sylius_admin_catalog_promotion_update = new \Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionUpdate(); // \Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionUpdate | The updated CatalogPromotion 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->syliusApiAdminCatalogPromotionPut($code, $catalog_promotion_sylius_admin_catalog_promotion_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiAdminCatalogPromotionPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CatalogPromotion identifier | |
| **catalog_promotion_sylius_admin_catalog_promotion_update** | [**\Sylius\Model\CatalogPromotionSyliusAdminCatalogPromotionUpdate**](../Model/CatalogPromotionSyliusAdminCatalogPromotionUpdate.md)| The updated CatalogPromotion 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\CatalogPromotionJsonldSyliusAdminCatalogPromotionShow**](../Model/CatalogPromotionJsonldSyliusAdminCatalogPromotionShow.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)

## `syliusApiShopCatalogPromotionGet()`

```php
syliusApiShopCatalogPromotionGet($code, $accept_language): \Sylius\Model\CatalogPromotionJsonldSyliusShopCatalogPromotionShow
```

Retrieves a CatalogPromotion resource.

Retrieves a CatalogPromotion 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\CatalogPromotionApi(
    // 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 | CatalogPromotion 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->syliusApiShopCatalogPromotionGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CatalogPromotionApi->syliusApiShopCatalogPromotionGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| CatalogPromotion 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\CatalogPromotionJsonldSyliusShopCatalogPromotionShow**](../Model/CatalogPromotionJsonldSyliusShopCatalogPromotionShow.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)
