# CymbioApi.ProductApi

All URIs are relative to *http://api1.cym.bio/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteProducts**](ProductApi.md#deleteProducts) | **DELETE** /products | Deletes a store product
[**getProductAvailable**](ProductApi.md#getProductAvailable) | **GET** /products/available | Checks if this product is available
[**getProducts**](ProductApi.md#getProducts) | **GET** /products | Retrieves store products
[**getProductsCount**](ProductApi.md#getProductsCount) | **GET** /products/count | Returns the product count for a store
[**postProducts**](ProductApi.md#postProducts) | **POST** /products | Saves a store product


<a name="deleteProducts"></a>
# **deleteProducts**
> InlineResponse2001 deleteProducts(idInStore)

Deletes a store product

Deletes a store product by it&#39;s id in the store

### Example
```javascript
var CymbioApi = require('cymbio_api');
var defaultClient = CymbioApi.ApiClient.default;

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

var apiInstance = new CymbioApi.ProductApi();

var idInStore = 56; // Integer | The id of the product in the store


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **idInStore** | **Integer**| The id of the product in the store | 

### Return type

[**InlineResponse2001**](InlineResponse2001.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="getProductAvailable"></a>
# **getProductAvailable**
> InlineResponse2004 getProductAvailable(id, opts)

Checks if this product is available

### Example
```javascript
var CymbioApi = require('cymbio_api');
var defaultClient = CymbioApi.ApiClient.default;

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

var apiInstance = new CymbioApi.ProductApi();

var id = "id_example"; // String | The product id

var opts = { 
  'variantId': "variantId_example" // String | The product variant id
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **String**| The product id | 
 **variantId** | **String**| The product variant id | [optional] 

### Return type

[**InlineResponse2004**](InlineResponse2004.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json

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

Retrieves store products

Retrieves the store&#39;s products

### Example
```javascript
var CymbioApi = require('cymbio_api');
var defaultClient = CymbioApi.ApiClient.default;

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

var apiInstance = new CymbioApi.ProductApi();

var opts = { 
  'limit': 10, // Integer | Limits the number of returned products per page
  'page': 1, // Integer | Page number to retrieve
  'fields': "fields_example", // String | CSV of product fields to retrieve
  'query': "query_example" // String | Searches for products with the supplied query in their title
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **Integer**| Limits the number of returned products per page | [optional] [default to 10]
 **page** | **Integer**| Page number to retrieve | [optional] [default to 1]
 **fields** | **String**| CSV of product fields to retrieve | [optional] 
 **query** | **String**| Searches for products with the supplied query in their title | [optional] 

### Return type

[**InlineResponse2002**](InlineResponse2002.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json

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

Returns the product count for a store

### Example
```javascript
var CymbioApi = require('cymbio_api');
var defaultClient = CymbioApi.ApiClient.default;

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

var apiInstance = new CymbioApi.ProductApi();

var opts = { 
  'query': "query_example" // String | Searches for products with the supplied query in their title
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **query** | **String**| Searches for products with the supplied query in their title | [optional] 

### Return type

[**InlineResponse2005**](InlineResponse2005.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json

<a name="postProducts"></a>
# **postProducts**
> InlineResponse2003 postProducts(product)

Saves a store product

Saves a new store product

### Example
```javascript
var CymbioApi = require('cymbio_api');
var defaultClient = CymbioApi.ApiClient.default;

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

var apiInstance = new CymbioApi.ProductApi();

var product = new CymbioApi.NewProduct(); // NewProduct | The product to save


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product** | [**NewProduct**](NewProduct.md)| The product to save | 

### Return type

[**InlineResponse2003**](InlineResponse2003.md)

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json, application/x-www-form-urlencoded
 - **Accept**: application/json

