# Vend202601\ConsignmentsApi

Stock control operations

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 |
| ------------- | ------------- | ------------- |
| [**createConsignment()**](ConsignmentsApi.md#createConsignment) | **POST** /consignments | Create a consignment |
| [**deleteConsignmentByID()**](ConsignmentsApi.md#deleteConsignmentByID) | **DELETE** /consignments/{consignment_id} | Delete a consignment |
| [**getConsignmentByID()**](ConsignmentsApi.md#getConsignmentByID) | **GET** /consignments/{consignment_id} | Get a single consignment |
| [**getConsignments()**](ConsignmentsApi.md#getConsignments) | **GET** /consignments | List consignments |
| [**listConsignmentTotals()**](ConsignmentsApi.md#listConsignmentTotals) | **GET** /consignments/{consignment_id}/totals | Get consignment totals |
| [**updateConsignmentByID()**](ConsignmentsApi.md#updateConsignmentByID) | **PUT** /consignments/{consignment_id} | Update a consignment |


## `createConsignment()`

```php
createConsignment($consignment_request): \Vend202601\Model\ConsignmentResponse
```

Create a consignment

Creates a new consignment.  The consignment type can be `SUPPLIER`, `OUTLET`, `STOCKTAKE` or `RETURN`. The workflows for these are:  - `SUPPLIER` workflow: `OPEN` -> `SENT` -> `DISPATCHED` -> `RECEIVED`   * Can be `CANCELLED` at any time, except from `RECEIVED`   * Cannot create a `DISPATCHED` or `RECEIVED` consignment directly   * In the response `reference` refers to `Order number` and `name` refers to `Note` - `OUTLET` workflow: `OPEN` -> `SENT` -> `RECEIVED` (can be `CANCELLED` at any time after `OPEN`) - `RETURN` workflow: `OPEN` -> `SENT` or `CANCELLED` - `STOCKTAKE` workflow: `STOCKTAKE` or `STOCKTAKE_SCHEDULED` -> `STOCKTAKE_IN_PROGRESS` -> `STOCKTAKE_IN_PROGRESS_PROCESSED` -> `STOCKTAKE_COMPLETE` (can be `CANCELLED` or `CLOSED` at any time)  🔒 Requires: One of the following scopes: - `consignments:write:stock_order` scope for `SUPPLIER` and `RETURN` consignments - `consignments:write:stock_transfer` scope for `OUTLET` consignments - `consignments:write:inventory_count` scope for `STOCKTAKE` consignments

### 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\ConsignmentsApi(
    // 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
);
$consignment_request = new \Vend202601\Model\ConsignmentRequest(); // \Vend202601\Model\ConsignmentRequest

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

### Parameters

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

### Return type

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

## `deleteConsignmentByID()`

```php
deleteConsignmentByID($consignment_id)
```

Delete a consignment

Deletes the consignment with the given ID.  🔒 Requires: One of the following scopes: - `consignments:write:stock_order` scope for `SUPPLIER` and `RETURN` consignments - `consignments:write:stock_transfer` scope for `OUTLET` consignments - `consignments:write:inventory_count` scope for `STOCKTAKE` consignments

### 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\ConsignmentsApi(
    // 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
);
$consignment_id = 'consignment_id_example'; // string | The consignment id

try {
    $apiInstance->deleteConsignmentByID($consignment_id);
} catch (Exception $e) {
    echo 'Exception when calling ConsignmentsApi->deleteConsignmentByID: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **consignment_id** | **string**| The consignment id | |

### Return type

void (empty response body)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

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

## `getConsignmentByID()`

```php
getConsignmentByID($consignment_id): \Vend202601\Model\ConsignmentResponse
```

Get a single consignment

Returns a single consignment with the requested ID.  🔒 Requires: `consignments: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\ConsignmentsApi(
    // 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
);
$consignment_id = 'consignment_id_example'; // string | The consignment id

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **consignment_id** | **string**| The consignment id | |

### Return type

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

## `getConsignments()`

```php
getConsignments($type, $status, $outlet_id, $after, $before, $page_size): \Vend202601\Model\Consignment[]
```

List consignments

Return a paginated list of consignments.  🔒 Requires: `consignments: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\ConsignmentsApi(
    // 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
);
$type = 'type_example'; // string | The consignment type to search for.
$status = 'status_example'; // string | The consignment status to search for.
$outlet_id = 'outlet_id_example'; // string | Filter response by the ID of the outlet associated with the consignments.
$after = 56; // int | The lower limit for the version numbers to be included in the response.
$before = 56; // int | The upper limit for the version numbers to be included in the response.
$page_size = 56; // int | The maximum number of items to be returned in the response.

try {
    $result = $apiInstance->getConsignments($type, $status, $outlet_id, $after, $before, $page_size);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConsignmentsApi->getConsignments: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **type** | **string**| The consignment type to search for. | [optional] |
| **status** | **string**| The consignment status to search for. | [optional] |
| **outlet_id** | **string**| Filter response by the ID of the outlet associated with the consignments. | [optional] |
| **after** | **int**| The lower limit for the version numbers to be included in the response. | [optional] |
| **before** | **int**| The upper limit for the version numbers to be included in the response. | [optional] |
| **page_size** | **int**| The maximum number of items to be returned in the response. | [optional] |

### Return type

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

## `listConsignmentTotals()`

```php
listConsignmentTotals($consignment_id)
```

Get consignment totals

Returns the count and cost for the given consignment.  The consignment type can be `SUPPLIER`, `OUTLET` or `RETURN` (not `STOCKTAKE`).  The status of the consignment will determine which values make sense:  - If the consignment type is `OUTLET` the sent cost may not be accurate when the status is `OPEN`. - If the consignment is `OPEN` or `SENT` the received count and cost should both be zero. - For completely received consignments received cost should equal the sent cost and the received count should equal the sent count. - For partially received consignments we would expect the received cost value to be less than sent cost value, and the received count to be less than the sent count.  🔒 Requires: `consignments: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\ConsignmentsApi(
    // 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
);
$consignment_id = 'consignment_id_example'; // string | The consignment id

try {
    $apiInstance->listConsignmentTotals($consignment_id);
} catch (Exception $e) {
    echo 'Exception when calling ConsignmentsApi->listConsignmentTotals: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **consignment_id** | **string**| The consignment id | |

### Return type

void (empty response body)

### Authorization

[bearerAuth](../../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `Example`, `application/json`

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

## `updateConsignmentByID()`

```php
updateConsignmentByID($consignment_id, $consignment_request): \Vend202601\Model\ConsignmentResponse
```

Update a consignment

Updates the given consignment.  If the type is SUPPLIER then:  - Cannot change from `SUPPLIER` to a different consignment type - `SUPPLIER` workflow: `OPEN` -> `SENT` -> `DISPATCHED` -> `RECEIVED` - Can be `CANCELLED` at any time, except from `RECEIVED` - Cannot update a `SUPPLIER` consignment that has the status `RECEIVED` or `CANCELLED` - Cannot update status if there are no products in the order - At least one product should have non-zero received quantity before updating to `RECEIVED`  🔒 Requires: One of the following scopes: - `consignments:write:stock_order` scope for `SUPPLIER` and `RETURN` consignments - `consignments:write:stock_transfer` scope for `OUTLET` consignments - `consignments:write:inventory_count` scope for `STOCKTAKE` consignments

### 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\ConsignmentsApi(
    // 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
);
$consignment_id = 'consignment_id_example'; // string | The consignment id
$consignment_request = new \Vend202601\Model\ConsignmentRequest(); // \Vend202601\Model\ConsignmentRequest

try {
    $result = $apiInstance->updateConsignmentByID($consignment_id, $consignment_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConsignmentsApi->updateConsignmentByID: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **consignment_id** | **string**| The consignment id | |
| **consignment_request** | [**\Vend202601\Model\ConsignmentRequest**](../Model/ConsignmentRequest.md)|  | |

### Return type

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