# Sylius\ProductVariantApi

Resource &#39;ProductVariant&#39; operations.

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminProductVariantDelete()**](ProductVariantApi.md#syliusApiAdminProductVariantDelete) | **DELETE** /api/v2/admin/product-variants/{code} | Removes the ProductVariant resource. |
| [**syliusApiAdminProductVariantGet()**](ProductVariantApi.md#syliusApiAdminProductVariantGet) | **GET** /api/v2/admin/product-variants/{code} | Retrieves a ProductVariant resource. |
| [**syliusApiAdminProductVariantGetCollection()**](ProductVariantApi.md#syliusApiAdminProductVariantGetCollection) | **GET** /api/v2/admin/product-variants | Retrieves the collection of ProductVariant resources. |
| [**syliusApiAdminProductVariantPost()**](ProductVariantApi.md#syliusApiAdminProductVariantPost) | **POST** /api/v2/admin/product-variants | Creates a ProductVariant resource. |
| [**syliusApiAdminProductVariantPut()**](ProductVariantApi.md#syliusApiAdminProductVariantPut) | **PUT** /api/v2/admin/product-variants/{code} | Replaces the ProductVariant resource. |
| [**syliusApiShopProductVariantGet()**](ProductVariantApi.md#syliusApiShopProductVariantGet) | **GET** /api/v2/shop/product-variants/{code} | Retrieves a ProductVariant resource. |
| [**syliusApiShopProductVariantGetCollection()**](ProductVariantApi.md#syliusApiShopProductVariantGetCollection) | **GET** /api/v2/shop/product-variants | Retrieves the collection of ProductVariant resources. |


## `syliusApiAdminProductVariantDelete()`

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

Removes the ProductVariant resource.

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

### Parameters

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

## `syliusApiAdminProductVariantGet()`

```php
syliusApiAdminProductVariantGet($code, $accept_language): \Sylius\Model\ProductVariantJsonldSyliusAdminProductVariantShow
```

Retrieves a ProductVariant resource.

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

### Parameters

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

## `syliusApiAdminProductVariantGetCollection()`

```php
syliusApiAdminProductVariantGetCollection($page, $items_per_page, $order_position, $product, $product2, $code, $translations_name, $catalog_promotion, $accept_language): \Sylius\Model\SyliusApiAdminProductVariantGetCollection200Response
```

Retrieves the collection of ProductVariant resources.

Retrieves the collection of ProductVariant 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\ProductVariantApi(
    // 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
$order_position = ''; // string | 
$product = 'product_example'; // string | 
$product2 = array('product_example'); // string[] | 
$code = 'code_example'; // string | 
$translations_name = 'translations_name_example'; // string | 
$catalog_promotion = 'catalog_promotion_example'; // string | Get a collection of product variants with applied catalog promotion
$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->syliusApiAdminProductVariantGetCollection($page, $items_per_page, $order_position, $product, $product2, $code, $translations_name, $catalog_promotion, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductVariantApi->syliusApiAdminProductVariantGetCollection: ', $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] |
| **order_position** | **string**|  | [optional] [default to &#39;&#39;] |
| **product** | **string**|  | [optional] |
| **product2** | [**string[]**](../Model/string.md)|  | [optional] |
| **code** | **string**|  | [optional] |
| **translations_name** | **string**|  | [optional] |
| **catalog_promotion** | **string**| Get a collection of product variants with applied catalog promotion | [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\SyliusApiAdminProductVariantGetCollection200Response**](../Model/SyliusApiAdminProductVariantGetCollection200Response.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)

## `syliusApiAdminProductVariantPost()`

```php
syliusApiAdminProductVariantPost($product_variant_sylius_admin_product_variant_create, $accept_language): \Sylius\Model\ProductVariantJsonldSyliusAdminProductVariantShow
```

Creates a ProductVariant resource.

Creates a ProductVariant 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\ProductVariantApi(
    // 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
);
$product_variant_sylius_admin_product_variant_create = new \Sylius\Model\ProductVariantSyliusAdminProductVariantCreate(); // \Sylius\Model\ProductVariantSyliusAdminProductVariantCreate | The new ProductVariant 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->syliusApiAdminProductVariantPost($product_variant_sylius_admin_product_variant_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductVariantApi->syliusApiAdminProductVariantPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_variant_sylius_admin_product_variant_create** | [**\Sylius\Model\ProductVariantSyliusAdminProductVariantCreate**](../Model/ProductVariantSyliusAdminProductVariantCreate.md)| The new ProductVariant 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\ProductVariantJsonldSyliusAdminProductVariantShow**](../Model/ProductVariantJsonldSyliusAdminProductVariantShow.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)

## `syliusApiAdminProductVariantPut()`

```php
syliusApiAdminProductVariantPut($code, $product_variant_sylius_admin_product_variant_update, $accept_language): \Sylius\Model\ProductVariantJsonldSyliusAdminProductVariantShow
```

Replaces the ProductVariant resource.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| ProductVariant identifier | |
| **product_variant_sylius_admin_product_variant_update** | [**\Sylius\Model\ProductVariantSyliusAdminProductVariantUpdate**](../Model/ProductVariantSyliusAdminProductVariantUpdate.md)| The updated ProductVariant 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\ProductVariantJsonldSyliusAdminProductVariantShow**](../Model/ProductVariantJsonldSyliusAdminProductVariantShow.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)

## `syliusApiShopProductVariantGet()`

```php
syliusApiShopProductVariantGet($code, $accept_language): \Sylius\Model\ProductVariantJsonldSyliusShopProductVariantShow
```

Retrieves a ProductVariant resource.

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

### Parameters

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

## `syliusApiShopProductVariantGetCollection()`

```php
syliusApiShopProductVariantGetCollection($page, $items_per_page, $product, $product2, $option_values, $option_values2, $accept_language): \Sylius\Model\SyliusApiShopProductVariantGetCollection200Response
```

Retrieves the collection of ProductVariant resources.

Retrieves the collection of ProductVariant 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\ProductVariantApi(
    // 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
$product = 'product_example'; // string | 
$product2 = array('product_example'); // string[] | 
$option_values = 'option_values_example'; // string | 
$option_values2 = array('option_values_example'); // 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->syliusApiShopProductVariantGetCollection($page, $items_per_page, $product, $product2, $option_values, $option_values2, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductVariantApi->syliusApiShopProductVariantGetCollection: ', $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] |
| **product** | **string**|  | [optional] |
| **product2** | [**string[]**](../Model/string.md)|  | [optional] |
| **option_values** | **string**|  | [optional] |
| **option_values2** | [**string[]**](../Model/string.md)|  | [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\SyliusApiShopProductVariantGetCollection200Response**](../Model/SyliusApiShopProductVariantGetCollection200Response.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)
