# Vend202601\ProductCategoriesApi



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 |
| ------------- | ------------- | ------------- |
| [**createUpdateProductCategories()**](ProductCategoriesApi.md#createUpdateProductCategories) | **POST** /product_categories/bulk | Create and update a product category hierarchy |
| [**deleteProductCategories()**](ProductCategoriesApi.md#deleteProductCategories) | **DELETE** /product_categories/bulk | Delete a list of product categories |
| [**listProductCategories()**](ProductCategoriesApi.md#listProductCategories) | **GET** /product_categories | List product categories |


## `createUpdateProductCategories()`

```php
createUpdateProductCategories($create_update_product_categories_request): \Vend202601\Model\CreateUpdateProductCategories200Response
```

Create and update a product category hierarchy

🔒 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\ProductCategoriesApi(
    // 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
);
$create_update_product_categories_request = {"categories":[{"name":"Dog Food","parent_category_id":"2cd5ff83-8a76-498a-9fe9-f28c9e24bcff"}]}; // \Vend202601\Model\CreateUpdateProductCategoriesRequest

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **create_update_product_categories_request** | [**\Vend202601\Model\CreateUpdateProductCategoriesRequest**](../Model/CreateUpdateProductCategoriesRequest.md)|  | [optional] |

### Return type

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

## `deleteProductCategories()`

```php
deleteProductCategories($delete_product_categories_request): \Vend202601\Model\DeleteProductCategories200Response
```

Delete a list of product categories

Delete a list of categories. If the category is a parent or root, the descendent categories also get deleted. Products associated to the deleted category are assigned to the parent, or if the deleted category is a root, the products are unassigned.  🔒 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\ProductCategoriesApi(
    // 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
);
$delete_product_categories_request = new \Vend202601\Model\DeleteProductCategoriesRequest(); // \Vend202601\Model\DeleteProductCategoriesRequest

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **delete_product_categories_request** | [**\Vend202601\Model\DeleteProductCategoriesRequest**](../Model/DeleteProductCategoriesRequest.md)|  | [optional] |

### Return type

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

## `listProductCategories()`

```php
listProductCategories($parent, $include, $page_size, $after): \Vend202601\Model\ListProductCategories200Response
```

List product categories

🔒 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\ProductCategoriesApi(
    // 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
);
$parent = 'parent_example'; // string | If parent is an id, it filters the list of categories that belongs to the given category. If parent is \"none\", it filters  categories for root categories only.
$include = 'include_example'; // string | Defaults to \"family\" * `family` - Include all categories in the hierarchy. * `children` - Include only direct children.
$page_size = 56; // int | The total number of categories to return. Default is 1000.
$after = 'after_example'; // string | The category id to get the next set of paginated results.

try {
    $result = $apiInstance->listProductCategories($parent, $include, $page_size, $after);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductCategoriesApi->listProductCategories: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **parent** | **string**| If parent is an id, it filters the list of categories that belongs to the given category. If parent is \&quot;none\&quot;, it filters  categories for root categories only. | [optional] |
| **include** | **string**| Defaults to \&quot;family\&quot; * &#x60;family&#x60; - Include all categories in the hierarchy. * &#x60;children&#x60; - Include only direct children. | [optional] |
| **page_size** | **int**| The total number of categories to return. Default is 1000. | [optional] |
| **after** | **string**| The category id to get the next set of paginated results. | [optional] |

### Return type

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