# Nr1CatalogApp.ItemPricesApi

All URIs are relative to *http://api.ncr.com/catalog/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**itemPricesFindMultiple**](ItemPricesApi.md#itemPricesFindMultiple) | **POST** /item-prices/get-multiple | Retrieves a collection of item-price documents matching the item-identifiers in the request
[**itemPricesFindMultiplePrices**](ItemPricesApi.md#itemPricesFindMultiplePrices) | **POST** /item-prices/get-multiple-prices | Retrieve a collection of item-price documents grouped on item-codes 
[**itemPricesGet**](ItemPricesApi.md#itemPricesGet) | **GET** /item-prices/{itemCode}/{priceCode} | Retrieve an item-price document by the item-price resource identifier.
[**itemPricesGetPastAndPresentSnapshot**](ItemPricesApi.md#itemPricesGetPastAndPresentSnapshot) | **GET** /item-prices/snapshot/past-and-present | Get the snapshot of current and expired prices (up to 5 days in the past) based on the provided client snapshot version.
[**itemPricesGetSnapshot**](ItemPricesApi.md#itemPricesGetSnapshot) | **GET** /item-prices/snapshot | Get the snapshot based on the provided client snapshot version.
[**itemPricesSave**](ItemPricesApi.md#itemPricesSave) | **PUT** /item-prices/{itemCode}/{priceCode} | Creates/Updates an item-price document with the provided item-price document input for a specific enterprise unit (site/store).
[**itemPricesSaveMultiple**](ItemPricesApi.md#itemPricesSaveMultiple) | **PUT** /item-prices | Imports a mini-batch of item-price documents.


<a name="itemPricesFindMultiple"></a>
# **itemPricesFindMultiple**
> GetItemPricesResponse itemPricesFindMultiple(nepEnterpriseUnit, opts)

Retrieves a collection of item-price documents matching the item-identifiers in the request

<p>This API retrieves a set of item-price documents for a given set of item-identifiers. This API is executed on a context of a single enterprise unit which is expected to be passed as a standard header. The API does not fail, if any of the provided item-codes do not have corresponding item-prices (instead it returns empty object response). This API returns valid item-prices till the date of query. This API allows clients to orchestrate multiple catalog APIs more effectively. For example, a client may run a search against global items by various supported parameters and then retrieve with a single call all prices for a given enterprise unit (e.g. store/site) of the catalog items matched by the previous search. This API has no side-effects.</p><p><h3>Input parameters:-</h3><code>request:</code> Identifies context of the client, such as enterprise unit that the client belongs to.<br/><code>itemIdentifiers:</code> Object containing the list of item-codes to use for bulk retrieval.<br/><h3>Returns:</h3> A collection of the matched documents or empty collection if no matches were found.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit id which belongs to either site or a revenue center.

var opts = { 
  'body': new Nr1CatalogApp.PricesItemIdCollectionData(), // PricesItemIdCollectionData | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit id which belongs to either site or a revenue center. | 
 **body** | [**PricesItemIdCollectionData**](PricesItemIdCollectionData.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetItemPricesResponse**](GetItemPricesResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="itemPricesFindMultiplePrices"></a>
# **itemPricesFindMultiplePrices**
> GetMultipleItemPricesResponse itemPricesFindMultiplePrices(nepEnterpriseUnit, opts)

Retrieve a collection of item-price documents grouped on item-codes 

<p>Retrieves a set of item-price documents for a given set of item identifiers. This API is executed on a context of a single enterprise unit which is expected to be passed as a standard header. The API checks for the enterprise unit type as <code>site</code> (default) or <code>revenue-center</code>. <b>If enterprise unit is of type 'revenue-center', the API would fetch the required item-prices from the revenue-center and the missing item-prices from its parent site.</b> It groups the prices based on the type of enterprise-unit they originate from (site or revenue-center) and presents item-code wise list of prices.<b> It will return all active prices as of date of query, if no filter date is provided.</b> The API does not fail if any of the provided item-codes do not have the corresponding item-prices defined at the specified enterprise unit (instead it returns empty object response). This API allows clients to orchestrate multiple catalog APIs more effectively. For example, a client may run a search against global items by various supported parameters and then retrieve with a single call all prices for a given enterprise unit (e.g. store/site) of the catalog items matched by the previous search. This API has no side-effects.</p><p><h3>Input parameters:-</h3> <code>request:</code> Identifies context of the client, such as enterprise unit that the client belongs to and analyzes filterDate query param.<br/><code>itemIdentifiers:</code> Object containing the item codes to use for bulk retrieval.<br/><h3>Returns:</h3> A collection of the matched documents group by the item-codes or empty collection if no matches were found.

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit id which belongs to either site or a revenue center.

var opts = { 
  'filterDate': new Date("2013-10-20T19:20:30+01:00"), // Date | A filter date to filter item prices (inclusive of start and exclusive of end date).  
  'body': new Nr1CatalogApp.PricesItemIdCollectionData(), // PricesItemIdCollectionData | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit id which belongs to either site or a revenue center. | 
 **filterDate** | **Date**| A filter date to filter item prices (inclusive of start and exclusive of end date).   | [optional] 
 **body** | [**PricesItemIdCollectionData**](PricesItemIdCollectionData.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetMultipleItemPricesResponse**](GetMultipleItemPricesResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="itemPricesGet"></a>
# **itemPricesGet**
> ItemPriceViewData itemPricesGet(itemCode, nepEnterpriseUnit, priceCode, opts)

Retrieve an item-price document by the item-price resource identifier.

<p>This API retrieves a single document of item-price based on its <b>priceCode</b> and <b>itemCode</b>. It is executed on a context of a single enterprise unit which is expected to be passed as a standard header.</p><p><h3>Input parameter:- </h3><code>priceIdentifier</code>: uniquely identifies item-price to retrieve.<br/><h3>Returns:</h3> Object containing complete writable set of attributes for item-price.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var itemCode = "itemCode_example"; // String | A unique item (unique per Tenant) code which is used to identify the item.

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit identifier for which the item prices are defined.

var priceCode = "priceCode_example"; // String | Identifier of the price provided by the external system. It is expected to be unique in the context of the item and enterprise unit, since each combination of item code, enterprise unit and price identifier are part of the composite id. This identifier is mandatory to facilitate price updates. For example a price scheduled in the future may be cancelled and this is expected to be communicated to the clients that replicate the catalog item price document.

var opts = { 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **itemCode** | **String**| A unique item (unique per Tenant) code which is used to identify the item. | 
 **nepEnterpriseUnit** | **String**| Enterprise unit identifier for which the item prices are defined. | 
 **priceCode** | **String**| Identifier of the price provided by the external system. It is expected to be unique in the context of the item and enterprise unit, since each combination of item code, enterprise unit and price identifier are part of the composite id. This identifier is mandatory to facilitate price updates. For example a price scheduled in the future may be cancelled and this is expected to be communicated to the clients that replicate the catalog item price document. | 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**ItemPriceViewData**](ItemPriceViewData.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="itemPricesGetPastAndPresentSnapshot"></a>
# **itemPricesGetPastAndPresentSnapshot**
> GetItemPricesSnapshotResponse itemPricesGetPastAndPresentSnapshot(nepEnterpriseUnit, opts)

Get the snapshot of current and expired prices (up to 5 days in the past) based on the provided client snapshot version.

<p>Item-price document synchronization API that is used to synchronize the resource state with the remote client such as POS, Store Server or mobile device. This API requires specifying enterprise unit id that matches the client synchronization system (e.g. store server or POS).<br/> The default period in this endpoint to include expired item-prices by is one (1) day expired. This can be expanded up to five (5) days in the past by passing in an integer representing the desired number of days expired to include, with the query parameter <code>daysExpired=<i>0-5</i></code>.<br/>Results are filterable by <i>STATUS</i> using the query parameter <code>status=<i>desiredResourceStatus</i></code>.<br/><h3>Input parameter:</h3><code>request</code>: Snapshot request containing snapshotVersion and enterpriseUnitId<br/><p><h3>Returns:</h3> A snapshot that matches the request parameters (e.g. all item-prices modified since the submitted client version).<br/><br/><b>If the the result payload exceeds maximum size (generally around 10K records), the document synchronization cannot be accomplished using APIs. The client should wait a few moments for the file to be available at the provided URI in the details.</b></p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit identifier for which the documents are defined.

var opts = { 
  'nepSnapshotVersion': 789, // Number | Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp.
  'daysExpired': 56, // Number | How many days in the past to include expired item prices by.
  'status': "status_example", // String | Flag to filter just one status type.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit identifier for which the documents are defined. | 
 **nepSnapshotVersion** | **Number**| Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp. | [optional] 
 **daysExpired** | **Number**| How many days in the past to include expired item prices by. | [optional] 
 **status** | **String**| Flag to filter just one status type. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetItemPricesSnapshotResponse**](GetItemPricesSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="itemPricesGetSnapshot"></a>
# **itemPricesGetSnapshot**
> GetItemPricesSnapshotResponse itemPricesGetSnapshot(nepEnterpriseUnit, opts)

Get the snapshot based on the provided client snapshot version.

<p>Item-price document synchronization API that is used to synchronize the resource state with the remote client such as POS, Store Server or mobile device. This API requires specifying enterprise unit id that matches the client synchronization system (e.g. store server or POS). Results are filterable by <i>STATUS</i> using the query parameter <code>status=<i>desiredResourceStatus</i></code>. Expired prices are also filterable by the query parameter <code>isExpired=<i>true/false</i></code>.</p><h3>Input parameter:</h3><code>request</code>: Snapshot request containing snapshotVersion and enterpriseUnitId<br/><p><h3>Returns:</h3> A snapshot that matches the request parameters (e.g. all item-prices modified since the submitted client version).<br/><br/><b>If the the result payload exceeds maximum size (generally around 10K records), the document synchronization cannot be accomplished using APIs. The client should wait a few moments for the file to be available at the provided URI in the details.</b></p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit identifier for which the documents are defined.

var opts = { 
  'nepSnapshotVersion': 789, // Number | Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp.
  'status': "status_example", // String | Flag to filter just one status type.
  'isExpired': true, // Boolean | Flag to filter expired price records.
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **nepEnterpriseUnit** | **String**| Enterprise unit identifier for which the documents are defined. | 
 **nepSnapshotVersion** | **Number**| Version of the client state. This attribute will be used by the back-end to identify the snapshot that should be generated per client. In a simple case, the version is a timestamp (epoch time in millis) and the generated snapshot will contain all documents modified since the provided timestamp. | [optional] 
 **status** | **String**| Flag to filter just one status type. | [optional] 
 **isExpired** | **Boolean**| Flag to filter expired price records. | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

[**GetItemPricesSnapshotResponse**](GetItemPricesSnapshotResponse.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="itemPricesSave"></a>
# **itemPricesSave**
> itemPricesSave(itemCode, nepEnterpriseUnit, priceCode, opts)

Creates/Updates an item-price document with the provided item-price document input for a specific enterprise unit (site/store).

<p>This API creates/updates item-price document based on provided <b>itemCode</b> and <b>priceCode</b> of item-price document containing fields that uniquely define the price object.If the item-price already exists, the document will be updated only if the version number in the request is greater than the version number of the existing document. This API is executed on a context of a single enterprise unit which is expected to be passed as a standard header.</p><p><h3>Input parameters:-</h3><code>itemPriceId</code>: Item-price data containing fields that uniquely define the price object viz., priceCode, itemCode and enterpriseUnitId.<br/><code>itemPriceData</code>: Item-price data containing price information to save/update.</p>

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var itemCode = "itemCode_example"; // String | A unique item (unique per Tenant) code which is used to identify the item.

var nepEnterpriseUnit = "nepEnterpriseUnit_example"; // String | Enterprise unit identifier for which the item prices are defined.

var priceCode = "priceCode_example"; // String | Identifier of the price provided by the external system. It is expected to be unique in the context of the item and enterprise unit, since each combination of item code, enterprise unit and price identifier are part of the composite id. This identifier is mandatory to facilitate price updates. For example a price scheduled in the future may be cancelled and this is expected to be communicated to the clients that replicate the catalog item price document.

var opts = { 
  'body': new Nr1CatalogApp.ItemPriceData(), // ItemPriceData | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **itemCode** | **String**| A unique item (unique per Tenant) code which is used to identify the item. | 
 **nepEnterpriseUnit** | **String**| Enterprise unit identifier for which the item prices are defined. | 
 **priceCode** | **String**| Identifier of the price provided by the external system. It is expected to be unique in the context of the item and enterprise unit, since each combination of item code, enterprise unit and price identifier are part of the composite id. This identifier is mandatory to facilitate price updates. For example a price scheduled in the future may be cancelled and this is expected to be communicated to the clients that replicate the catalog item price document. | 
 **body** | [**ItemPriceData**](ItemPriceData.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

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

Imports a mini-batch of item-price documents.

<p>This import API will either create or update existing item-price documents. If the item-price already exists, the document will be updated only if the version number in the request is greater than the version number of the existing document. It allows specifying multiple enterprise units in the request, with a maximum of 100 enterprise units per request. The API will perform an authorization check on the supplied enterprise units.</p> <p><h3>Input parameters:-</h3><code>request</code>: contains the list of item-prices to save</p> 

### Example
```javascript
var Nr1CatalogApp = require('nr1_catalog_app');

var apiInstance = new Nr1CatalogApp.ItemPricesApi();

var opts = { 
  'body': new Nr1CatalogApp.SaveMultipleItemPricesRequest(), // SaveMultipleItemPricesRequest | 
  'nepCorrelationId': "nepCorrelationId_example", // String | A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes
  'nepOrganization': "nepOrganization_example" // String | The organization the request applies to
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SaveMultipleItemPricesRequest**](SaveMultipleItemPricesRequest.md)|  | [optional] 
 **nepCorrelationId** | **String**| A unique ID that can be used to correlate one or more related requests for debugging or tracing purposes | [optional] 
 **nepOrganization** | **String**| The organization the request applies to | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

