# Checking inventory levels

In [Digital River coordinated fulfillments](/digital-river-api/integration-options/checkouts/handling-digital-river-coordinated-fulfillments.md), you can call the [Inventory Levels API](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/inventory-levels) to access product availability information at individual warehouses. After you [submit an inventory level request](#submitting-an-inventory-level-request), each [inventory level object](#an-inventory-level) contained in the response is associated with one [inventory item](/digital-river-api/product-management/skus.md#inventory-items) and one location.

You can [use an inventory level](#using-an-inventory-level) to [sequence your checkout](/digital-river-api/integration-options/checkouts/creating-checkouts.md) and provide product availability information to customers.

## Submitting an inventory-level request

When you submit a [`GET /inventory-levels`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/inventory-levels#inventory-levels) request, you must provide an array of [inventory item identifiers](/digital-river-api/product-management/common-attributes.md#unique-identifier) as a query parameter.

You can filter the results by when inventory levels were last updated, whether the product is available, and which warehouse locations can ship the product to a specific country.

If you don't apply any filters, each inventory item identifier you specify in the request returns one or more [inventory-level objects](#an-inventory-level). However, the application of search filters, such as `available` or `shipToCountry`, may result in your query returning no results. For example, when you use the `shipToCountry` filter (which must be formatted as an [ISO 3166 country code](https://www.iso.org/iso-3166-country-codes.html)), you'll only get inventory-level information if the product can be shipped to that country.

## **An inventory level**

After you successfully submit a [`GET /inventory-levels`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/inventory-levels#inventory-levels) request, a `200 OK` response contains a `data` array. Each element of this array represents an inventory level.

You get one [inventory level](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/inventory-levels) when a product is located at a single warehouse. However, when a product is warehoused at multiple locations, we provide the inventory level at each location.

An inventory level provides the item's [unique identifier](/digital-river-api/product-management/managing-inventory.md#unique-identifier), [warehouse location](#product-location), and [availability](#product-availability).&#x20;

{% tabs %}
{% tab title="Inventory level" %}

```javascript
{
  "data": [
    {
      "locationId": "afe95639-8181-4b66-86a6-1a9493d5419d",
      "inventoryItemId": "ce4ce2de-530c-4da2-bf8a-f0f8cf059095",
      "available": true,
      "availableQuantity": 6,
      "liveMode": false,
      "updatedTime": "2018-04-25T20:36:00Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

### Product location

The `locationId` represents the identifier of the fulfiller's warehouse, which contains the inventory item.

### Product availability

If the product is `available`, then the `availableQuantity` of the inventory level is greater than zero. In these cases, `availableTime` is null and not returned.

If `available` is `false`, then `availableTime` provides an estimated time for the product to restock (assuming the fulfiller has provided this information). When the fulfiller doesn’t provide an estimated restocking time, then `availableTime` is null and not returned.

## Using an inventory level

You can use an [inventory level](#an-inventory-level) to provide product availability information to customers. During the [checkout process](/digital-river-api/integration-options/checkouts/creating-checkouts.md), it can help you determine when to display or conceal a product on your storefront, notify customers when an item is almost out of stock or when it will be available again, display the remaining number of products in stock, and determine if an item is available for shipping to a specific country.

For example, let's say you want to determine the availability of a coffee maker and whether it can be shipped to Sweden. To do this, submit a `GET/inventory-levels` that specifies the [inventory item identifier](/digital-river-api/product-management/managing-inventory.md#unique-identifier), the `shipToCountry` as `SE`, and sets `available` to `true`.

{% tabs %}
{% tab title="GET/inventory-levels" %}

```
curl --location --request GET 'https://api.digitalriver.com/inventory-levels?inventoryItemIds=310abe81-69f6-44e5-85df-2674045e5460&shipToCountry=SE&available=true' \
--header 'Authorization: Bearer <API_key>' \
...
```

{% endtab %}
{% endtabs %}

In this case, Digital River determines that a machine that can be shipped to Sweden is only available at one location, so the response returns just a single inventory-level object.

{% tabs %}
{% tab title="Inventory level" %}

```javascript
{
    "data": [
        {
            "locationId": "20045",
            "inventoryItemId": "310abe81-69f6-44e5-85df-2674045e5460",
            "available": true,
            "availableQuantity": 995,
            "updatedTime": "2021-01-12T06:55:14Z",
            "liveMode": false
        }
    ]
}
```

{% endtab %}
{% endtabs %}

Your integration can also use an inventory level to determine whether to [reserve an inventory item](/digital-river-api/integration-options/checkouts/handling-digital-river-coordinated-fulfillments/reserving-inventory-items.md) or [create a fulfillment order](/digital-river-api/integration-options/checkouts/handling-digital-river-coordinated-fulfillments/global-fulfillments.md#creating-a-fulfillment-order).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/handling-digital-river-coordinated-fulfillments/checking-inventory-levels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
