# Inventory status

In today's fast-paced market, having immediate access to your product inventory status is vital for maintaining operational efficiency and meeting customer demand. The ability to quickly and accurately check your products' inventory levels— individually or in bulk—can significantly impact your business operations. This guide facilitates access to real-time inventory information through a straightforward API request. Whether you are looking to monitor a single item or assess the inventory status of multiple products, the following sections will provide step-by-step instructions on retrieving this crucial data effectively, ensuring that you remain proactive and responsive in your business strategies.

## Getting the inventory status for one or more products

Staying informed about the inventory status of your products is crucial. Whether monitoring a single item or tracking multiple products, understanding how to retrieve inventory information efficiently can streamline your operations and enhance your responsiveness to market changes. This guide will walk you through the process of using AN API request to obtain the inventory status for one or more products, enabling you to make informed decisions based on real-time data.

Use the [`GET /v1/shoppers/me/products/inventory-status`](https://docs.digitalriver.com/commerce-api-references/shopper-apis/browse-product-discovery/inventory-status#v1-shoppers-me-products-inventory-status) request to get the inventory status for one or more products. You can use either the [product identifier](https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/product-identifier) or an [external reference identifier](https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/product-external-reference-identifier-erid) as a query parameter. Replace `{Your_Access_Token}` with your [access token](/commerce-api/shopper-apis/oauth/access-tokens.md) in the following example.

{% tabs %}
{% tab title="cURL" %}

```http
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/inventory-status' \
--header 'authorization: bearer {Your_Access_token}\ 
...
```

{% endtab %}

{% tab title="200 OK response" %}

<pre class="language-json"><code class="lang-json">{  
    "products": {    
<strong>        "uri": "https://api.digitalriver.com/v1/shoppers/me/products/inventorystatus",    
</strong><strong>        "inventoryStatus": [
</strong><strong>          {
</strong><strong>              "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500/inventory-status",
</strong><strong>              "product": [
</strong><strong>                {
</strong><strong>                    "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",            
</strong><strong>                    "id": 64578500,
</strong><strong>                    "externalReferenceId": "Test External Reference Number",            
</strong><strong>                    "companyId": "demosft1"
</strong><strong>                  }
</strong><strong>              ],        
</strong><strong>              "availableQuantity": 2147483647,        
</strong><strong>              "availableQuantityIsEstimated": "false",        
</strong><strong>              "productIsInStock": "true",
</strong><strong>              "productIsAllowsBackorders": "true",
</strong><strong>              "productIsTracked": "false",
</strong><strong>              "requestedQuantityAvailable": "true",
</strong><strong>              "status": "PRODUCT_INVENTORY_IN_STOCK", 
</strong><strong>             "statusIsEstimated": "false",        
</strong><strong>             "expectedInStockDate": "string",        
</strong><strong>             "customStockMessage": "string"      
</strong><strong>         }    
</strong><strong>     ]  
</strong><strong> } 
</strong><strong>}
</strong></code></pre>

{% endtab %}
{% endtabs %}

The request returns an empty collection with a `200 OK` status if you do not provide an identifier. If you pass an invalid product identifier or external reference identifier, the request will ignore it and return an empty collection, along with a `200 OK` status. This allows you to ensure that your query was successful but did not return any matching products due to incorrect identifiers.

If you want to check the inventory status for multiple products, repeat the request for each product ID or external reference ID.

## Getting the inventory status for a specific product

To effectively manage your inventory and meet customer demand, it's crucial to have real-time insights into the inventory status of products. This guide offers a detailed walkthrough on programmatically retrieving inventory status for a specific product. Whether you're querying with a product ID or an external reference ID, the following examples will demonstrate how to make the request and interpret the response, ensuring you have the necessary information to make informed decisions about product availability.

Send a [GET /v1/shoppers/me/products/{productId or externalReferenceId}/inventory-status](https://docs.digitalriver.com/commerce-api-references/shopper-apis/browse-product-discovery/inventory-status#v1-shoppers-me-products-productid-inventory-status) request to retrieve the inventory for a specific product. Replace `{productId or externalReferenceId}` with the product identifier or external reference identifier and `{Your_Access_Token}` with your [access token](/commerce-api/shopper-apis/oauth/access-tokens.md) in the following example.

{% tabs %}
{% tab title="cURL" %}

```html
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}/inventorystatus' \
--header 'Authorization: Basic ***' \ 
...
```

{% endtab %}

{% tab title="Response" %}

```json
{  
    "inventoryStatus": {    
        "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500/inventory-status",    
        "product": [      
            {        
                "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",        
                "id": 64578500,        
                "externalReferenceId": "Test External Reference Number",        
                "companyId": "demosft1"      
            }    
        ],    
        "availableQuantity": 2147483647,    
        "availableQuantityIsEstimated": "false",    
        "productIsInStock": "true",    
        "productIsAllowsBackorders": "true",    
        "productIsTracked": "false",    
        "requestedQuantityAvailable": "true",    
        "status": "PRODUCT_INVENTORY_IN_STOCK",    
        "statusIsEstimated": "false",    
        "expectedInStockDate": "string",    
        "customStockMessage": "string"  
    } 
}
```

{% endtab %}
{% endtabs %}

A successful `200 OK` request will return a JSON response containing the specified product's inventory status. The response includes details such as `availableQuantity`, `productIsInStock`, and `expectedInStockDate`.

Remember, an invalid product identifier will result in an empty collection returned with a `200 OK` status indicating your query was successfully processed, but no matching product was found.


---

# 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/commerce-api/shopper-apis/product-discovery/inventory-status.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.
