# Sylius\PromotionApi

Resource &#39;Promotion&#39; operations.

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminPromotionDelete()**](PromotionApi.md#syliusApiAdminPromotionDelete) | **DELETE** /api/v2/admin/promotions/{code} | Removes the Promotion resource. |
| [**syliusApiAdminPromotionGet()**](PromotionApi.md#syliusApiAdminPromotionGet) | **GET** /api/v2/admin/promotions/{code} | Retrieves a Promotion resource. |
| [**syliusApiAdminPromotionGetCollection()**](PromotionApi.md#syliusApiAdminPromotionGetCollection) | **GET** /api/v2/admin/promotions | Retrieves the collection of Promotion resources. |
| [**syliusApiAdminPromotionPatchArchive()**](PromotionApi.md#syliusApiAdminPromotionPatchArchive) | **PATCH** /api/v2/admin/promotions/{code}/archive | Updates the Promotion resource. |
| [**syliusApiAdminPromotionPatchRestore()**](PromotionApi.md#syliusApiAdminPromotionPatchRestore) | **PATCH** /api/v2/admin/promotions/{code}/restore | Updates the Promotion resource. |
| [**syliusApiAdminPromotionPost()**](PromotionApi.md#syliusApiAdminPromotionPost) | **POST** /api/v2/admin/promotions | Creates a Promotion resource. |
| [**syliusApiAdminPromotionPut()**](PromotionApi.md#syliusApiAdminPromotionPut) | **PUT** /api/v2/admin/promotions/{code} | Replaces the Promotion resource. |


## `syliusApiAdminPromotionDelete()`

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

Removes the Promotion resource.

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

### Parameters

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

## `syliusApiAdminPromotionGet()`

```php
syliusApiAdminPromotionGet($code, $accept_language): \Sylius\Model\PromotionJsonldSyliusAdminPromotionShow
```

Retrieves a Promotion resource.

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

### Parameters

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

## `syliusApiAdminPromotionGetCollection()`

```php
syliusApiAdminPromotionGetCollection($page, $items_per_page, $coupons_code, $coupons_code2, $order_priority, $exists_archived_at, $accept_language): \Sylius\Model\SyliusApiAdminPromotionGetCollection200Response
```

Retrieves the collection of Promotion resources.

Retrieves the collection of Promotion 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\PromotionApi(
    // 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
$coupons_code = 'coupons_code_example'; // string | 
$coupons_code2 = array('coupons_code_example'); // string[] | 
$order_priority = ''; // string | 
$exists_archived_at = True; // bool | 
$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->syliusApiAdminPromotionGetCollection($page, $items_per_page, $coupons_code, $coupons_code2, $order_priority, $exists_archived_at, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromotionApi->syliusApiAdminPromotionGetCollection: ', $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] |
| **coupons_code** | **string**|  | [optional] |
| **coupons_code2** | [**string[]**](../Model/string.md)|  | [optional] |
| **order_priority** | **string**|  | [optional] [default to &#39;&#39;] |
| **exists_archived_at** | **bool**|  | [optional] |
| **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\SyliusApiAdminPromotionGetCollection200Response**](../Model/SyliusApiAdminPromotionGetCollection200Response.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)

## `syliusApiAdminPromotionPatchArchive()`

```php
syliusApiAdminPromotionPatchArchive($code, $accept_language): \Sylius\Model\PromotionJsonldSyliusAdminPromotionShow
```

Updates the Promotion resource.

Updates the Promotion 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\PromotionApi(
    // 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 | Promotion 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->syliusApiAdminPromotionPatchArchive($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromotionApi->syliusApiAdminPromotionPatchArchive: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

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

## `syliusApiAdminPromotionPatchRestore()`

```php
syliusApiAdminPromotionPatchRestore($code, $accept_language): \Sylius\Model\PromotionJsonldSyliusAdminPromotionShow
```

Updates the Promotion resource.

Updates the Promotion 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\PromotionApi(
    // 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 | Promotion 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->syliusApiAdminPromotionPatchRestore($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromotionApi->syliusApiAdminPromotionPatchRestore: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

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

## `syliusApiAdminPromotionPost()`

```php
syliusApiAdminPromotionPost($promotion_sylius_admin_promotion_create, $accept_language): \Sylius\Model\PromotionJsonldSyliusAdminPromotionShow
```

Creates a Promotion resource.

Creates a Promotion resource.   Allowed rule types: `customer_group`, `nth_order`, `shipping_country`, `has_taxon`, `total_of_items_from_taxon`, `contains_product`, `item_total`, `cart_quantity`    Allowed action types: `order_fixed_discount`, `unit_fixed_discount`, `order_percentage_discount`, `unit_percentage_discount`, `shipping_percentage_discount`

### 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\PromotionApi(
    // 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
);
$promotion_sylius_admin_promotion_create = new \Sylius\Model\PromotionSyliusAdminPromotionCreate(); // \Sylius\Model\PromotionSyliusAdminPromotionCreate | The new Promotion 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->syliusApiAdminPromotionPost($promotion_sylius_admin_promotion_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromotionApi->syliusApiAdminPromotionPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **promotion_sylius_admin_promotion_create** | [**\Sylius\Model\PromotionSyliusAdminPromotionCreate**](../Model/PromotionSyliusAdminPromotionCreate.md)| The new Promotion 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\PromotionJsonldSyliusAdminPromotionShow**](../Model/PromotionJsonldSyliusAdminPromotionShow.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)

## `syliusApiAdminPromotionPut()`

```php
syliusApiAdminPromotionPut($code, $promotion_sylius_admin_promotion_update, $accept_language): \Sylius\Model\PromotionJsonldSyliusAdminPromotionShow
```

Replaces the Promotion resource.

Replaces the Promotion resource.   Allowed rule types: `customer_group`, `nth_order`, `shipping_country`, `has_taxon`, `total_of_items_from_taxon`, `contains_product`, `item_total`, `cart_quantity`    Allowed action types: `order_fixed_discount`, `unit_fixed_discount`, `order_percentage_discount`, `unit_percentage_discount`, `shipping_percentage_discount`

### 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\PromotionApi(
    // 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 | Promotion identifier
$promotion_sylius_admin_promotion_update = new \Sylius\Model\PromotionSyliusAdminPromotionUpdate(); // \Sylius\Model\PromotionSyliusAdminPromotionUpdate | The updated Promotion 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->syliusApiAdminPromotionPut($code, $promotion_sylius_admin_promotion_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PromotionApi->syliusApiAdminPromotionPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| Promotion identifier | |
| **promotion_sylius_admin_promotion_update** | [**\Sylius\Model\PromotionSyliusAdminPromotionUpdate**](../Model/PromotionSyliusAdminPromotionUpdate.md)| The updated Promotion 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\PromotionJsonldSyliusAdminPromotionShow**](../Model/PromotionJsonldSyliusAdminPromotionShow.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)
