# KykyapiClient.CustomerRepresentativeApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**createCustomerRepresentative**](CustomerRepresentativeApi.md#createCustomerRepresentative) | **POST** /customerRepresentatives | Create customer representative
[**deleteCustomerRepresentative**](CustomerRepresentativeApi.md#deleteCustomerRepresentative) | **DELETE** /customerRepresentatives/{customerRepresentativeId} | Delete customer representative
[**findCustomerRepresentative**](CustomerRepresentativeApi.md#findCustomerRepresentative) | **GET** /customerRepresentatives/{customerRepresentativeId} | Find customer representative
[**listCustomerRepresentatives**](CustomerRepresentativeApi.md#listCustomerRepresentatives) | **GET** /customerRepresentatives | List customer representatives
[**updateCustomerRepresentative**](CustomerRepresentativeApi.md#updateCustomerRepresentative) | **PUT** /customerRepresentatives/{customerRepresentativeId} | Update customer representative


<a name="createCustomerRepresentative"></a>
# **createCustomerRepresentative**
> CustomerRepresentative createCustomerRepresentative(body)

Create customer representative

Creates new customer representative

### 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.CustomerRepresentativeApi();

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

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

```

### Parameters

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

### Return type

[**CustomerRepresentative**](CustomerRepresentative.md)

### Authorization

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

### HTTP request headers

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

<a name="deleteCustomerRepresentative"></a>
# **deleteCustomerRepresentative**
> deleteCustomerRepresentative(customerRepresentativeId)

Delete customer representative

deletes single customer representative

### 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.CustomerRepresentativeApi();

var customerRepresentativeId = 789; // Number | customer representative id

apiInstance.deleteCustomerRepresentative(customerRepresentativeId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerRepresentativeId** | **Number**| customer representative id | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="findCustomerRepresentative"></a>
# **findCustomerRepresentative**
> CustomerRepresentative findCustomerRepresentative(customerRepresentativeId)

Find customer representative

Returns single customer representative

### 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.CustomerRepresentativeApi();

var customerRepresentativeId = 789; // Number | customer representative id

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerRepresentativeId** | **Number**| customer representative id | 

### Return type

[**CustomerRepresentative**](CustomerRepresentative.md)

### Authorization

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

### HTTP request headers

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

<a name="listCustomerRepresentatives"></a>
# **listCustomerRepresentatives**
> [CustomerRepresentative] listCustomerRepresentatives(opts)

List customer representatives

list customer representatives

### 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.CustomerRepresentativeApi();

var opts = { 
  'customerOrganizationId': 789 // Number | filter by customer organization id
};
apiInstance.listCustomerRepresentatives(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerOrganizationId** | **Number**| filter by customer organization id | [optional] 

### Return type

[**[CustomerRepresentative]**](CustomerRepresentative.md)

### Authorization

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

### HTTP request headers

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

<a name="updateCustomerRepresentative"></a>
# **updateCustomerRepresentative**
> CustomerRepresentative updateCustomerRepresentative(customerRepresentativeId, body)

Update customer representative

Updates a customer representative

### 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.CustomerRepresentativeApi();

var customerRepresentativeId = 789; // Number | customer representative id

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

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

```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **customerRepresentativeId** | **Number**| customer representative id | 
 **body** | [**CustomerRepresentative**](CustomerRepresentative.md)| Payload | 

### Return type

[**CustomerRepresentative**](CustomerRepresentative.md)

### Authorization

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

### HTTP request headers

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

