All eyes on AI: 2026 predictions – The shifts that will shape your stack.

Read now

Tutorial

Available to Promise in Real-time Inventory Using Redis

February 25, 202623 minute read
Prasan Rajpurohit
Prasan Rajpurohit
William Johnston
William Johnston
TL;DR:
Available-to-promise (ATP) is the projected inventory available to sell after accounting for existing allocations and expected supply. Redis enables real-time ATP by providing sub-millisecond reads and atomic inventory updates across all sales channels, so every customer sees accurate stock levels instantly.
GITHUB CODE
Below is a command to the clone the source code for the application used in this tutorial

#What you'll learn

  • What available-to-promise (ATP) means and how to calculate it
  • Why traditional inventory systems struggle with real-time accuracy
  • How Redis delivers sub-millisecond inventory checks across omnichannel sales
  • How to implement SKU retrieval, update, increment, and decrement operations with Redis
  • How to handle bulk inventory operations for multi-product orders

#What is available-to-promise (ATP)?

The major requirement in a retail inventory system is presenting an accurate, real-time view of inventory to shoppers and store associates enabling buy-online-pickup-in-store (BOPIS). Optimizing fulfillment from multiple inventory locations.
Available to promise (ATP) is the projected amount of inventory left available to sell, not including allocated inventory. It allows businesses to control distribution to their customers and predict inventory. The ATP model helps retailers keep inventory costs down such as ordering costs, carrying costs and stock-out costs. ATP is helpful as long as consumer buying forecasts remain correct. Implementing ATP processes effectively for retailers can mean the difference between sustained growth and an inventory that repeatedly runs out of customer's favorite products missing sales opportunities and harming customer experience.

#How do you calculate available-to-promise?

Calculating available-to-promise is a relatively simple undertaking. Complete the following formula for an accurate breakdown of available-to-promise capabilities:
This formula includes the following elements:
  • QuantityOnHand: the total number of products that are immediately available to a company
  • Supply: the total stock of a product available for sale
  • Demand: the amount of a specific product that consumers are willing to purchase

#What are the current challenges in real-time inventory?

  • Over and under-stocking: While adopting a multi-channel business model (online & in store), lack of inventory visibility results in over and under-stocking of inventory in different regions and stores.
  • Consumers seek convenience: The ability to search across regional store locations and pickup merchandise immediately rather than wait for shipping is a key differentiator for retailers. See how Redis powers local inventory search to enable this.
  • Consumers seek speed: All retailers, even small or family-run, must compete against the customer experience of large online retailers like Alibaba, FlipKart, Shopee, and Amazon.
  • High inventory costs: Retailers seek to lower inventory costs by eliminating missed sales from out-of-stock scenarios which also leads to higher "inventory turnover ratios."
  • Brand value: Inaccurate store inventory counts lead to frustrated customers and lower sales. The operational pain will impact the status quo.

#Why should you use Redis for available-to-promise?

  • Increased inventory visibility: Redis Cloud provides highly scalable, real-time inventory synchronization between stores providing views into what stock is Available-To-Promise. Customers want to buy from a retailer who can check stock across multiple locations and provide real-time views on what's available locally.
  • Enhanced customer experience: Sub-millisecond latency means online customers can easily get real-time views of shopping carts, pricing, and in stock availability. Redis Cloud built-in search engine delivers full text and aggregated faceted search of inventory in real time, scaling performance to instantly search inventories with millions of product types helping customers fill their shopping carts faster, keeping them engaged and loyal.
  • Cost efficiency at scale: Redis Cloud offers real-time, bi-directional consistency between stores and data integration capabilities with enterprise systems without the complexity and costs of managing message brokers, auditing, and reconciliation.

#How does real-time inventory work with Redis?

Architecture diagram showing how Redis synchronizes inventory data in real time across warehouses, stores, and online channels to calculate available-to-promise quantities
Using Redis, the system delivers real-time synchronization of inventory across stores, in transit and warehouses. It provides retailers the most accurate, timely data on inventory across their entire store network and gives consumers positive customer experiences searching and locating inventory.
Redis Data Integration (RDI) capabilities enable accurate real-time inventory management and system of record synchronization. Redis advanced inventory search and query capabilities provide accurate available inventory information to multichannel and omnichannel customers and store associates. For a detailed walkthrough of searching inventory by location, see the Real-time Local Inventory Search tutorial.
This solution increases inventory turnover ratios resulting in lower inventory costs, higher revenue and profits. It also reduces the impact of customer searches on Systems of Record and Inventory Management Systems (IMS).

#Customer proof points

#How do you manage SKU inventory operations with Redis?

GITHUB CODE
Below is a command to the clone the source code for the application used in this tutorial
Managing inventory or a SKU (stock keeping unit) process contains some activities like :
  1. RetrieveSKU : Fetch the current quantity of a product
  2. UpdateSKU : Update the latest quantity of a product
  3. IncrementSKU : Increment the quantity by a specific value (Say, when more products are procured)
  4. DecrementSKU : Decrement the quantity by a specific value (Say, after order fulfillment of the product)
  5. RetrieveManySKUs : Fetch the current quantity of multiple products (Say, to verify products in stock before payment)
  6. DecrementManySKUs: Decrement the quantity of multiple products (Say, after an order fulfillment with multiple products)

#How do you retrieve a single SKU?

The code that follows shows an example API request and response for retrieveSKU activity.

#retrieveSKU API Request

#retrieveSKU API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a retrieveSKU function which looks as follows:

#How do you update a SKU quantity?

The code that follows shows an example API request and response for updateSKU activity.

#updateSKU API Request

#updateSKU API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a updateSKU function which looks as follows:

#How do you increment a SKU quantity?

The code that follows shows an example API request and response for incrementSKU activity.

#incrementSKU API Request

#incrementSKU API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a incrementSKU function which looks as follows:

#How do you decrement a SKU quantity?

The code that follows shows an example API request and response for decrementSKU activity.

#decrementSKU API Request

#decrementSKU API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a decrementSKU function which looks as follows:

#How do you retrieve multiple SKUs at once?

The code that follows shows an example API request and response for retrieveManySKUs activity.

#retrieveManySKUs API Request

#retrieveManySKUs API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a retrieveManySKUs function which looks as follows:

#How do you decrement multiple SKUs at once?

The code that follows shows an example API request and response for decrementManySKUs activity.

#decrementManySKUs API Request

#decrementManySKUs API Response

When you make a request, it goes through the API gateway to the inventory service. Ultimately, it ends up calling a decrementManySKUs function which looks as follows:

#Next steps

Now that you understand how to build an available-to-promise inventory system with Redis, here are some ways to go further:
  • Add location-based inventory search: Learn how to let customers find products at nearby stores with the Real-time Local Inventory Search tutorial.
  • Explore Redis Insight: Use Redis Insight to visualize your inventory data and test raw Redis commands in the workbench.
  • Try Redis Cloud: Get started with a free instance on Redis Cloud to deploy your inventory system.
  • Learn more about Redis clients: Explore clients like Node Redis and Redis OM for Node.js used in this tutorial.
  • Watch and learn: Visit the Redis YouTube channel for video walkthroughs and architecture deep dives.