npm package: @plasma-platform/service-items
Description: SDK for service items
Author: Kyrylo Voronoi
Latest version: 1.2.2

![version](https://badgen.net/npm/v/@plasma-platform/service-items)
![nextVersion](https://badgen.net/npm/v/@plasma-platform/service-items/next)
![downloads](https://badgen.net/npm/dt/@plasma-platform/service-items)
![license](https://badgen.net/npm/license/@plasma-platform/service-items)
![dependency](https://badgen.net/npm/dependents/@plasma-platform/service-items)

* * *

[Full documentation](https://templatemonster.gitlab.io/PlasmaPlatform/Frontend/plasma-platform/?path=/story/plasma-platform-sdk--service-items)
install:
`npm i @plasma-platform/service-items -S`

# Short documentation

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [ServiceItems](#serviceitems)
    -   [createNewItem](#createnewitem)
        -   [Parameters](#parameters)
        -   [Examples](#examples)
    -   [getItemById](#getitembyid)
        -   [Parameters](#parameters-1)
        -   [Examples](#examples-1)
    -   [getItems](#getitems)
        -   [Parameters](#parameters-2)
        -   [Examples](#examples-2)

## ServiceItems

-   **See: <http://service-items.templatemonsterdev.com/doc/>**

Items API

### createNewItem

-   **See: <http://service-items.templatemonsterdev.com/doc/#api-Items-CreateItem>**

Create new item

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Item id (unique).
    -   `params.price` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Item price.
    -   `params.title` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Item title.

#### Examples

```javascript
(async () => {
  const service = new Service(url, token);
  const request = await service.createNewItem(params);
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getItemById

-   **See: <http://service-items.templatemonsterdev.com/doc/#api-Items-GetItem>**

Get item by id

#### Parameters

-   `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Item id.

#### Examples

```javascript
(async () => {
  const service = new Service(url);
  const request = await service.getItemById(id);
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;any>** 

### getItems

-   **See: <http://service-items.templatemonsterdev.com/doc/#api-Items-GetItems>**

Get items

#### Parameters

-   `props` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `props.ids` **[array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** array of items id

#### Examples

```javascript
(async () => {
  const service = new Service(url);
  const request = await service.getItems({ids: [1,2]});
})();
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** object of items list