Real-Time Inventory Service APIs

The Real-Time Inventory Service APIs provide accurate and real-time inventory visibility to your e-commerce site. These APIs give information such as Get Group Site Availability,  Get Product Site Availability, Get Product Availability at Locations, and Get Group Product Availability at Location.

Refer to the Real-time Inventory topic for more information.

You can either run using REST or GraphQL queries. GraphQL queries should be made as a POST call to this endpoint:

.../api/commerce/realtime-inventory/graphql

The RIS GraphQL queries are externally available and Order Management clients can take advantage of them to drive their storefront experience.   You can directly call the RIS queries for your Product Listing Pages or Product Details Pages pages.

The request body varies depending on the specific query, as shown in the following sections.

Get Inventory API

The Get Inventory API call also provides RIS data. For more detailed information about this request, please refer to the GET Inventory API document.

Here are some scenarios to consider when deciding between GraphQL and the Inventory REST query:

  • Use GraphQL storefront RIS queries when you have a very specific request and require high performance.
  • Use the Get Inventory call when you have a considerable amount of information to retrieve and prefer fetching it with a single request.

The RIS version of the Get Inventory API is not enabled for all clients yet. Kibo is transitioning all clients to the new version of Get Inventory. Contact Kibo Support if you have any questions.

Get Group Site Availability

This query gets the product availability across the site for multiple product codes.

GraphQL Request Body:

The includeNegativeInventory field defaults to false.

query{ getGroupSiteAvailability(productCodes: [String!], includeNegativeInventory: Boolean): GroupedProductAvailability}

Example of GraphQL Response Body:

{
        "data": {
            "getGroupSiteAvailability": {
                "quantity": "<BigInt>",
                "isAvailable": "<Boolean>",
                "products": [
                    {
                        "productCode": "<String>",
                        "quantity": "<BigInt>",
                        "isAvailable": "<Boolean>",
                        "segments": [
                            {
                                "tags": [
                                    {
                                        "category": "<String>",
                                        "tag": "<String>"
                                    }
                                ],
                                "quantity": "<BigInt>",
                                "isAvailable": "<Boolean>",
                                "sthFulfillmentDate": "<OffsetDateTime>",
                                "bopisFulfillmentDate": "<OffsetDateTime>",
                                "transferFulfillmentDate": "<OffsetDateTime>",
                                "sthProcessingTimeHours": "<BigInt>",
                                "bopisProcessingTimeHours": "<BigInt>",
                                "transferProcessingTimeHours": "<BigInt>",
                                "futureInventory": [
                                    {
                                        "isAvailable": "<Boolean>",
                                        "quantity": "<BigInt>",
                                        "incomingFutureInventoryDate": "<OffsetDateTime>",
                                        "sthFulfillmentDate": "<OffsetDateTime>",
                                        "bopisFulfillmentDate": "<OffsetDateTime>",
                                        "transferFulfillmentDate": "<OffsetDateTime>",
                                        "sthProcessingTimeHours": "<BigInt>",
                                        "bopisProcessingTimeHours": "<BigInt>",
                                        "transferProcessingTimeHours": "<BigInt>"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    }

REST API Request Endpoint (POST): 

/api/storefront/site/availability/productCode?includeNegativeInventory=<boolean>
http://services-tp.dev02.kubedev.kibo-dev.com/kibo-realtime-inventory/api/storefront/site/availability?includeNegativeInventory=true

The following are headers for API operation. 

HeaderTypeDescription
x-vol-tenantrequest and responseThe unique identifier of the tenant. This number appears in your site’s URL in Admin, preceded by a "t". For example: https://t0000.sandbox.mozu.com/Admin/m-1/ in a sandbox environment.
x-vol-siterequest and responseThe unique identifier of the site. This number can be found in the URL of the live site as well as some areas of the Admin, such as under System > Structure > Site, preceded by an "s-". For example: https://t0000.sandbox.mozu.com/Admin/s-11111/website in a sandbox environment.

Example Request Body:

{
  "includeNegativeInventory": "<boolean>",
  "productCodes": [
    "<string>",
    "<string>"
  ]
}

Example Response Body:

{
  "quantity": "<integer>",
  "isAvailable": "<boolean>",
  "products": [
    {
      "quantity": "<integer>",
      "isAvailable": "<boolean>",
      "productCode": "<string>"
    },
    {
      "quantity": "<integer>",
      "isAvailable": "<boolean>",
      "productCode": "<string>"
    }
  ]
}

Get Product Site Availability

This query gets the product availability across the site for a particular product code.

Request Body:

The includeNegativeInventory field defaults to false. 

query{ getProductSiteAvailability(productCode: String!, includeNegativeInventory: Boolean): AvailableQuantity } 

Example Response Body:

{
    "data": {
        "getProductSiteAvailability": {
            "quantity": "<BigInt>",
            "isAvailable": "<Boolean>",
            "segments": [{
                "tags": [{
                    "category": "<String>",
                    "tag": "<String>"
                }],
"quantity": "<BigInt>",
                "isAvailable": "<Boolean>",
                "sthFulfillmentDate": "<OffsetDateTime>",
                "bopisFulfillmentDate": "<OffsetDateTime>",
                "transferFulfillmentDate": "<OffsetDateTime>",
                "sthProcessingTimeHours": "<BigInt>",
                "bopisProcessingTimeHours": "<BigInt>",
                "transferProcessingTimeHours": "<BigInt>",
                "futureInventory": [{
                    "isAvailable": "<Boolean>",
                    "quantity": "<BigInt>",
                    "incomingFutureInventoryDate": "<OffsetDateTime>",
                    "sthFulfillmentDate": "<OffsetDateTime>",
                    "bopisFulfillmentDate": "<OffsetDateTime>",
                    "transferFulfillmentDate": "<OffsetDateTime>",
 }]
            }]
        }
    }
}

REST API Endpoint (GET):

/api/storefront/site/availability/productCode?includeNegativeInventory=false

Example Response Body:

{
  "quantity": "<integer>",
  "isAvailable": "<boolean>"
}

Get Product Availability at Locations

This query gets the availability for a product across multiple location codes. 

Request Body: 

query{ getProductAvailabilityAtLocations(productCode: String!, locationCodes: [String!]): ProductAvailabilityAtLocations}  

Example Response Body:

{ 
  "data": { 
    "getProductAvailabilityAtLocations": { 
      "locations": [ 
        { 
          "locationCode": "B", 
          "quantity": "117", 
          "isAvailable": true, 
          "productDetails": { 
            "partNumber": "mike_test_1", 
            "sku": "mike_test_1" 
          } 
        } 
      ] 
    } 
  } 
} 

REST API Endpoint (GET): 

/api/storefront/availability/locations/product/productCode?locationCodes=A,8

The following are headers for API operation. 

HeaderTypeDescription
x-vol-tenantrequest and responseThe unique identifier of the tenant. This number appears in your site’s URL in Admin, preceded by a "t". For example: https://t0000.sandbox.mozu.com/Admin/m-1/ in a sandbox environment.
x-vol-siterequest and responseThe unique identifier of the site. When you log in to Admin, this number appears in the URL preceded by an "s-". For example: https://t0000.sandbox.mozu.com/Admin/s-11111/website in a sandbox environment.

Example Response Body:

{
  "productCode": "<string>",
  "locations": [
    {
      "quantity": "<integer>",
      "isAvailable": "<boolean>",
      "productCode": "<string>",
      "locationCode": "<string>",
      "productDetails": {
        "sku": "<string>",
        "partNumber": "<string>"
      }
    },
    {
      "quantity": "<integer>",
      "isAvailable": "<boolean>",
      "productCode": "<string>",
      "locationCode": "<string>",
      "productDetails": {
        "sku": "<string>",
        "partNumber": "<string>"
      }
    }
  ]
}

Get Group Availability at Locations

This query gets the availability for multiple product codes or variants across multiple location codes. 

Request Body:

query{ getGroupAvailabilityAtLocations(productCodes: [String!], locationCodes: [String!]): [ProductAvailabilityAtLocations] }

Example Response Body:

{
  "data": {
    "getGroupAvailabilityAtLocations": [
      {
        "productCode": "<String>",
        "locations": [
          {
            "locationCode": "<String>",
            "quantity": "<BigInt>",
            "isAvailable": "<Boolean>",
            "sthFulfillmentDate": "<OffsetDateTime>",
            "bopisFulfillmentDate": "<OffsetDateTime>",
            "transferFulfillmentDate": "<OffsetDateTime>",
            "sthProcessingTimeHours": "<BigInt>",
            "bopisProcessingTimeHours": "<BigInt>",
            "transferProcessingTimeHours": "<BigInt>",
            "productDetails": {
              "partNumber": "<String>",
              "sku": "<String>"
            },
            "segments": [
              {
                "tags": [
                  {
                    "category": "<String>",
                    "tag": "<String>"
                  }
                ],
                "quantity": "<BigInt>",
                "isAvailable": "<Boolean>",
                "sthFulfillmentDate": "<OffsetDateTime>",
                "bopisFulfillmentDate": "<OffsetDateTime>",
                "transferFulfillmentDate": "<OffsetDateTime>",
                "sthProcessingTimeHours": "<BigInt>",
                "bopisProcessingTimeHours": "<BigInt>",
                "transferProcessingTimeHours": "<BigInt>",
                "futureInventory": {
                  "isAvailable": "<Boolean>",
                  "quantity": "<BigInt>",
                  "incomingFutureInventoryDate": "<OffsetDateTime>",
                  "sthFulfillmentDate": "<OffsetDateTime>",
                  "bopisFulfillmentDate": "<OffsetDateTime>",
                  "transferFulfillmentDate": "<OffsetDateTime>",
                  "sthProcessingTimeHours": "<BigInt>",
                  "bopisProcessingTimeHours": "<BigInt>",
                  "transferProcessingTimeHours": "<BigInt>"
                }
              }
            ],
            "futureInventory": {
              "isAvailable": "<Boolean>",
              "quantity": "<BigInt>",
              "incomingFutureInventoryDate": "<OffsetDateTime>",
              "sthFulfillmentDate": "<OffsetDateTime>",
              "bopisFulfillmentDate": "<OffsetDateTime>",
              "transferFulfillmentDate": "<OffsetDateTime>",
              "sthProcessingTimeHours": "<BigInt>",
              "bopisProcessingTimeHours": "<BigInt>",
              "transferProcessingTimeHours": "<BigInt>"
            }
          }
        ]
      }
    ]
  }
}

REST API Request Endpoint (GET): 

/api/storefront/availability/locations/products

The following are headers for API operation. 

HeaderTypeDescription
x-vol-tenantrequest and responseThe unique identifier of the tenant. This number appears in your site’s URL in Admin, preceded by a "t". For example: https://t0000.sandbox.mozu.com/Admin/m-1/ in a sandbox environment.
x-vol-siterequest and responseThe unique identifier of the site. When you log in to Admin, this number appears in the URL preceded by an "s-". For example: https://t0000.sandbox.mozu.com/Admin/s-11111/website in a sandbox environment.

Example Request Body:

{
  "productCodes": [
    "<string>",
    "<string>"
  ],
  "locationCodes": [
    "<string>",
    "<string>"
  ]
}

Example Response Body:

[
  {
    "productCode": "<string>",
    "locations": [
      {
        "quantity": "<integer>",
        "isAvailable": "<boolean>",
        "productCode": "<string>",
        "locationCode": "<string>",
        "productDetails": {
          "sku": "<string>",
          "partNumber": "<string>"
        }
      },
      {
        "quantity": "<integer>",
        "isAvailable": "<boolean>",
        "productCode": "<string>",
        "locationCode": "<string>",
        "productDetails": {
          "sku": "<string>",
          "partNumber": "<string>"
        }
      }
    ]
  },
  {
    "productCode": "<string>",
    "locations": [
      {
        "quantity": "<integer>",
        "isAvailable": "<boolean>",
        "productCode": "<string>",
        "locationCode": "<string>",
        "productDetails": {
          "sku": "<string>",
          "partNumber": "<string>"
        }
      },
      {
        "quantity": "<integer>",
        "isAvailable": "<boolean>",
        "productCode": "<string>",
        "locationCode": "<string>",
        "productDetails": {
          "sku": "<string>",
          "partNumber": "<string>"
        }
      }
    ]
  }
]

Get Group Available Locations

This query gets the locations of available inventory for specific fulfillment types. This supports an ANY query which is a union across multiple locations. It also supports an ALL query which is the intersection across multiple locations.

Possible values for productSearchType options are "all", "any", "partial", and "all_stores".

Request Body:

The fulfillment types are "PICKUP" and "DIRECT_SHIP".

query{ getGroupAvailableLocations(fulfillmentTypes: [FulfillmentType!], productCodes: [String!], productSearchType: ProductSearchType): AvailableLocationsResponse } 

Example Response Body:

{ 
  "data": { 
    "getGroupAvailableLocations": { 
      "locationCodes": [ 
        "P", 
        "A", 
        "B", 
        "D", 
        "E", 
        "V", 
        "G", 
        "I", 
        "K", 
        "M", 
        "O" 
      ] 
    } 
  } 
}

REST API Request Endpoint (POST):

/api/strorefront/locations

http://services-tp.dev02.kubedev.kibo-dev.com/kibo-realtime-inventory/api/storefront/locations

The following are headers for API operation. 

HeaderTypeDescription
x-vol-tenantrequest and responseThe unique identifier of the tenant. This number appears in your site’s URL in Admin, preceded by a "t". For example: https://t0000.sandbox.mozu.com/Admin/m-1/ in a sandbox environment.
x-vol-siterequest and responseThe unique identifier of the site. When you log in to Admin, this number appears in the URL preceded by an "s-". For example: https://t0000.sandbox.mozu.com/Admin/s-11111/website in a sandbox environment.

Example Request Body:

{
  "fulfillmentTypes": [
    "PICKUP",
    "DIRECT_SHIP"
  ],
  "productCodes": [
    "<string>",
    "<string>"
  ],
  "productSearchType": "all"
}

Example Response Body:

{
  "locationCodes": [
    "<string>",
    "<string>"
  ]
}

Get Group Available Pickup Locations

This query gets the pickup locations of available inventory for only returns pickup locations. This supports ANY query which is a union across multiple locations. It also supports an ALL which is the intersection across multiple locations.

Request Body: 

query{ getGroupAvailablePickupLocations(productCodes: [String!]): PickupLocationsResponse}

Example Response Body:

{
  "data": {
    "getGroupAvailablePickupLocations": {
      "productCode": "<String>",
      "pickupLocations": [
        {
          "locationCode": "<String>",
          "address": "<String>",
          "hoursOfOperation": "<String>",
          "isAvailableForPickup": "<Boolean>",
          "sthPickupDate": "<OffsetDateTime>",
          "bopisPickupDate": "<OffsetDateTime>",
          "transferPickupDate": "<OffsetDateTime>",
          "productDetails": {
            "partNumber": "<String>",
            "sku": "<String>"
          }
        },
        {
          "locationCode": "<String>",
          "address": "<String>",
          "hoursOfOperation": "<String>",
          "isAvailableForPickup": "<Boolean>",
          "sthPickupDate": "<OffsetDateTime>",
          "bopisPickupDate": "<OffsetDateTime>",
          "transferPickupDate": "<OffsetDateTime>",
          "productDetails": {
            "partNumber": "<String>",
            "sku": "<String>"
          }
        }
      ]
    }
  }
}