---
schema_version: "1"
id: 8dac86cfb038226e26df8578d9ab7f92a0f338b143d7bb2ed316a9b7956c1b8d
title: Confirm Product Inventory in Point of Sale
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/retail-cloud/guides/spi-live-inventory-check.md
canonical_url: https://developer.salesforce.com/docs/commerce/retail-cloud/guide/spi-live-inventory-check.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 27930d9f98635695e694141d64497da20be28976aa89312199edfa0d5bfe852b
products:
  - Point of Sale for Developers
  - Salesforce APIs
---
# Confirm Product Inventory in Point of Sale

Check both in-store and online inventory availability using Point of Sale SPIs.

If you change the cart in the Point of Sale app (for example, adding items, deleting items, changing the number of items, and so on), Point of Sale sends the cart contents to the external system through the SPI. Point of Sale checks the external system for product availability by checking inventory count. If the product isn't available, an error appears and the item isn’t added to the cart.

Point of Sale offers [two additional inventory SPIs](https://developer.salesforce.com/docs/commerce/retail-cloud/guide/inventory-lookup-on-pdp-via-spis.html) that check nearby inventory and get inventory information based on a delivery ZIP code on the Product Detail Page (PDP).

## Set up Point of Sale CMS for Checking Product Inventory

The merchant SPI implementation must provide an endpoint for the POS app to request inventory for the provided products. Configure these endpoints in Point of Sale CMS so that the POS app can perform live inventory checks.

1. Go to **Inventory** | **Inventory Configurations**.

2. Under Provider, select **SPI** and configure the rest of the toggles by referring to [Inventory Configurations](https://help.salesforce.com/s/articleView?id=commerce.rt_cms_modules_inventory_configuration.htm&type=5) in _Salesforce Help_.

3. In CMS, and go to **Store Management** | **Integration** | **Custom Connectors**.

4. Click **Create**.

5. Fill out the fields using this information:

   1. For **API Config** | **API Key**, enter **ONLINE_ITEM_INVENTORY_CHECK**.

   2. For **API Config | API Endpoint**, enter the external endpoint to get the order. For example, `https://sample/external/to/export/return/order/to/external/system`.

   3. For **JSON Config** | **Integration Type**, enter **HTTP_POST**.

   4. For **JSON Config** | **JSON Headers**, enter the API header. Headers can be **Content-Type**, authorization attributes like **clientId/password**. For example, `{"Content-Type":"application/json","client_id":"myClientId","client_secret":"myClientSecret"}`.

6. Confirm that the app configuration settings are turned off:

   1. **HasOnlineInventory** (**App Config | Modules | Settings**)

   2. **HasStoreInventory** (**App Config | Modules | In-Store Fulfillment**)

7. Confirm that the store settings are turned on:

   1. **enable.online.inventory.tracking** (**Store Management | Store Settings | Inventory**)

   2. **check.store.inventory** (**Store Management | Store Settings | Store Fulfillment | BOPIS**)

The next sections include examples of the request and response. In the response, the merchant receives the product ID, the type of inventory check (for example, `ONLINE`), the store ID (optional), and the purpose of the inventory check (for example, `AVAILABILITY`).

## Example SPI Request

The SPI is triggered on the POS app when a user clicks **Add to Cart** for a product or changes the fulfillment type in the cart.

```java
{
  "products": [
    {
      "inventoryAction": "string",
      "inventoryType": "string",
      "productId": "string",
      "storeId": "string"
    }
  ]
}

```

## Example SPI Response

```java
{
  "errorMessage": "string",
  "inventory": [
    {
      "inventoryType": "string",
      "productId": "string",
      "quantity": 0,
      "storeId": "string"
    }
  ]
}

```
