# NodeSwaggerApi.AccountTypeApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**createType**](AccountTypeApi.md#createType) | **POST** /bank/account/type | 
[**createTypeImage**](AccountTypeApi.md#createTypeImage) | **POST** /bank/account/type/image | 
[**deleteAccountTypes**](AccountTypeApi.md#deleteAccountTypes) | **DELETE** /bank/account/type/{id} | 
[**getAccountTypes**](AccountTypeApi.md#getAccountTypes) | **GET** /bank/account/type | 
[**updateType**](AccountTypeApi.md#updateType) | **PUT** /bank/account/type | 


<a name="createType"></a>
# **createType**
> PreferredAccountType createType(details)



create account 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.AccountTypeApi();

var details = new NodeSwaggerApi.PreferredAccountType(); // PreferredAccountType | account types details


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **details** | [**PreferredAccountType**](PreferredAccountType.md)| account types details | 

### Return type

[**PreferredAccountType**](PreferredAccountType.md)

### Authorization

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

### HTTP request headers

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

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



create account 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.AccountTypeApi();

var image = "/path/to/file.txt"; // File | account type icon

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

var id = "/path/to/file.txt"; // File | account type id


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **image** | **File**| account type icon | 
 **type** | **File**| image type (thumb, cover) | 
 **id** | **File**| account type 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="deleteAccountTypes"></a>
# **deleteAccountTypes**
> CommonSuccess deleteAccountTypes(id)



Deletes account 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.AccountTypeApi();

var id = "id_example"; // String | account type id


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| account type 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="getAccountTypes"></a>
# **getAccountTypes**
> [PreferredAccountType] getAccountTypes(opts)



Get account types

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

var opts = { 
  'type': "type_example" // String | account type (bank or card)
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **type** | **String**| account type (bank or card) | [optional] 

### Return type

[**[PreferredAccountType]**](PreferredAccountType.md)

### Authorization

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

### HTTP request headers

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

<a name="updateType"></a>
# **updateType**
> CommonSuccess updateType(details)



update account 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.AccountTypeApi();

var details = new NodeSwaggerApi.PreferredAccountType(); // PreferredAccountType | account types details


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **details** | [**PreferredAccountType**](PreferredAccountType.md)| account types details | 

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

