# NomadEnvoyCli.ProductApi

All URIs are relative to *https://nomad.samarkand-global.cn/envoy*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addProduct**](ProductApi.md#addProduct) | **POST** /product/{store} | addProduct
[**deleteProduct**](ProductApi.md#deleteProduct) | **DELETE** /product/{store} | deleteProduct
[**getProductsByField**](ProductApi.md#getProductsByField) | **GET** /product/{store} | getProductsByField
[**updateProduct**](ProductApi.md#updateProduct) | **PUT** /product/{store} | updateProduct



## addProduct

> ProductApiResponse addProduct(store, opts)

addProduct

Adds a product to store listing.

### Example

```javascript
var NomadEnvoyCli = require('nomad_envoy_cli');
var defaultClient = NomadEnvoyCli.ApiClient.instance;
// Configure API key authorization: ca_key
var ca_key = defaultClient.authentications['ca_key'];
ca_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_key.apiKeyPrefix = 'Token';
// Configure API key authorization: ca_stage
var ca_stage = defaultClient.authentications['ca_stage'];
ca_stage.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_stage.apiKeyPrefix = 'Token';

var apiInstance = new NomadEnvoyCli.ProductApi();
var store = "store_example"; // String | Add product to store.
var opts = {
  'product': new NomadEnvoyCli.Product() // Product | Product details
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.addProduct(store, opts, callback);
```

### Parameters



Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **store** | **String**| Add product to store. | 
 **product** | [**Product**](Product.md)| Product details | [optional] 

### Return type

[**ProductApiResponse**](ProductApiResponse.md)

### Authorization

[ca_key](../README.md#ca_key), [ca_stage](../README.md#ca_stage)

### HTTP request headers

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


## deleteProduct

> ProductApiResponse deleteProduct(store, productId)

deleteProduct

Remove a product from this store.

### Example

```javascript
var NomadEnvoyCli = require('nomad_envoy_cli');
var defaultClient = NomadEnvoyCli.ApiClient.instance;
// Configure API key authorization: ca_key
var ca_key = defaultClient.authentications['ca_key'];
ca_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_key.apiKeyPrefix = 'Token';
// Configure API key authorization: ca_stage
var ca_stage = defaultClient.authentications['ca_stage'];
ca_stage.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_stage.apiKeyPrefix = 'Token';

var apiInstance = new NomadEnvoyCli.ProductApi();
var store = "store_example"; // String | Store that lists products.
var productId = "productId_example"; // String | ID (platform) of product to cancel.
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.deleteProduct(store, productId, callback);
```

### Parameters



Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **store** | **String**| Store that lists products. | 
 **productId** | **String**| ID (platform) of product to cancel. | 

### Return type

[**ProductApiResponse**](ProductApiResponse.md)

### Authorization

[ca_key](../README.md#ca_key), [ca_stage](../README.md#ca_stage)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## getProductsByField

> ProductApiResponse getProductsByField(store, opts)

getProductsByField

Requests a list of products store supplies.

### Example

```javascript
var NomadEnvoyCli = require('nomad_envoy_cli');
var defaultClient = NomadEnvoyCli.ApiClient.instance;
// Configure API key authorization: ca_key
var ca_key = defaultClient.authentications['ca_key'];
ca_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_key.apiKeyPrefix = 'Token';
// Configure API key authorization: ca_stage
var ca_stage = defaultClient.authentications['ca_stage'];
ca_stage.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_stage.apiKeyPrefix = 'Token';

var apiInstance = new NomadEnvoyCli.ProductApi();
var store = "store_example"; // String | Store to get product list from.
var opts = {
  'productId': "productId_example", // String | product (platform) ID for product to get.
  'skuId': "skuId_example", // String | SKU (platform) ID for product to get.
  'barcode': "barcode_example", // String | Barcode (merchant) for product to get.
  'pageNo': 56, // Number | Page number
  'pageSize': 56, // Number | Page size
  'isOnsale': true, // Boolean | filter onsale products
  'createdRange': "createdRange_example", // String | The time range of products created at, use ISO_8601 format here, e.g. 2007-03-01T13:00:00Z/2008-05-11T15:30:00Z
  'updatedRange': "updatedRange_example" // String | The time range of products updated at, use ISO_8601 format here, e.g. 2007-03-01T13:00:00Z/2008-05-11T15:30:00Z
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getProductsByField(store, opts, callback);
```

### Parameters



Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **store** | **String**| Store to get product list from. | 
 **productId** | **String**| product (platform) ID for product to get. | [optional] 
 **skuId** | **String**| SKU (platform) ID for product to get. | [optional] 
 **barcode** | **String**| Barcode (merchant) for product to get. | [optional] 
 **pageNo** | **Number**| Page number | [optional] 
 **pageSize** | **Number**| Page size | [optional] 
 **isOnsale** | **Boolean**| filter onsale products | [optional] 
 **createdRange** | **String**| The time range of products created at, use ISO_8601 format here, e.g. 2007-03-01T13:00:00Z/2008-05-11T15:30:00Z | [optional] 
 **updatedRange** | **String**| The time range of products updated at, use ISO_8601 format here, e.g. 2007-03-01T13:00:00Z/2008-05-11T15:30:00Z | [optional] 

### Return type

[**ProductApiResponse**](ProductApiResponse.md)

### Authorization

[ca_key](../README.md#ca_key), [ca_stage](../README.md#ca_stage)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## updateProduct

> ProductApiResponse updateProduct(store, opts)

updateProduct

Update a product.

### Example

```javascript
var NomadEnvoyCli = require('nomad_envoy_cli');
var defaultClient = NomadEnvoyCli.ApiClient.instance;
// Configure API key authorization: ca_key
var ca_key = defaultClient.authentications['ca_key'];
ca_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_key.apiKeyPrefix = 'Token';
// Configure API key authorization: ca_stage
var ca_stage = defaultClient.authentications['ca_stage'];
ca_stage.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ca_stage.apiKeyPrefix = 'Token';

var apiInstance = new NomadEnvoyCli.ProductApi();
var store = "store_example"; // String | Update product to store.
var opts = {
  'product': new NomadEnvoyCli.Product() // Product | Product details
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateProduct(store, opts, callback);
```

### Parameters



Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **store** | **String**| Update product to store. | 
 **product** | [**Product**](Product.md)| Product details | [optional] 

### Return type

[**ProductApiResponse**](ProductApiResponse.md)

### Authorization

[ca_key](../README.md#ca_key), [ca_stage](../README.md#ca_stage)

### HTTP request headers

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

