# NodeSwaggerApi.CountryCodeApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**availableCountries**](CountryCodeApi.md#availableCountries) | **GET** /country | 
[**createCountryCode**](CountryCodeApi.md#createCountryCode) | **POST** /country | 
[**deleteCode**](CountryCodeApi.md#deleteCode) | **DELETE** /country/{id} | 
[**updateCountryCode**](CountryCodeApi.md#updateCountryCode) | **PUT** /country | 


<a name="availableCountries"></a>
# **availableCountries**
> [CountryCode] availableCountries(status)



Get all country codes filtering by status

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

var status = 8.14; // Number | gets all countries according to status


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **status** | **Number**| gets all countries according to status | 

### Return type

[**[CountryCode]**](CountryCode.md)

### Authorization

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

### HTTP request headers

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

<a name="createCountryCode"></a>
# **createCountryCode**
> [CountryCode] createCountryCode(codes)



Create country code

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

var apiInstance = new NodeSwaggerApi.CountryCodeApi();

var codes = [new NodeSwaggerApi.CountryCode()]; // [CountryCode] | list of country codes


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **codes** | [**[CountryCode]**](CountryCode.md)| list of country codes | 

### Return type

[**[CountryCode]**](CountryCode.md)

### Authorization

No authorization required

### HTTP request headers

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

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



Deletes a country code

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

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| version 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="updateCountryCode"></a>
# **updateCountryCode**
> [CountryCode] updateCountryCode(code)



Updates a country code

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

var code = new NodeSwaggerApi.CountryCode(); // CountryCode | country code to update


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **code** | [**CountryCode**](CountryCode.md)| country code to update | 

### Return type

[**[CountryCode]**](CountryCode.md)

### Authorization

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

### HTTP request headers

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

