npm package: @plasma-platform/service-delivery
Description: Delivery Service API
Author: Kyrylo Voronoi
Latest version: 1.6.3

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

* * *

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

# Short documentation

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

### Table of Contents

-   [DeliveryService](#deliveryservice)
    -   [messages](#messages)
    -   [getDeliveriesByOrderId](#getdeliveriesbyorderid)
        -   [Parameters](#parameters)
        -   [Examples](#examples)
    -   [getDeliveryByProductId](#getdeliverybyproductid)
        -   [Parameters](#parameters-1)
        -   [Examples](#examples-1)
    -   [getDeliveriesByOrdersIds](#getdeliveriesbyordersids)
        -   [Parameters](#parameters-2)
        -   [Examples](#examples-2)
    -   [getCountDownloadsProduct](#getcountdownloadsproduct)
        -   [Parameters](#parameters-3)
        -   [Examples](#examples-3)

## DeliveryService

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

### messages

object with class service messages

Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

### getDeliveriesByOrderId

-   **See: <http://service-delivery.dev/api/v1/deliveries/orders/:order_id>**

Get deliveries by order id

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.orderId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** ID of order.
    -   `params.page` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
    -   `params.perPage` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

#### Examples

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

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

### getDeliveryByProductId

-   **See: <http://service-delivery.dev/api/v1/deliveries/orders/:order_id>**

DeliveryService - Get delivery by order and product ID

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.orderId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** ID of order.
    -   `params.productId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** ID of product.

#### Examples

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

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

### getDeliveriesByOrdersIds

-   **See: <http://service-delivery.dev/api/v1/deliveries/?orderIds=2342sdf3,23435dfg>**

DeliveryService - Get delivery by orders ids

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.order_ids` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** IDs of orders.
    -   `params.fields` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** fields in response.

#### Examples

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

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

### getCountDownloadsProduct

-   **See: <http://service-delivery.dev/api/v1/downloads/UBgGf5pAkKNvs2VLZyDo/template/79332>**

DeliveryService - Count downloads product

#### Parameters

-   `params` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
    -   `params.orderId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** order Id
    -   `params.productType` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** product type
    -   `params.productId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** product id

#### Examples

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

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