# NodeSwaggerApi.MerchantProfileApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteMerchant**](MerchantProfileApi.md#deleteMerchant) | **DELETE** /admin/merchants/{id} | 
[**getMerchantDetailsById**](MerchantProfileApi.md#getMerchantDetailsById) | **GET** /admin/merchants/{id} | 
[**getMerchantsDetails**](MerchantProfileApi.md#getMerchantsDetails) | **GET** /admin/merchants | 
[**saveMerchant**](MerchantProfileApi.md#saveMerchant) | **POST** /admin/merchants | 
[**updateMerchant**](MerchantProfileApi.md#updateMerchant) | **PUT** /admin/merchants | 
[**updateMerchantImage**](MerchantProfileApi.md#updateMerchantImage) | **PUT** /admin/merchants/image | 


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



Deletes a Merchant profile

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

var id = "id_example"; // String | if you want delete specific Merchant profile you want to give Merchant profile id


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| if you want delete specific Merchant profile you want to give Merchant profile id | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getMerchantDetailsById"></a>
# **getMerchantDetailsById**
> MerchantProfile getMerchantDetailsById(id)



Returns Merchant profile details according to the id

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

var id = "id_example"; // String | if you want specific Merchant profile you want to give Merchant profile id


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| if you want specific Merchant profile you want to give Merchant profile id | 

### Return type

[**MerchantProfile**](MerchantProfile.md)

### Authorization

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

### HTTP request headers

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

<a name="getMerchantsDetails"></a>
# **getMerchantsDetails**
> MerchantProfile getMerchantsDetails()



Returns Merchant profile details

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

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

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

### Return type

[**MerchantProfile**](MerchantProfile.md)

### Authorization

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

### HTTP request headers

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

<a name="saveMerchant"></a>
# **saveMerchant**
> MerchantProfile saveMerchant(merchantProfileDetails)



Save Merchant profile

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

var merchantProfileDetails = new NodeSwaggerApi.MerchantProfile(); // MerchantProfile | Merchant profile details


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **merchantProfileDetails** | [**MerchantProfile**](MerchantProfile.md)| Merchant profile details | 

### Return type

[**MerchantProfile**](MerchantProfile.md)

### Authorization

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

### HTTP request headers

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

<a name="updateMerchant"></a>
# **updateMerchant**
> updateMerchant(opts)



Updates a single Merchant profile

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

var opts = { 
  'body': new NodeSwaggerApi.MerchantProfile() // MerchantProfile | Updated Merchant profile object
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**MerchantProfile**](MerchantProfile.md)| Updated Merchant profile object | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

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



Add or update merchant (thumb/cover) 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.MerchantProfileApi();

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

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **image** | **File**| image path | 
 **type** | **File**| image type (thumb, cover) | 
 **id** | **File**| merchant id | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

