# KykyapiClient.CustomerApi

All URIs are relative to *https://localhost/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createCustomer**](CustomerApi.md#createCustomer) | **POST** /customers | Create customer
[**findCustomer**](CustomerApi.md#findCustomer) | **GET** /customers/{customerId} | Find customer
[**listCustomers**](CustomerApi.md#listCustomers) | **GET** /customers | List customers
[**updateCustomer**](CustomerApi.md#updateCustomer) | **PUT** /customers/{customerId} | Update customer


<a name="createCustomer"></a>
# **createCustomer**
> Customer createCustomer(body)

Create customer

Creates new customer

### Example
```javascript
var KykyapiClient = require('kykyapi-client');
var defaultClient = KykyapiClient.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new KykyapiClient.CustomerApi();

var body = new KykyapiClient.Customer(); // Customer | Payload

apiInstance.createCustomer(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**Customer**](Customer.md)| Payload | 

### Return type

[**Customer**](Customer.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json;charset=utf-8
 - **Accept**: application/json;charset=utf-8

<a name="findCustomer"></a>
# **findCustomer**
> Customer findCustomer(customerId)

Find customer

Returns single customer

### Example
```javascript
var KykyapiClient = require('kykyapi-client');
var defaultClient = KykyapiClient.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new KykyapiClient.CustomerApi();

var customerId = 789; // Number | customer id

apiInstance.findCustomer(customerId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerId** | **Number**| customer id | 

### Return type

[**Customer**](Customer.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json;charset=utf-8
 - **Accept**: application/json;charset=utf-8

<a name="listCustomers"></a>
# **listCustomers**
> [Customer] listCustomers()

List customers

list customers

### Example
```javascript
var KykyapiClient = require('kykyapi-client');
var defaultClient = KykyapiClient.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new KykyapiClient.CustomerApi();
apiInstance.listCustomers().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

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

### Return type

[**[Customer]**](Customer.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json;charset=utf-8
 - **Accept**: application/json;charset=utf-8

<a name="updateCustomer"></a>
# **updateCustomer**
> Customer updateCustomer(customerId, body)

Update customer

Updates a customer

### Example
```javascript
var KykyapiClient = require('kykyapi-client');
var defaultClient = KykyapiClient.ApiClient.instance;

// Configure API key authorization: bearer
var bearer = defaultClient.authentications['bearer'];
bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//bearer.apiKeyPrefix = 'Token';

var apiInstance = new KykyapiClient.CustomerApi();

var customerId = 789; // Number | customer id

var body = new KykyapiClient.Customer(); // Customer | Payload

apiInstance.updateCustomer(customerId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerId** | **Number**| customer id | 
 **body** | [**Customer**](Customer.md)| Payload | 

### Return type

[**Customer**](Customer.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json;charset=utf-8
 - **Accept**: application/json;charset=utf-8

