# Vend202601\SalesApi

Sale 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 |
| ------------- | ------------- | ------------- |
| [**createSale()**](SalesApi.md#createSale) | **POST** /register_sales | Create a sale |
| [**getSaleByID()**](SalesApi.md#getSaleByID) | **GET** /sales/{sale_id} | Get a single sale |
| [**initReturnSale()**](SalesApi.md#initReturnSale) | **PUT** /sales/{sale_id}/actions/return | Return a sale |
| [**listSales()**](SalesApi.md#listSales) | **GET** /sales | List Sales |
| [**updateSale()**](SalesApi.md#updateSale) | **PUT** /register_sales | Update a sale |


## `createSale()`

```php
createSale(): \Vend202601\Model\SaleResponse
```

Create a sale

Creates a new sale.  🔒 Requires: `sales:write` scope  ⚠️ Coming Soon

### 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\SalesApi(
    // 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->createSale();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SalesApi->createSale: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

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

## `getSaleByID()`

```php
getSaleByID($sale_id): \Vend202601\Model\SaleResponse
```

Get a single sale

Returns a single sale with a given ID.  🔒 Requires: `sales: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\SalesApi(
    // 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
);
$sale_id = 'sale_id_example'; // string | A valid sale ID.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **sale_id** | **string**| A valid sale ID. | |

### Return type

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

## `initReturnSale()`

```php
initReturnSale($sale_id): \Vend202601\Model\SaleResponse
```

Return a sale

Initializes a return on a given sale ID and returns the SAVED return. See [the tutorial](/docs/sales_returns) for more information.  🔒 Requires: `sales:write` `users:read` 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\SalesApi(
    // 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
);
$sale_id = 'sale_id_example'; // string | A valid sale ID.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **sale_id** | **string**| A valid sale ID. | |

### Return type

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

## `listSales()`

```php
listSales($after, $before, $page_size): \Vend202601\Model\SaleCollection
```

List Sales

Returns a paginated list of sales.  To search for sales, please have a look at our [Search endpoint](/reference/search-1) on what is supported.  🔒 Requires: `sales: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\SalesApi(
    // 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 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->listSales($after, $before, $page_size);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SalesApi->listSales: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **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\SaleCollection**](../Model/SaleCollection.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)

## `updateSale()`

```php
updateSale(): \Vend202601\Model\SaleResponse
```

Update a sale

Update an existing sale.  🔒 Requires: `sales:write` scope  ⚠️ Coming Soon

### 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\SalesApi(
    // 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->updateSale();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SalesApi->updateSale: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

This endpoint does not need any parameter.

### Return type

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