---
schema_version: "1"
id: bfd37645886c08b5a9093e049cf2376291c24fa5cd7af76086c0341411c887e2
title: Inventory SPI
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/retail-cloud/reference/generated-api-specs/inventory-spi.md
canonical_url: https://developer.salesforce.com/docs/commerce/retail-cloud/references/inventory-spi
source_site: developer.salesforce.com
content_type: documentation
content_hash: ed55fda91eafdde6de8e17e31424e0417594c4ee9d3c4316f8b69f08d16f854e
products:
  - Point of Sale for Developers
  - Salesforce APIs
---
Inventory SPI

# Inventory SPI

[Download specification](https://developer.salesforce.com/static/commercecloud/retail-cloud/inventory-spi/inventory-spi-oas-public.yaml)

Merchant SPI to implement and provide an endpoint for the POS to trigger and get inventory for the provided products. These endpoints must be configured in the POS system so that the POS can use them to check inventory availability.

**Version:** 2.3.4

## Tags

### Inventory SPI

[Download specification](https://developer.salesforce.com/static/commercecloud/retail-cloud/inventory-spi/inventory-spi-oas-public.yaml)

Merchant SPI to implement and provide an endpoint for the POS to trigger and get inventory for the provided products. These endpoints must be configured in the POS system so that the POS can use them to check inventory availability.

## Operations

### POST Check inventory availability for zip code.

`POST /merchant/spi/sample/endpoint/product/zipcode/getAvailabilityInformation`

Operation ID: `checkInventoryAvailability`. Tags: Inventory SPI.

Check the external system for the availability of a given product against the provided zip code. The response is a single string, the availability text, and any other information related to the product. Merchants must implement this endpoint per this specification and then configure it in CMS under **CMS** > **Store Management** > **Integration** > **Custom API Connectors** > **Create**. Make sure to create the endpoint in CMS with the following details:

1.  Under **API Config**:
    *   **API Key:** `INVENTORY_BY_ZIPCODE`
    *   **API Endpoint:** Provide the external endpoint to get the order, for example: [https://sample/external/endpoint/product/zipcode/getAvailabilityInformation](https://sample/external/endpoint/product/zipcode/getAvailabilityInformation)
2.  Under **JSON Config**:
    *   **Integration Type:** `HTTP_POST`
    *   **JSON Headers:** Provide the header for the API. Headers can be Content-Type, Authorization attributes like clientId/password, for example: {"Content-Type":"application/json","client\_id":"myClientId","client\_secret":"myClientSecret"}.

#### Request body

Media type: `application/json`. Schema: `InventoryAvailabilityRequest`.

#### Responses

*   **default** Default response.
    
    Media type: `application/json`. Schema: `SpiInventoryAvailabilityResponse`.
    

### POST Check inventory overview for all stores and warehouses.

`POST /merchant/spi/sample/endpoint/product/getInventoryOverview`

Operation ID: `checkInventoryOverview`. Tags: Inventory SPI.

Check the external system for the availability of a given product. The response is shown on the existing inventory overview widget, showing availability for all stores. Merchants must implement this endpoint per this specification and then configure it in CMS under **CMS** > **Store Management** > **Integration** > **Custom API Connectors** > **Create**. Make sure to create the endpoint in CMS with the following details:

1.  Under **API Config**:
    *   **API Key:** `GET_PRODUCT_INVENTORY_OVERVIEW`
    *   **API Endpoint:** Provide the external endpoint to get the order, for example: [https://sample/external/endpoint/to/get/inventory/from/external/system](https://sample/external/endpoint/to/get/inventory/from/external/system)
2.  Under **JSON Config**:
    *   **Integration Type:** `HTTP_POST`
    *   **JSON Headers:** Provide the header for the API. Headers can be Content-Type, Authorization attributes like clientId/password, for example: {"Content-Type":"application/json","client\_id":"myClientId","client\_secret":"myClientSecret"}.

#### Request body

Media type: `application/json`. Schema: `InventoryOverviewRequest`.

#### Responses

*   **default** Default response.
    
    Media type: `application/json`. Schema: `SpiInventoryOverviewResponse`.
    

### POST Inventory SPI to Check Inventory count

`POST /merchant/spi/sample/endpoint/sa/inventory/to/check/inventory/from/external/system`

Operation ID: `checkInventory`. Tags: Inventory SPI.

The API is to check the external system for the availability of given products by checking their inventory count. Merchant API to receive the Product ID, the type of inventory check to be done (ONLINE or IN\_STORE), optionally Store ID, and the purpose of inventory check (AVAILABILITY).

#### Request body

Media type: `application/json`. Schema: `CheckInventoryRequest`.

#### Responses

*   **default** Default response.
    
    Media type: `application/json`. Schema: `SpiInventoryResponse`.
    

## Schemas

### InventoryAvailabilityRequest

*   `zipCode` (_string_, required) The zip code or postal code for which to check product availability.
*   `productId` (_string_, required) Product ID. Unique identifier of an item. All the variations of an item will have distinct product ID, hence it is equivalent to SKU.
*   `gtin` (_string_, nullable) Item's GTIN , alternate field to check inventory (Mainly used by SPI).
*   `variantGroupId` (_string_, nullable) Variant Group ID. All the variants of an item are grouped together under the same variant ID.
*   `storeId` (_string_, nullable) Store ID of the current store.

### SpiInventoryAvailabilityResponse

*   `errorMessage` (_string_, nullable) Error message shown to the user.  
    Example: `Invalid request. Please check the request and try again.`.
*   `errorCode` (_string_, nullable) Error code shown to the user.  
    Example: `INTERNAL_ERROR`.
*   `availabilityText` (_string_, required) Generic text field that contains information about inventory availability of the product.
*   `error` (_boolean_)

### InventoryOverviewRequest

*   `productId` (_string_, required) Product ID. Unique identifier of an item. All the variations of an item will have distinct product ID, hence it is equivalent to SKU.
*   `storeId` (_string_, required) Store ID of the current store.
*   `gtin` (_string_, nullable) Item's GTIN, alternate field to check inventory (mainly used by SPI).
*   `variantGroupId` (_string_, nullable) Variant Group ID. All the variants of an item are grouped together under the same variant ID.

### SpiInventoryOverviewResponse

Response object that returns the full inventory overview for all stores.

*   `errorMessage` (_string_, nullable) Error message shown to the user.  
    Example: `Invalid request. Please check the request and try again.`.
*   `errorCode` (_string_, nullable) Error code shown to the user.  
    Example: `INTERNAL_ERROR`.
*   `storeInventoryDetails` (_array of StoreInventoryDetails_, required) List of all stores and their inventory details for the product sent in the request.
*   `error` (_boolean_)

### CheckInventoryRequest

*   `products` (_array of InventoryProduct_, required) The list of Products for which the Inventory is to be checked.

### SpiInventoryResponse

*   `errorMessage` (_string_, nullable) Placeholder string for any error that occurs when checking inventory.
*   `inventory` (_array of ProductInventory_)

### StoreInventoryDetails

List of all stores and their inventory details for the product sent in the request.

*   `storeId` (_string_, required) Store or warehouse ID.
*   `storeName` (_string_, required) Store name.
*   `storeAddress` (_SpiStoreAddress_, required)
*   `inventory` (_SpiInventory_, required)

### InventoryProduct

The list of Products for which the Inventory is to be checked.

*   `productId` (_string_, required) Product ID. Unique identifier of an item. All the variations of an item will have distinct product ID, hence it is equivalent to SKU.
*   `inventoryType` (_string_, required) Item's inventory check type. It can be either IN\_STORE (in-store purchase) or ONLINE (delivery item).
*   `inventoryAction` (_string_, required) The action to be taken for this inventory check. Current valid values: AVAILABILITY.
*   `storeId` (_string_, required) Check inventory based on given store ID. Will always be sent in the request.

### ProductInventory

*   `productId` (_string_, required) Product ID. Unique identifier of an item. All the variations of an item will have distinct product ID, hence it is equivalent to SKU.
*   `quantity` (_integer (int32)_, required) The available inventory quantity of the product, 0 when there is no inventory.
*   `storeId` (_string_, nullable) Available inventory based on given store ID. Optional, to be returned when inventoryType is IN\_STORE.
*   `inventoryType` (_string_, required) Item's inventory check type. It can be either IN\_STORE (in-store purchase) or ONLINE (delivery item).

### SpiStoreAddress

The store address.

*   `addressLine1` (_string_, required) Address Line 1.
*   `addressLine2` (_string_) Address Line 2.
*   `city` (_string_, required) City.
*   `state` (_string_, required) State.
*   `postalCode` (_string_, required) Postal Code.
*   `countryCode` (_string_, required) Country Code.

### SpiInventory

Inventory details of the product at this store.

*   `availableQuantity` (_integer (int32)_, required) Product quantity available in stock for sale.
*   `quantityOnHand` (_integer (int32)_, required) Product quantity on hand.
*   `allocatedQuantity` (_integer (int32)_, required) Product quantity allocated for shipment or BOPIS orders.
*   `quantityInTransit` (_integer (int32)_, required) Product quantity in transit to this store.
*   `quantityOnOrder` (_integer (int32)_, required) Product quantity on order for this store.