# Vend202601\CustomerAddressesApi



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 |
| ------------- | ------------- | ------------- |
| [**createCustomerAddress()**](CustomerAddressesApi.md#createCustomerAddress) | **POST** /customers/{customer_id}/addresses | Create a new address for a customer |
| [**deleteCustomerAddress()**](CustomerAddressesApi.md#deleteCustomerAddress) | **DELETE** /customers/{customer_id}/addresses/{address_id} | Delete an address |
| [**getCustomerAddress()**](CustomerAddressesApi.md#getCustomerAddress) | **GET** /customers/{customer_id}/addresses/{address_id} | Get a single address |
| [**listCustomerAddresses()**](CustomerAddressesApi.md#listCustomerAddresses) | **GET** /customers/{customer_id}/addresses | List all addresses for a customer |
| [**updateCustomerAddress()**](CustomerAddressesApi.md#updateCustomerAddress) | **PUT** /customers/{customer_id}/addresses/{address_id} | Update an address |


## `createCustomerAddress()`

```php
createCustomerAddress($customer_id, $body): \Vend202601\Model\CustomerAddressCreateResponse
```

Create a new address for a customer

Creates a new address for the specified customer.  **Validation Rules:** - `country_code`: Required, must be a valid ISO 3166-1 alpha-2 code (e.g., US, NZ, AU) - `state_code`: Required for US and CA, must be valid for the country - `postcode`: Required, must be valid format for the country - `type`: Required, must be either BILLING or SHIPPING - `address_line_1`: Required, maximum 50 characters - `city`: Required, maximum 28 characters - `state`: Maximum 35 characters  🔒 Requires: `customers: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\CustomerAddressesApi(
    // 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 unique identifier of the customer.
$body = {"address_line_1":"123 Main Street","address_line_2":"Suite 100","city":"Auckland","country_code":"NZ","postcode":"1010","state":"Auckland","state_code":"AUK","suburb":"Downtown","type":"BILLING"}; // \Vend202601\Model\CustomerAddressBase

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The unique identifier of the customer. | |
| **body** | [**\Vend202601\Model\CustomerAddressBase**](../Model/CustomerAddressBase.md)|  | |

### Return type

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

## `deleteCustomerAddress()`

```php
deleteCustomerAddress($customer_id, $address_id)
```

Delete an address

Deletes an address for the specified customer.  🔒 Requires: `customers: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\CustomerAddressesApi(
    // 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 unique identifier of the customer.
$address_id = 56; // int | The unique identifier of the address.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The unique identifier of the customer. | |
| **address_id** | **int**| The unique identifier of the address. | |

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

## `getCustomerAddress()`

```php
getCustomerAddress($customer_id, $address_id): \Vend202601\Model\CustomerAddressResponse
```

Get a single address

Returns a single address by its ID for the specified customer.  🔒 Requires: `customers: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\CustomerAddressesApi(
    // 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 unique identifier of the customer.
$address_id = 56; // int | The unique identifier of the address.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The unique identifier of the customer. | |
| **address_id** | **int**| The unique identifier of the address. | |

### Return type

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

## `listCustomerAddresses()`

```php
listCustomerAddresses($customer_id): \Vend202601\Model\CustomerAddressCollection
```

List all addresses for a customer

Returns a list of all addresses associated with the specified customer.  🔒 Requires: `customers: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\CustomerAddressesApi(
    // 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 unique identifier of the customer.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The unique identifier of the customer. | |

### Return type

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

## `updateCustomerAddress()`

```php
updateCustomerAddress($customer_id, $address_id, $body): \Vend202601\Model\CustomerAddressResponse
```

Update an address

Updates an existing address for the specified customer.  **Validation Rules:** - `country_code`: Required, must be a valid ISO 3166-1 alpha-2 code (e.g., US, NZ, AU) - `state_code`: Required for US and CA, must be valid for the country - `postcode`: Required, must be valid format for the country - `type`: Required, must be either BILLING or SHIPPING - `address_line_1`: Required, maximum 50 characters - `city`: Required, maximum 28 characters - `state`: Maximum 35 characters  🔒 Requires: `customers: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\CustomerAddressesApi(
    // 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 unique identifier of the customer.
$address_id = 56; // int | The unique identifier of the address.
$body = {"address_line_1":"456 Updated Avenue","address_line_2":"Floor 2","city":"Wellington","country_code":"NZ","postcode":"6011","state":"Wellington","state_code":"WGN","suburb":"Midtown","type":"SHIPPING"}; // \Vend202601\Model\CustomerAddressBase

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_id** | **string**| The unique identifier of the customer. | |
| **address_id** | **int**| The unique identifier of the address. | |
| **body** | [**\Vend202601\Model\CustomerAddressBase**](../Model/CustomerAddressBase.md)|  | |

### Return type

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