# Vend202601\VariantAttributesApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createVariantAttribute()**](VariantAttributesApi.md#createVariantAttribute) | **POST** /variant_attributes | Create a Variant Attribute |
| [**deleteVariantAttribute()**](VariantAttributesApi.md#deleteVariantAttribute) | **DELETE** /variant_attributes/{attribute-id} | Delete a variant attribute |
| [**getVariantAttributes()**](VariantAttributesApi.md#getVariantAttributes) | **GET** /variant_attributes/{attribute-id} | Retrieve a single Variant Attribute |
| [**listVariantAttributes()**](VariantAttributesApi.md#listVariantAttributes) | **GET** /variant_attributes | Retrieve all Variant Attributes |
| [**updateVariantAttribute()**](VariantAttributesApi.md#updateVariantAttribute) | **PUT** /variant_attributes/{attribute-id} | Update a Variant Attribute&#39;s |


## `createVariantAttribute()`

```php
createVariantAttribute($variant_attribute_create_update_body): \Vend202601\Model\VariantAttributeCreateResponse
```

Create a Variant Attribute

Variant Attributes are required when creating variants. They are used to specify what properties make a particular SKU different to another. e.g. You may have an attribute 'Size' that lets you differentiate variants based on their size.  🔒 Requires: `products:write` scope

### Example

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


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


$apiInstance = new Vend202601\Api\VariantAttributesApi(
    // 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
);
$variant_attribute_create_update_body = new \Vend202601\Model\VariantAttributeCreateUpdateBody(); // \Vend202601\Model\VariantAttributeCreateUpdateBody

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **variant_attribute_create_update_body** | [**\Vend202601\Model\VariantAttributeCreateUpdateBody**](../Model/VariantAttributeCreateUpdateBody.md)|  | |

### Return type

[**\Vend202601\Model\VariantAttributeCreateResponse**](../Model/VariantAttributeCreateResponse.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)

## `deleteVariantAttribute()`

```php
deleteVariantAttribute($attribute_id): \Vend202601\Model\VariantAttributeDeleteResponse
```

Delete a variant attribute

Note you can't delete a variant attribute that is currently being used by a family.  🔒 Requires: `products:write` scope

### Example

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


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


$apiInstance = new Vend202601\Api\VariantAttributesApi(
    // 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
);
$attribute_id = 'attribute_id_example'; // string | The object identifier of the Variant Attribute to delete.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **attribute_id** | **string**| The object identifier of the Variant Attribute to delete. | |

### Return type

[**\Vend202601\Model\VariantAttributeDeleteResponse**](../Model/VariantAttributeDeleteResponse.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)

## `getVariantAttributes()`

```php
getVariantAttributes($attribute_id, $deleted): \Vend202601\Model\VariantAttributeResponse
```

Retrieve a single Variant Attribute

Retrieves a single Variant Attribute with the given id.  🔒 Requires: `products:read` scope

### Example

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


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


$apiInstance = new Vend202601\Api\VariantAttributesApi(
    // 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
);
$attribute_id = 'attribute_id_example'; // string | The object identifier of the Variant Attribute to retrieve.
$deleted = True; // bool | Indicates whether deleted items should be included in the response.

try {
    $result = $apiInstance->getVariantAttributes($attribute_id, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VariantAttributesApi->getVariantAttributes: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **attribute_id** | **string**| The object identifier of the Variant Attribute to retrieve. | |
| **deleted** | **bool**| Indicates whether deleted items should be included in the response. | [optional] |

### Return type

[**\Vend202601\Model\VariantAttributeResponse**](../Model/VariantAttributeResponse.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)

## `listVariantAttributes()`

```php
listVariantAttributes($deleted): \Vend202601\Model\VariantAttributesListResponse
```

Retrieve all Variant Attributes

Retrieve all Variant Attributes.  🔒 Requires: `products:read` scope

### Example

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


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


$apiInstance = new Vend202601\Api\VariantAttributesApi(
    // 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
);
$deleted = True; // bool | Indicates whether deleted items should be included in the response.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **deleted** | **bool**| Indicates whether deleted items should be included in the response. | [optional] |

### Return type

[**\Vend202601\Model\VariantAttributesListResponse**](../Model/VariantAttributesListResponse.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)

## `updateVariantAttribute()`

```php
updateVariantAttribute($attribute_id, $variant_attribute_create_update_body): \Vend202601\Model\VariantAttributeUpdateResponse
```

Update a Variant Attribute's

Updates a Variant Attribute's name.  🔒 Requires: `products:write` scope

### Example

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


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


$apiInstance = new Vend202601\Api\VariantAttributesApi(
    // 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
);
$attribute_id = 'attribute_id_example'; // string | The object identifier of the Variant Attribute to update.
$variant_attribute_create_update_body = new \Vend202601\Model\VariantAttributeCreateUpdateBody(); // \Vend202601\Model\VariantAttributeCreateUpdateBody

try {
    $result = $apiInstance->updateVariantAttribute($attribute_id, $variant_attribute_create_update_body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VariantAttributesApi->updateVariantAttribute: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **attribute_id** | **string**| The object identifier of the Variant Attribute to update. | |
| **variant_attribute_create_update_body** | [**\Vend202601\Model\VariantAttributeCreateUpdateBody**](../Model/VariantAttributeCreateUpdateBody.md)|  | |

### Return type

[**\Vend202601\Model\VariantAttributeUpdateResponse**](../Model/VariantAttributeUpdateResponse.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)
