# openapi.api.CustomersPreviewApi

## Load the API package
```dart
import 'package:openapi/api.dart';
```

All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**changeDefaultAddress**](CustomersPreviewApi.md#changedefaultaddress) | **PATCH** /api/customers/preview/address/{addressId}/default | Update customer default address
[**deleteAccount**](CustomersPreviewApi.md#deleteaccount) | **DELETE** /api/customers/preview | Delete customers
[**getCustomer**](CustomersPreviewApi.md#getcustomer) | **GET** /api/customers/preview | 
[**getCustomerTest**](CustomersPreviewApi.md#getcustomertest) | **GET** /api/customers/preview/test/{id} | 
[**update**](CustomersPreviewApi.md#update) | **PUT** /api/customers/preview | Update a customer


# **changeDefaultAddress**
> MessageResponseApiProperty changeDefaultAddress(addressId)

Update customer default address

### Example
```dart
import 'package:openapi/api.dart';

final api = Openapi().getCustomersPreviewApi();
final num addressId = 1; // num | ID of customer address

try {
    final response = api.changeDefaultAddress(addressId);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CustomersPreviewApi->changeDefaultAddress: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **addressId** | **num**| ID of customer address | 

### Return type

[**MessageResponseApiProperty**](MessageResponseApiProperty.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

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

# **deleteAccount**
> MessageResponseApiProperty deleteAccount()

Delete customers

### Example
```dart
import 'package:openapi/api.dart';

final api = Openapi().getCustomersPreviewApi();

try {
    final response = api.deleteAccount();
    print(response);
} catch on DioError (e) {
    print('Exception when calling CustomersPreviewApi->deleteAccount: $e\n');
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**MessageResponseApiProperty**](MessageResponseApiProperty.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

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

# **getCustomer**
> CustomerEntity getCustomer()



### Example
```dart
import 'package:openapi/api.dart';

final api = Openapi().getCustomersPreviewApi();

try {
    final response = api.getCustomer();
    print(response);
} catch on DioError (e) {
    print('Exception when calling CustomersPreviewApi->getCustomer: $e\n');
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**CustomerEntity**](CustomerEntity.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

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

# **getCustomerTest**
> CustomerEntity getCustomerTest(id)



### Example
```dart
import 'package:openapi/api.dart';

final api = Openapi().getCustomersPreviewApi();
final num id = 8.14; // num | 

try {
    final response = api.getCustomerTest(id);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CustomersPreviewApi->getCustomerTest: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **num**|  | 

### Return type

[**CustomerEntity**](CustomerEntity.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

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

# **update**
> MessageResponseApiProperty update(updateCustomerBody)

Update a customer

### Example
```dart
import 'package:openapi/api.dart';

final api = Openapi().getCustomersPreviewApi();
final UpdateCustomerBody updateCustomerBody = ; // UpdateCustomerBody | 

try {
    final response = api.update(updateCustomerBody);
    print(response);
} catch on DioError (e) {
    print('Exception when calling CustomersPreviewApi->update: $e\n');
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **updateCustomerBody** | [**UpdateCustomerBody**](UpdateCustomerBody.md)|  | 

### Return type

[**MessageResponseApiProperty**](MessageResponseApiProperty.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

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

