# Vend202601\ServiceOrdersApi



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 |
| ------------- | ------------- | ------------- |
| [**createService()**](ServiceOrdersApi.md#createService) | **POST** /services | Create a service order |
| [**createServiceStatus()**](ServiceOrdersApi.md#createServiceStatus) | **POST** /service_statuses | Create a service status |
| [**deleteServiceStatus()**](ServiceOrdersApi.md#deleteServiceStatus) | **DELETE** /service_statuses/{id} | Delete a service status |
| [**getAgendaOutletId()**](ServiceOrdersApi.md#getAgendaOutletId) | **GET** /services_agenda/outlet/{outlet_id} | Get services agenda by outlet |
| [**getService()**](ServiceOrdersApi.md#getService) | **GET** /services/{service_id} | Get service |
| [**getServiceStatus()**](ServiceOrdersApi.md#getServiceStatus) | **GET** /service_statuses/{id} | Get a service status |
| [**listServiceItems()**](ServiceOrdersApi.md#listServiceItems) | **GET** /service_items/customer/{customer_id} | List a customer&#39;s service items |
| [**listServiceStatuses()**](ServiceOrdersApi.md#listServiceStatuses) | **GET** /service_statuses | List service statuses |
| [**listServices()**](ServiceOrdersApi.md#listServices) | **GET** /services | List services |
| [**updateServiceStatus()**](ServiceOrdersApi.md#updateServiceStatus) | **PATCH** /service_statuses/{id} | Update a service status |


## `createService()`

```php
createService($service_order_request): \Vend202601\Model\DetailedService
```

Create a service order

**Only available with the Service Orders module enabled.**  Creates a new service order. This endpoint allows you to create service orders with a customer, a service item, note and location.  🔒 Requires: `services:write` `sales:write` scopes

### 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\ServiceOrdersApi(
    // 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
);
$service_order_request = new \Vend202601\Model\ServiceOrderRequest(); // \Vend202601\Model\ServiceOrderRequest

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

### Parameters

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

### Return type

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

## `createServiceStatus()`

```php
createServiceStatus($create_service_status_request): \Vend202601\Model\ServiceStatusDetails
```

Create a service status

Creates a new custom service status for the retailer. The new status is appended at the end of the display order. Use the PATCH endpoint to change its position after creation.  **Only available with the Service Orders module enabled.**  🔒 Requires: `services:write` 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\ServiceOrdersApi(
    // 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
);
$create_service_status_request = new \Vend202601\Model\CreateServiceStatusRequest(); // \Vend202601\Model\CreateServiceStatusRequest

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

### Parameters

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

### Return type

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

## `deleteServiceStatus()`

```php
deleteServiceStatus($id)
```

Delete a service status

Deletes a custom service status.  System default statuses cannot be deleted. A status cannot be deleted if it is still assigned to one or more service orders.  **Only available with the Service Orders module enabled.**  🔒 Requires: `services:write` 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\ServiceOrdersApi(
    // 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
);
$id = 'id_example'; // string | ID of the service status

try {
    $apiInstance->deleteServiceStatus($id);
} catch (Exception $e) {
    echo 'Exception when calling ServiceOrdersApi->deleteServiceStatus: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ID of the service status | |

### Return type

void (empty response body)

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

## `getAgendaOutletId()`

```php
getAgendaOutletId($start_date, $outlet_id, $days, $timezone): \Vend202601\Model\DailyAgenda[]
```

Get services agenda by outlet

Returns the service agenda for the specified outlet within the given time window.  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);
$start_date = 2017-07-21T17:32:28Z; // \DateTime | The first date of the time window for which the agenda is requested.
$outlet_id = 'outlet_id_example'; // string
$days = 31; // int | The size, in days, of the time window for which the agenda is requested.
$timezone = America/New_York; // string | The timezone in which the agenda is requested. When provided, the agenda returned will account for time changes like daylight savings.

try {
    $result = $apiInstance->getAgendaOutletId($start_date, $outlet_id, $days, $timezone);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ServiceOrdersApi->getAgendaOutletId: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **start_date** | **\DateTime**| The first date of the time window for which the agenda is requested. | |
| **outlet_id** | **string**|  | |
| **days** | **int**| The size, in days, of the time window for which the agenda is requested. | [optional] [default to 7] |
| **timezone** | **string**| The timezone in which the agenda is requested. When provided, the agenda returned will account for time changes like daylight savings. | [optional] |

### Return type

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

## `getService()`

```php
getService($service_id): \Vend202601\Model\DetailedService
```

Get service

Get a single service order.  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);
$service_id = 'service_id_example'; // string | ID of the service to get

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **service_id** | **string**| ID of the service to get | |

### Return type

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

## `getServiceStatus()`

```php
getServiceStatus($id): \Vend202601\Model\ServiceStatusDetails
```

Get a service status

Returns a single service status by ID.  **Only available with the Service Orders module enabled.**  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);
$id = 'id_example'; // string | ID of the service status

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ID of the service status | |

### Return type

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

## `listServiceItems()`

```php
listServiceItems($customer_id, $after, $limit): \Vend202601\Model\ListServiceItems200Response
```

List a customer's service items

Returns a paginated list of customer's service items.  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);
$customer_id = 'customer_id_example'; // string | The customer id
$after = 56; // int | The lower limit for the service id to be included in the response. For proper pagination, it needs to be the item id of the last item in the response from your previous request.
$limit = 100; // int | The maximum number of items to be returned in the response.

try {
    $result = $apiInstance->listServiceItems($customer_id, $after, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ServiceOrdersApi->listServiceItems: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The customer id | |
| **after** | **int**| The lower limit for the service id to be included in the response. For proper pagination, it needs to be the item id of the last item in the response from your previous request. | [optional] |
| **limit** | **int**| The maximum number of items to be returned in the response. | [optional] [default to 100] |

### Return type

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

## `listServiceStatuses()`

```php
listServiceStatuses(): \Vend202601\Model\ServiceStatusDetails[]
```

List service statuses

Returns all service statuses for the retailer, including system defaults and custom ones.  **Only available with the Service Orders module enabled.**  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);

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

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `listServices()`

```php
listServices($after, $limit): \Vend202601\Model\ListServices200Response
```

List services

Returns a paginated list of services.  🔒 Requires: `services: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\ServiceOrdersApi(
    // 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
);
$after = 56; // int | The lower limit for the service id to be included in the response. For proper pagination, it needs to be the service id of the last item in the response from your previous request.
$limit = 100; // int | The maximum number of items to be returned in the response.

try {
    $result = $apiInstance->listServices($after, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ServiceOrdersApi->listServices: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **after** | **int**| The lower limit for the service id to be included in the response. For proper pagination, it needs to be the service id of the last item in the response from your previous request. | [optional] |
| **limit** | **int**| The maximum number of items to be returned in the response. | [optional] [default to 100] |

### Return type

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

## `updateServiceStatus()`

```php
updateServiceStatus($id, $update_service_status_request): \Vend202601\Model\ServiceStatusDetails
```

Update a service status

Partially updates a custom service status. Only provided fields are updated.  System default statuses cannot be modified.  **Only available with the Service Orders module enabled.**  🔒 Requires: `services:write` 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\ServiceOrdersApi(
    // 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
);
$id = 'id_example'; // string | ID of the service status
$update_service_status_request = new \Vend202601\Model\UpdateServiceStatusRequest(); // \Vend202601\Model\UpdateServiceStatusRequest

try {
    $result = $apiInstance->updateServiceStatus($id, $update_service_status_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ServiceOrdersApi->updateServiceStatus: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ID of the service status | |
| **update_service_status_request** | [**\Vend202601\Model\UpdateServiceStatusRequest**](../Model/UpdateServiceStatusRequest.md)|  | |

### Return type

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