# Vend\CustomersApi

Customer 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 |
| ------------- | ------------- | ------------- |
| [**createCustomer()**](CustomersApi.md#createCustomer) | **POST** /customers | Create a new customer |
| [**deleteCustomerByID()**](CustomersApi.md#deleteCustomerByID) | **DELETE** /customers/{customer_id} | Delete a customer |
| [**getCustomerByID()**](CustomersApi.md#getCustomerByID) | **GET** /customers/{customer_id} | Get a single customer |
| [**listCustomers()**](CustomersApi.md#listCustomers) | **GET** /customers | List customers |
| [**updateCustomerByID()**](CustomersApi.md#updateCustomerByID) | **PUT** /customers/{customer_id} | Update a customer |


## `createCustomer()`

```php
createCustomer($customer_base): \Vend\Model\CustomerResponse
```

Create a new customer

Creates a new customer.  🔒 Requires: `customers: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\CustomersApi(
    // 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_base = new \Vend\Model\CustomerBase(); // \Vend\Model\CustomerBase

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_base** | [**\Vend\Model\CustomerBase**](../Model/CustomerBase.md)|  | |

### Return type

[**\Vend\Model\CustomerResponse**](../Model/CustomerResponse.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`, `new`

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

## `deleteCustomerByID()`

```php
deleteCustomerByID($customer_id)
```

Delete a customer

Deletes the customer with the requested ID.  🔒 Requires: `customers: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\CustomersApi(
    // 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

try {
    $apiInstance->deleteCustomerByID($customer_id);
} catch (Exception $e) {
    echo 'Exception when calling CustomersApi->deleteCustomerByID: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The customer 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)

## `getCustomerByID()`

```php
getCustomerByID($customer_id): \Vend\Model\CustomerResponse
```

Get a single customer

Returns a single customer with a requested ID.  🔒 Requires: `customers: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\CustomersApi(
    // 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

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The customer id | |

### Return type

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

## `listCustomers()`

```php
listCustomers($after, $before, $page_size, $deleted): \Vend\Model\CustomerCollection
```

List customers

Returns a paginated list of customers.  To search for customers, please have a look at our [Search endpoint](/reference/search-1) on what is supported.  🔒 Requires: `customers: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\CustomersApi(
    // 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.
$deleted = True; // bool | Indicates whether deleted items should be included in the response.

try {
    $result = $apiInstance->listCustomers($after, $before, $page_size, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CustomersApi->listCustomers: ', $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] |
| **deleted** | **bool**| Indicates whether deleted items should be included in the response. | [optional] |

### Return type

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

## `updateCustomerByID()`

```php
updateCustomerByID($customer_id, $customer_base): \Vend\Model\CustomerResponse
```

Update a customer

Updates the customer with the requested ID.  🔒 Requires: `customers: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\CustomersApi(
    // 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
$customer_base = new \Vend\Model\CustomerBase(); // \Vend\Model\CustomerBase

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The customer id | |
| **customer_base** | [**\Vend\Model\CustomerBase**](../Model/CustomerBase.md)|  | |

### Return type

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