# NodeSwaggerApi.PayeeCategoryApi

All URIs are relative to *https://api.supremepay.lk:3011/api/admin*

Method | HTTP request | Description
------------- | ------------- | -------------
[**availableCategories**](PayeeCategoryApi.md#availableCategories) | **GET** /paying/categories | 
[**createPayingCateogory**](PayeeCategoryApi.md#createPayingCateogory) | **POST** /paying/categories | 
[**createPayingCateogoryImage**](PayeeCategoryApi.md#createPayingCateogoryImage) | **POST** /paying/categories/image | 
[**deletePayingCategory**](PayeeCategoryApi.md#deletePayingCategory) | **DELETE** /paying/categories/{id} | 
[**updatePayingCateogory**](PayeeCategoryApi.md#updatePayingCateogory) | **PUT** /paying/categories | 


<a name="availableCategories"></a>
# **availableCategories**
> [PayeeCategory] availableCategories(type)



Get all paying categories filtering by type

### Example
```javascript
var NodeSwaggerApi = require('node_swagger_api');
var defaultClient = NodeSwaggerApi.ApiClient.instance;

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

var apiInstance = new NodeSwaggerApi.PayeeCategoryApi();

var type = 8.14; // Number | gets all categories according to type


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.availableCategories(type, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **type** | **Number**| gets all categories according to type | 

### Return type

[**[PayeeCategory]**](PayeeCategory.md)

### Authorization

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

### HTTP request headers

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

<a name="createPayingCateogory"></a>
# **createPayingCateogory**
> PayeeCategory createPayingCateogory(categoryType, name)



Create paying category

### Example
```javascript
var NodeSwaggerApi = require('node_swagger_api');

var apiInstance = new NodeSwaggerApi.PayeeCategoryApi();

var categoryType = "categoryType_example"; // String | The type of the paying category

var name = "name_example"; // String | The name of the paying category


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createPayingCateogory(categoryType, name, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **categoryType** | **String**| The type of the paying category | 
 **name** | **String**| The name of the paying category | 

### Return type

[**PayeeCategory**](PayeeCategory.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json, application/xml

<a name="createPayingCateogoryImage"></a>
# **createPayingCateogoryImage**
> CommonSuccess createPayingCateogoryImage(image, type, id)



create paying category image

### Example
```javascript
var NodeSwaggerApi = require('node_swagger_api');
var defaultClient = NodeSwaggerApi.ApiClient.instance;

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

var apiInstance = new NodeSwaggerApi.PayeeCategoryApi();

var image = "/path/to/file.txt"; // File | paying category icon

var type = "/path/to/file.txt"; // File | image type (thumb, cover)

var id = "/path/to/file.txt"; // File | paying category id


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.createPayingCateogoryImage(image, type, id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **image** | **File**| paying category icon | 
 **type** | **File**| image type (thumb, cover) | 
 **id** | **File**| paying category id | 

### Return type

[**CommonSuccess**](CommonSuccess.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json, application/xml

<a name="deletePayingCategory"></a>
# **deletePayingCategory**
> CommonSuccess deletePayingCategory(id)



Deletes a paying category

### Example
```javascript
var NodeSwaggerApi = require('node_swagger_api');
var defaultClient = NodeSwaggerApi.ApiClient.instance;

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

var apiInstance = new NodeSwaggerApi.PayeeCategoryApi();

var id = "id_example"; // String | category id


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.deletePayingCategory(id, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| category id | 

### Return type

[**CommonSuccess**](CommonSuccess.md)

### Authorization

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

### HTTP request headers

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

<a name="updatePayingCateogory"></a>
# **updatePayingCateogory**
> PayeeCategory updatePayingCateogory()



Updates a paying category

### Example
```javascript
var NodeSwaggerApi = require('node_swagger_api');
var defaultClient = NodeSwaggerApi.ApiClient.instance;

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

var apiInstance = new NodeSwaggerApi.PayeeCategoryApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updatePayingCateogory(callback);
```

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

### Return type

[**PayeeCategory**](PayeeCategory.md)

### Authorization

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

### HTTP request headers

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

