# Vend\FulfillmentsApi

Fulfillment operations

All URIs are relative to https://example.retail.lightspeed.app/api/2026-07, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**getFulfillmentHistory()**](FulfillmentsApi.md#getFulfillmentHistory) | **GET** /fulfillments/{fulfillment_id}/history | Get Fulfillment History |
| [**getFulfillmentSummary()**](FulfillmentsApi.md#getFulfillmentSummary) | **GET** /fulfillments | Get Fulfillments Summary |
| [**postFulfillLineItems()**](FulfillmentsApi.md#postFulfillLineItems) | **POST** /fulfillments/{fulfillment_id}/fulfill | Fulfill line items within a sale |
| [**postFulfillSale()**](FulfillmentsApi.md#postFulfillSale) | **POST** /fulfillments/fulfill | Fulfill a Sale |
| [**postPackLineItems()**](FulfillmentsApi.md#postPackLineItems) | **POST** /fulfillments/{fulfillment_id}/pack | Partial Pack line items within a sale |
| [**postPickLineItems()**](FulfillmentsApi.md#postPickLineItems) | **POST** /fulfillments/{fulfillment_id}/pick | Partial Pick line items within a sale |


## `getFulfillmentHistory()`

```php
getFulfillmentHistory($fulfillment_id, $limit, $cursor): \Vend\Model\FulfillmentHistoryResponse
```

Get Fulfillment History

Retrieves the history ledger for a single fulfillment, showing all state-change events (e.g. created, picked, packed, fulfilled, voided, returned) for each line item.  Results are ordered oldest-first and support cursor-based pagination. When no more pages exist, the `next_cursor` field will be empty.  🔒 Requires: `fulfillments:read` scope

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$fulfillment_id = 'fulfillment_id_example'; // string | The unique identifier of the fulfillment
$limit = 100; // int | Maximum number of history entries to return per page. When omitted or set to 0, all entries are returned.
$cursor = 'cursor_example'; // string | Opaque pagination cursor returned from a previous request. Pass this value to retrieve the next page of results.

try {
    $result = $apiInstance->getFulfillmentHistory($fulfillment_id, $limit, $cursor);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FulfillmentsApi->getFulfillmentHistory: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **fulfillment_id** | **string**| The unique identifier of the fulfillment | |
| **limit** | **int**| Maximum number of history entries to return per page. When omitted or set to 0, all entries are returned. | [optional] |
| **cursor** | **string**| Opaque pagination cursor returned from a previous request. Pass this value to retrieve the next page of results. | [optional] |

### Return type

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

## `getFulfillmentSummary()`

```php
getFulfillmentSummary($outlet_id, $sale_id, $fulfillment_type, $fulfillment_state, $page_number, $page_size): \Vend\Model\FulfillmentSummaryResponse
```

Get Fulfillments Summary

Retrieves a paginated list of fulfillment summary items with optional filtering

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$outlet_id = ["e058ea02-c565-405f-be27-cefaeeca1f92","aea44f85-b729-448b-bcd4-bd2b8757396f"]; // string[] | Filter by outlet IDs (can be specified multiple times)
$sale_id = ["81b37e5f-aa50-4fe3-95d3-a3cec73a7e2c","81d2fc44-e4d4-4180-8f1e-b36de2acf438"]; // string[] | Filter by sale IDs (can be specified multiple times)
$fulfillment_type = ["PICKUP","DISPATCH"]; // string[] | Filter by fulfillment types (can be specified multiple times)
$fulfillment_state = ["OPEN","STARTED"]; // string[] | Filter by fulfillment states (can be specified multiple times)
$page_number = 1; // int | Page number for pagination (1-based)
$page_size = 20; // int | Number of items per page

try {
    $result = $apiInstance->getFulfillmentSummary($outlet_id, $sale_id, $fulfillment_type, $fulfillment_state, $page_number, $page_size);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FulfillmentsApi->getFulfillmentSummary: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **outlet_id** | [**string[]**](../Model/string.md)| Filter by outlet IDs (can be specified multiple times) | [optional] |
| **sale_id** | [**string[]**](../Model/string.md)| Filter by sale IDs (can be specified multiple times) | [optional] |
| **fulfillment_type** | [**string[]**](../Model/string.md)| Filter by fulfillment types (can be specified multiple times) | [optional] |
| **fulfillment_state** | [**string[]**](../Model/string.md)| Filter by fulfillment states (can be specified multiple times) | [optional] |
| **page_number** | **int**| Page number for pagination (1-based) | [optional] [default to 1] |
| **page_size** | **int**| Number of items per page | [optional] [default to 10] |

### Return type

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

## `postFulfillLineItems()`

```php
postFulfillLineItems($fulfillment_id, $fulfill_line_items_request): \Vend\Model\FulfillLineItemsResponse
```

Fulfill line items within a sale

Fulfills line items for a given sale. This is an idempotent action.  Each line item may optionally include a `source_breakdown`, which specifies how a fulfillment quantity should be sourced. When provided, all three fields are required and must sum to the parent quantity.  🔒 Requires: `sales:write` scope

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$fulfillment_id = 'fulfillment_id_example'; // string | The unique identifier of the fulfillment
$fulfill_line_items_request = new \Vend\Model\FulfillLineItemsRequest(); // \Vend\Model\FulfillLineItemsRequest

try {
    $result = $apiInstance->postFulfillLineItems($fulfillment_id, $fulfill_line_items_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FulfillmentsApi->postFulfillLineItems: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **fulfillment_id** | **string**| The unique identifier of the fulfillment | |
| **fulfill_line_items_request** | [**\Vend\Model\FulfillLineItemsRequest**](../Model/FulfillLineItemsRequest.md)|  | |

### Return type

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

## `postFulfillSale()`

```php
postFulfillSale($fulfill_sale_request): \Vend\Model\FulfillSaleResponse
```

Fulfill a Sale

Completes all fulfillments for a given sale. This is an idempotent action.  🔒 Requires: `sales:write` scope

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$fulfill_sale_request = new \Vend\Model\FulfillSaleRequest(); // \Vend\Model\FulfillSaleRequest

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **fulfill_sale_request** | [**\Vend\Model\FulfillSaleRequest**](../Model/FulfillSaleRequest.md)|  | [optional] |

### Return type

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

## `postPackLineItems()`

```php
postPackLineItems($fulfillment_id, $pack_line_items_request): \Vend\Model\PackLineItemsResponse
```

Partial Pack line items within a sale

Sets pack quantity for line items for a given sale. This is an idempotent action.  Each line item may optionally include a `source_breakdown`, which specifies how a packing quantity should be sourced. When provided, both fields are required and must sum to the parent quantity. Source breakdown is not allowed when the quantity is negative (unpacking).  🔒 Requires: `sales:write` scope

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$fulfillment_id = 'fulfillment_id_example'; // string | The unique identifier of the fulfillment
$pack_line_items_request = new \Vend\Model\PackLineItemsRequest(); // \Vend\Model\PackLineItemsRequest

try {
    $result = $apiInstance->postPackLineItems($fulfillment_id, $pack_line_items_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FulfillmentsApi->postPackLineItems: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **fulfillment_id** | **string**| The unique identifier of the fulfillment | |
| **pack_line_items_request** | [**\Vend\Model\PackLineItemsRequest**](../Model/PackLineItemsRequest.md)|  | |

### Return type

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

## `postPickLineItems()`

```php
postPickLineItems($fulfillment_id, $pick_line_items_request): \Vend\Model\PickLineItemsResponse
```

Partial Pick line items within a sale

Sets pick quantity for line items for a given sale. This is an idempotent action.  🔒 Requires: `sales:write` scope

### Example

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


// Configure Bearer (JWT) authorization: bearerAuth
$config = Vend\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Vend\Api\FulfillmentsApi(
    // 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
);
$fulfillment_id = 'fulfillment_id_example'; // string | The unique identifier of the fulfillment
$pick_line_items_request = new \Vend\Model\PickLineItemsRequest(); // \Vend\Model\PickLineItemsRequest

try {
    $result = $apiInstance->postPickLineItems($fulfillment_id, $pick_line_items_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FulfillmentsApi->postPickLineItems: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **fulfillment_id** | **string**| The unique identifier of the fulfillment | |
| **pick_line_items_request** | [**\Vend\Model\PickLineItemsRequest**](../Model/PickLineItemsRequest.md)|  | |

### Return type

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