# Faire\InventoryApi

Inventory

All URIs are relative to https://www.faire.com/external-api/v2, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**productInventoryByProductVariantIdsGet()**](InventoryApi.md#productInventoryByProductVariantIdsGet) | **GET** /product-inventory/by-product-variant-ids | GET /product-inventory/by-product-variant-ids |
| [**productInventoryByProductVariantIdsPatch()**](InventoryApi.md#productInventoryByProductVariantIdsPatch) | **PATCH** /product-inventory/by-product-variant-ids | PATCH /product-inventory/by-product-variant-ids |
| [**productInventoryBySkusGet()**](InventoryApi.md#productInventoryBySkusGet) | **GET** /product-inventory/by-skus | GET /product-inventory/by-skus |
| [**productInventoryBySkusPatch()**](InventoryApi.md#productInventoryBySkusPatch) | **PATCH** /product-inventory/by-skus | PATCH /product-inventory/by-skus |
| [**productsVariantsInventoryLevelsByProductVariantIdsPatch()**](InventoryApi.md#productsVariantsInventoryLevelsByProductVariantIdsPatch) | **PATCH** /products/variants/inventory-levels-by-product-variant-ids | PATCH /products/variants/inventory-levels-by-product-variant-ids |
| [**productsVariantsInventoryLevelsBySkusPatch()**](InventoryApi.md#productsVariantsInventoryLevelsBySkusPatch) | **PATCH** /products/variants/inventory-levels-by-skus | PATCH /products/variants/inventory-levels-by-skus |


## `productInventoryByProductVariantIdsGet()`

```php
productInventoryByProductVariantIdsGet($ids): \Faire\Model\GetInventoryResponseV2
```

GET /product-inventory/by-product-variant-ids

This endpoint fetches inventory levels by given product variant IDs.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$ids = 'ids_example'; // string

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **ids** | **string**|  | [optional] |

### Return type

[**\Faire\Model\GetInventoryResponseV2**](../Model/GetInventoryResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)

## `productInventoryByProductVariantIdsPatch()`

```php
productInventoryByProductVariantIdsPatch($update_on_hand_inventory_request_v2): \Faire\Model\UpdateOnHandInventoryResponseV2
```

PATCH /product-inventory/by-product-variant-ids

This endpoint updates on hand inventory levels by given product variant IDs.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$update_on_hand_inventory_request_v2 = new \Faire\Model\UpdateOnHandInventoryRequestV2(); // \Faire\Model\UpdateOnHandInventoryRequestV2

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **update_on_hand_inventory_request_v2** | [**\Faire\Model\UpdateOnHandInventoryRequestV2**](../Model/UpdateOnHandInventoryRequestV2.md)|  | |

### Return type

[**\Faire\Model\UpdateOnHandInventoryResponseV2**](../Model/UpdateOnHandInventoryResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)

## `productInventoryBySkusGet()`

```php
productInventoryBySkusGet($skus): \Faire\Model\GetInventoryResponseV2
```

GET /product-inventory/by-skus

This endpoint fetches inventory levels by given product variant SKUs.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$skus = 'skus_example'; // string

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **skus** | **string**|  | [optional] |

### Return type

[**\Faire\Model\GetInventoryResponseV2**](../Model/GetInventoryResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)

## `productInventoryBySkusPatch()`

```php
productInventoryBySkusPatch($update_on_hand_inventory_request_v2): \Faire\Model\UpdateOnHandInventoryResponseV2
```

PATCH /product-inventory/by-skus

This endpoint updates variant inventory levels by given variant SKUs.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$update_on_hand_inventory_request_v2 = new \Faire\Model\UpdateOnHandInventoryRequestV2(); // \Faire\Model\UpdateOnHandInventoryRequestV2

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **update_on_hand_inventory_request_v2** | [**\Faire\Model\UpdateOnHandInventoryRequestV2**](../Model/UpdateOnHandInventoryRequestV2.md)|  | |

### Return type

[**\Faire\Model\UpdateOnHandInventoryResponseV2**](../Model/UpdateOnHandInventoryResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)

## `productsVariantsInventoryLevelsByProductVariantIdsPatch()`

```php
productsVariantsInventoryLevelsByProductVariantIdsPatch($update_inventory_levels_request_v2): \Faire\Model\UpdateInventoryLevelsResponseV2
```

PATCH /products/variants/inventory-levels-by-product-variant-ids

This endpoint is deprecated. Please use the endpoints in the product variant inventory section to update inventory instead.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$update_inventory_levels_request_v2 = new \Faire\Model\UpdateInventoryLevelsRequestV2(); // \Faire\Model\UpdateInventoryLevelsRequestV2

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **update_inventory_levels_request_v2** | [**\Faire\Model\UpdateInventoryLevelsRequestV2**](../Model/UpdateInventoryLevelsRequestV2.md)|  | |

### Return type

[**\Faire\Model\UpdateInventoryLevelsResponseV2**](../Model/UpdateInventoryLevelsResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)

## `productsVariantsInventoryLevelsBySkusPatch()`

```php
productsVariantsInventoryLevelsBySkusPatch($update_inventory_levels_request_v2): \Faire\Model\UpdateInventoryLevelsResponseV2
```

PATCH /products/variants/inventory-levels-by-skus

This endpoint is deprecated. Please use the endpoints in the product variant inventory section to update inventory instead.

### Example

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


// Configure API key authorization: AppCredentials
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-APP-CREDENTIALS', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-APP-CREDENTIALS', 'Bearer');

// Configure API key authorization: OAuth
$config = Faire\Configuration::getDefaultConfiguration()->setApiKey('X-FAIRE-OAUTH-ACCESS-TOKEN', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Faire\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-FAIRE-OAUTH-ACCESS-TOKEN', 'Bearer');


$apiInstance = new Faire\Api\InventoryApi(
    // 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
);
$update_inventory_levels_request_v2 = new \Faire\Model\UpdateInventoryLevelsRequestV2(); // \Faire\Model\UpdateInventoryLevelsRequestV2

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **update_inventory_levels_request_v2** | [**\Faire\Model\UpdateInventoryLevelsRequestV2**](../Model/UpdateInventoryLevelsRequestV2.md)|  | |

### Return type

[**\Faire\Model\UpdateInventoryLevelsResponseV2**](../Model/UpdateInventoryLevelsResponseV2.md)

### Authorization

[AppCredentials](../../README.md#AppCredentials), [OAuth](../../README.md#OAuth)

### 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)
