# Faire\PrepacksApi

Prepacks

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**productsProductIdPrepacksBatchPost()**](PrepacksApi.md#productsProductIdPrepacksBatchPost) | **POST** /products/{product_id}/prepacks/batch | POST /products/{product_id}/prepacks/batch |
| [**productsProductIdPrepacksGet()**](PrepacksApi.md#productsProductIdPrepacksGet) | **GET** /products/{product_id}/prepacks | GET /products/{product_id}/prepacks |
| [**productsProductIdPrepacksPost()**](PrepacksApi.md#productsProductIdPrepacksPost) | **POST** /products/{product_id}/prepacks | POST /products/{product_id}/prepacks |
| [**productsProductIdPrepacksPrepackIdDelete()**](PrepacksApi.md#productsProductIdPrepacksPrepackIdDelete) | **DELETE** /products/{product_id}/prepacks/{prepack_id} | DELETE /products/{product_id}/prepacks/{prepack_id} |
| [**productsProductIdPrepacksPrepackIdGet()**](PrepacksApi.md#productsProductIdPrepacksPrepackIdGet) | **GET** /products/{product_id}/prepacks/{prepack_id} | GET /products/{product_id}/prepacks/{prepack_id} |


## `productsProductIdPrepacksBatchPost()`

```php
productsProductIdPrepacksBatchPost($product_id, $create_external_prepacks_request_v2): \Faire\Model\CreateExternalPrepacksResponseV2
```

POST /products/{product_id}/prepacks/batch

Creates multiple prepacks for a product in a single request.

### 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\PrepacksApi(
    // 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_id = 'product_id_example'; // string
$create_external_prepacks_request_v2 = new \Faire\Model\CreateExternalPrepacksRequestV2(); // \Faire\Model\CreateExternalPrepacksRequestV2

try {
    $result = $apiInstance->productsProductIdPrepacksBatchPost($product_id, $create_external_prepacks_request_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PrepacksApi->productsProductIdPrepacksBatchPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_id** | **string**|  | |
| **create_external_prepacks_request_v2** | [**\Faire\Model\CreateExternalPrepacksRequestV2**](../Model/CreateExternalPrepacksRequestV2.md)|  | |

### Return type

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

## `productsProductIdPrepacksGet()`

```php
productsProductIdPrepacksGet($product_id): \Faire\Model\GetExternalPrepacksResponseV2
```

GET /products/{product_id}/prepacks

This endpoint gets all active prepacks of the product specified in the URL path.

### 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\PrepacksApi(
    // 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_id = 'product_id_example'; // string

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_id** | **string**|  | |

### Return type

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

## `productsProductIdPrepacksPost()`

```php
productsProductIdPrepacksPost($product_id, $external_prepack_v2): \Faire\Model\ExternalPrepackV2
```

POST /products/{product_id}/prepacks

Creates a prepack for a product.

### 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\PrepacksApi(
    // 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_id = 'product_id_example'; // string
$external_prepack_v2 = new \Faire\Model\ExternalPrepackV2(); // \Faire\Model\ExternalPrepackV2

try {
    $result = $apiInstance->productsProductIdPrepacksPost($product_id, $external_prepack_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PrepacksApi->productsProductIdPrepacksPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_id** | **string**|  | |
| **external_prepack_v2** | [**\Faire\Model\ExternalPrepackV2**](../Model/ExternalPrepackV2.md)|  | |

### Return type

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

## `productsProductIdPrepacksPrepackIdDelete()`

```php
productsProductIdPrepacksPrepackIdDelete($product_id, $prepack_id)
```

DELETE /products/{product_id}/prepacks/{prepack_id}

This endpoint deletes a specified prepack. Deleted prepacks cannot be re-activated.

### 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\PrepacksApi(
    // 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_id = 'product_id_example'; // string
$prepack_id = 'prepack_id_example'; // string

try {
    $apiInstance->productsProductIdPrepacksPrepackIdDelete($product_id, $prepack_id);
} catch (Exception $e) {
    echo 'Exception when calling PrepacksApi->productsProductIdPrepacksPrepackIdDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_id** | **string**|  | |
| **prepack_id** | **string**|  | |

### Return type

void (empty response body)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `productsProductIdPrepacksPrepackIdGet()`

```php
productsProductIdPrepacksPrepackIdGet($product_id, $prepack_id): \Faire\Model\ExternalPrepackV2
```

GET /products/{product_id}/prepacks/{prepack_id}

This endpoint gets a single prepack specified in the URL path.

### 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\PrepacksApi(
    // 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_id = 'product_id_example'; // string
$prepack_id = 'prepack_id_example'; // string

try {
    $result = $apiInstance->productsProductIdPrepacksPrepackIdGet($product_id, $prepack_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PrepacksApi->productsProductIdPrepacksPrepackIdGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_id** | **string**|  | |
| **prepack_id** | **string**|  | |

### Return type

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