# Faire\OrdersApi

Orders

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**ordersGet()**](OrdersApi.md#ordersGet) | **GET** /orders | GET /orders |
| [**ordersOrderIdCancelPut()**](OrdersApi.md#ordersOrderIdCancelPut) | **PUT** /orders/{order_id}/cancel | PUT /orders/{order_id}/cancel |
| [**ordersOrderIdGet()**](OrdersApi.md#ordersOrderIdGet) | **GET** /orders/{order_id} | GET /orders/{order_id} |
| [**ordersOrderIdItemsAvailabilityPost()**](OrdersApi.md#ordersOrderIdItemsAvailabilityPost) | **POST** /orders/{order_id}/items/availability | POST /orders/{order_id}/items/availability |
| [**ordersOrderIdPackingSlipPdfGet()**](OrdersApi.md#ordersOrderIdPackingSlipPdfGet) | **GET** /orders/{order_id}/packing-slip-pdf | GET /orders/{order_id}/packing-slip-pdf |
| [**ordersOrderIdProcessingPut()**](OrdersApi.md#ordersOrderIdProcessingPut) | **PUT** /orders/{order_id}/processing | PUT /orders/{order_id}/processing |
| [**ordersOrderIdShipmentsPost()**](OrdersApi.md#ordersOrderIdShipmentsPost) | **POST** /orders/{order_id}/shipments | POST /orders/{order_id}/shipments |


## `ordersGet()`

```php
ordersGet($limit, $page, $updated_at_min, $excluded_states, $ship_after_max, $created_at_min, $sort_by, $cursor, $original_order_id): \Faire\Model\GetExternalOrdersResponseV2
```

GET /orders

This endpoint retrieves a list of orders, ordered ascending by *updated_at*.

### 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\OrdersApi(
    // 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
);
$limit = 56; // int
$page = 56; // int
$updated_at_min = 'updated_at_min_example'; // string
$excluded_states = 'excluded_states_example'; // string
$ship_after_max = 'ship_after_max_example'; // string
$created_at_min = 'created_at_min_example'; // string
$sort_by = 'sort_by_example'; // string
$cursor = 'cursor_example'; // string
$original_order_id = 'original_order_id_example'; // string

try {
    $result = $apiInstance->ordersGet($limit, $page, $updated_at_min, $excluded_states, $ship_after_max, $created_at_min, $sort_by, $cursor, $original_order_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **limit** | **int**|  | [optional] |
| **page** | **int**|  | [optional] |
| **updated_at_min** | **string**|  | [optional] |
| **excluded_states** | **string**|  | [optional] |
| **ship_after_max** | **string**|  | [optional] |
| **created_at_min** | **string**|  | [optional] |
| **sort_by** | **string**|  | [optional] |
| **cursor** | **string**|  | [optional] |
| **original_order_id** | **string**|  | [optional] |

### Return type

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

## `ordersOrderIdCancelPut()`

```php
ordersOrderIdCancelPut($order_id, $external_cancel_brand_order_request_v2): \Faire\Model\ExternalOrderV2
```

PUT /orders/{order_id}/cancel

This endpoint cancels an order and places it in the state CANCELED. The order can be canceled only if it has a state of NEW, PROCESSING, PENDING_RETAILER_CONFIRMATION or BACKORDERED.

### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string
$external_cancel_brand_order_request_v2 = new \Faire\Model\ExternalCancelBrandOrderRequestV2(); // \Faire\Model\ExternalCancelBrandOrderRequestV2

try {
    $result = $apiInstance->ordersOrderIdCancelPut($order_id, $external_cancel_brand_order_request_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersOrderIdCancelPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order_id** | **string**|  | |
| **external_cancel_brand_order_request_v2** | [**\Faire\Model\ExternalCancelBrandOrderRequestV2**](../Model/ExternalCancelBrandOrderRequestV2.md)|  | |

### Return type

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

## `ordersOrderIdGet()`

```php
ordersOrderIdGet($order_id): \Faire\Model\ExternalOrderV2
```

GET /orders/{order_id}

This endpoint retrieves a single order given an order ID.

### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string

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

### Parameters

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

### Return type

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

## `ordersOrderIdItemsAvailabilityPost()`

```php
ordersOrderIdItemsAvailabilityPost($order_id, $edit_items_availability_request_v2): \Faire\Model\ExternalOrderV2
```

POST /orders/{order_id}/items/availability



### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string
$edit_items_availability_request_v2 = new \Faire\Model\EditItemsAvailabilityRequestV2(); // \Faire\Model\EditItemsAvailabilityRequestV2

try {
    $result = $apiInstance->ordersOrderIdItemsAvailabilityPost($order_id, $edit_items_availability_request_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersOrderIdItemsAvailabilityPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order_id** | **string**|  | |
| **edit_items_availability_request_v2** | [**\Faire\Model\EditItemsAvailabilityRequestV2**](../Model/EditItemsAvailabilityRequestV2.md)|  | |

### Return type

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

## `ordersOrderIdPackingSlipPdfGet()`

```php
ordersOrderIdPackingSlipPdfGet($order_id, $timezone)
```

GET /orders/{order_id}/packing-slip-pdf

This endpoint retrieves a PDF packing slip for a specific brand order.

### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string
$timezone = 'timezone_example'; // string

try {
    $apiInstance->ordersOrderIdPackingSlipPdfGet($order_id, $timezone);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersOrderIdPackingSlipPdfGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order_id** | **string**|  | |
| **timezone** | **string**|  | [optional] |

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

## `ordersOrderIdProcessingPut()`

```php
ordersOrderIdProcessingPut($order_id, $move_order_to_processing_request_v2): \Faire\Model\ExternalOrderV2
```

PUT /orders/{order_id}/processing

This endpoint accepts an order and moves it to PROCESSING.

### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string
$move_order_to_processing_request_v2 = new \Faire\Model\MoveOrderToProcessingRequestV2(); // \Faire\Model\MoveOrderToProcessingRequestV2

try {
    $result = $apiInstance->ordersOrderIdProcessingPut($order_id, $move_order_to_processing_request_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersOrderIdProcessingPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order_id** | **string**|  | |
| **move_order_to_processing_request_v2** | [**\Faire\Model\MoveOrderToProcessingRequestV2**](../Model/MoveOrderToProcessingRequestV2.md)|  | |

### Return type

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

## `ordersOrderIdShipmentsPost()`

```php
ordersOrderIdShipmentsPost($order_id, $add_shipments_request_v2): \Faire\Model\ExternalOrderV2
```

POST /orders/{order_id}/shipments

This endpoint adds shipments to an order and moves the state to PRE_TRANSIT. When one of the shipments is accepted by the carrier, the state will move to IN_TRANSIT.

### 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\OrdersApi(
    // 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
);
$order_id = 'order_id_example'; // string
$add_shipments_request_v2 = new \Faire\Model\AddShipmentsRequestV2(); // \Faire\Model\AddShipmentsRequestV2

try {
    $result = $apiInstance->ordersOrderIdShipmentsPost($order_id, $add_shipments_request_v2);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrdersApi->ordersOrderIdShipmentsPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **order_id** | **string**|  | |
| **add_shipments_request_v2** | [**\Faire\Model\AddShipmentsRequestV2**](../Model/AddShipmentsRequestV2.md)|  | |

### Return type

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