# 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 |
| [**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 |
| [**listServiceItems()**](ServiceOrdersApi.md#listServiceItems) | **GET** /service_items/customer/{customer_id} | List a customer&#39;s service items |
| [**listServices()**](ServiceOrdersApi.md#listServices) | **GET** /services | List services |


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

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

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

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