Kibo Inventory API Developer Guide
Inventory Overview
Understand inventory architecture and concepts
Safety Stock Rules
Configure safety stock thresholds in the Admin UI
View Inventory Segments
View and manage inventory segments in the Admin UI
Inventory Attributes
Configure inventory attributes in the Admin UI
Inventory Workflow Examples
See practical examples of inventory workflows
Real-Time Inventory Service APIs
Understand real-time inventory service architecture
Understanding Inventory in Kibo
In Kibo, “Inventory” is not just a single number representing a product’s stock. It’s a sophisticated, location-aware system designed for modern, multi-channel commerce. Kibo’s fundamental approach is that inventory only exists in the context of a Location. A product doesn’t have a single “stock” value; it has specific quantities available at different fulfillment centers, retail stores, or warehouses. This location-centric model allows Kibo to power complex fulfillment logic like ship-from-store, buy-online-pickup-in-store (BOPIS), and intelligent order routing. For a developer, the key takeaway is to always think in terms of “What is the inventory of this product at this specific location?”How This Domain Fits Into Kibo
The Inventory domain is a core service that underpins the entire commerce lifecycle. It’s the source of truth for product availability.- Catalog & Search: The inventory level of a product determines if it can be purchased. Products with zero inventory across all locations are often displayed as “Out of Stock”.
- Cart & Checkout: Before a customer can add an item to their cart, Kibo performs a real-time inventory check.
- Orders: When an order is placed, Kibo creates an inventory reservation against a specific location’s stock, effectively earmarking that unit so it can’t be sold to someone else.
- Fulfillment: Once an order is ready for shipment, the reservation is converted to a final inventory deduction from the fulfillment location.
Prerequisites
- Kibo API credentials and basic setup (Tenant ID, Site ID, Client ID, Shared Secret).
- Node.js 16+ with TypeScript.
- Familiarity with REST APIs and
async/await.
What You’ll Learn
After completing this guide, you’ll understand:- How Kibo structures Inventory data, including the importance of locations (based on official API specs).
- The key patterns Kibo uses for inventory lookups and updates (verified from apidocs.kibocommerce.com).
- Common workflows like checking stock, making adjustments, and setting up automated exports (with accurate, tested examples).
- How to avoid the most common beginner mistakes.
- How to read and navigate the official API documentation for the Inventory domain.
Kibo Inventory Fundamentals
How Kibo Organizes Inventory Data
Kibo’s Inventory data model is designed for scalability and real-time accuracy. The core entities are:ItemQuantity: The central object representing the stock level of a single product (partNumberorupc) at a specificlocationCode. It contains values likeonHand,available, andonOrder.Location: A physical place that holds stock. This could be a warehouse, a retail store, or a third-party logistics (3PL) provider. Every inventory record is tied to a location code.Job: For large-scale inventory updates (e.g., importing a file with thousands of records), Kibo uses an asynchronousJobsystem. You submit a file or request, and Kibo processes it in the background. You can then query the job’s status to see if it succeeded or failed.Export/Fetch Settings: Configuration objects that allow you to automate inventory data exchange. You can set up Kibo to automatically export an inventory file to an FTP/SFTP server on a schedule, or fetch and import a file from a remote source.
Key Kibo Patterns You’ll See Everywhere
Before we write code, understand these patterns that appear in every Kibo API: Authentication Pattern: The Kibo SDK manages authentication for you. You create a singleConfiguration object containing your credentials. This object is then passed to the constructor of specific API clients (e.g., new InventoryApi(configuration)). The clients handle the OAuth 2.0 token exchange for every API call.
Request/Response Structure:
Kibo’s Inventory API is optimized for bulk operations. When you request inventory for multiple products, the response is a well-structured collection.
ITEM_NOT_FOUND if you request a product that doesn’t exist in the catalog or LOCATION_NOT_FOUND for an invalid location code.
Pagination and Filtering:
When getting a list of inventory jobs (getJobs), the API uses standard pageSize and startIndex parameters to manage large result sets.
API Documentation Reference:
Throughout this guide, we’ll reference specific endpoints. Find complete specs under the “Inventory” section at:
/developer-guides/inventory
Common Inventory Workflows
Kibo developers typically work with Inventory in these scenarios:- Real-time Stock Lookups: A storefront checking if a product is available for purchase or in-store pickup.
- Incremental Adjustments: A warehouse management system (WMS) notifying Kibo of a small change, like receiving a return.
- Full Inventory Synchronization: A master ERP system sending a file to Kibo to overwrite and set the absolute source of truth for all stock levels.
Getting Inventory (POST): The Kibo Way
When You Need This
This is the most efficient way to check stock for multiple products across multiple locations in a single API call. It’s ideal for a product detail page that needs to show “Check availability in nearby stores” or for a backend process that needs to verify stock for a list of SKUs. TheGET endpoint is better for fetching all inventory at a single location.
API Documentation Reference
- Endpoint:
POST /api/commerce/inventory/v1/inventory - Method:
POST - SDK Method:
postQueryInventory - API Docs: Query Inventory
Understanding the Kibo Approach
Kibo provides aPOST endpoint for inventory lookups to handle complex queries that would be difficult to express in a URL. By sending a list of products and locations in the request body, you avoid making dozens of individual GET requests, which is much more performant and less taxing on both your application and the Kibo API.
Code Structure Walkthrough
Step-by-Step Implementation
Step 1: Setting Up the FoundationWhat Just Happened? (Code Explanation)
- The setup phase created the
Configurationobject required for authentication. - The API call used an instance of
InventoryApiand itspostQueryInventorymethod. - The payload was an
InventoryRequestobject containing the specific products and locations we were interested in. This is Kibo’s pattern for efficient, targeted lookups. - The response handling parsed the returned collection, which groups the inventory results by
locationCode, making it easy to process.
Common Beginner Mistakes
Mistake 1: Making multipleGET requests instead of a single POST.
onHand vs. available.
onHand: The total physical quantity of an item at a location.available: The quantity that is actually available for sale. This is typicallyonHandminus anyreservationsfor open orders. You should almost always useavailablefor storefront logic.
Multiple Real-World Examples
Here are 5 complete, production-ready examples for commonInventory operations.
Example 1: Make an Incremental Stock Adjustment
Use this to report small changes, like when a damaged item is removed from stock or a return is processed. This adds or subtracts from the current quantity.- API Docs: Adjust Inventory
Example 2: Set the Absolute Stock Quantity (Refresh)
Use this when you want to set the absolute stock level from a master system, overriding whatever value Kibo currently has. This is a “set” operation, not an “add/subtract”.- API Docs: Refresh Inventory
Example 3: Create an Automated Daily Inventory Export
This sets up a recurring job in Kibo to automatically generate an inventory report and upload it to an FTP/SFTP server.- API Docs: Create Export Settings
Example 4: Check the Status of Inventory Jobs
After an export runs (or you submit a large import), you can check the status of the background job.- API Docs: Get Jobs
Example 5: Configure an Automated Inventory Fetch Job
This tells Kibo to periodically check an SFTP server for a file, download it, and import it. This is the inverse of an export.- API Docs: Save Fetch File Config
Integrating Inventory with Other Kibo Domains
Inventory + Orders Integration
This is the primary integration. When a customer places an order, Kibo’s order management system automatically creates an inventory reservation for each item in the order against a specific location’s stock. Thisavailable quantity is immediately reduced. When the order is fulfilled (shipped), the onHand quantity is then decremented. This ensures you never oversell a product.
Inventory + Catalog Integration
The inventory level directly impacts how products are displayed on the storefront. You can configure your Kibo site theme to:- Show “Out of Stock” badges.
- Hide the “Add to Cart” button.
- Display low stock warnings (“Only 3 left!”).
This is typically handled by checking the
availablecount of a product returned from the Catalog APIs, which internally query the Inventory service.
Troubleshooting Your Inventory Implementation
Reading Kibo Error Messages
ITEM_NOT_FOUND: ThepartNumberorupcyou sent does not exist in the Kibo catalog.LOCATION_NOT_FOUND: ThelocationCodeis invalid or not active.VALIDATION_ERROR: The request body is malformed. Theitemsarray in the error response will often pinpoint the exact field that is wrong.JOB_ALREADY_EXISTS: When creating an export setting, thenameyou provided is already in use.
Common Development Issues
Issue 1: Inventory updates seem delayed or are not appearing.- Why it happens: Large inventory updates via file import are processed asynchronously by Kibo’s job system. It can take a few minutes for the job to be picked up and processed, especially in a busy environment.
- How to fix it: After submitting an import, use the
getJobsendpoint to monitor the status of the job. Don’t assume the update is instantaneous. Look for the job to reach aCOMPLETEDstatus. - API Reference: Get Jobs
Adjust and Refresh?
- Why it happens: This is a common point of confusion. Using the wrong one can lead to incorrect inventory levels.
- How to fix it:
- Use
Adjustfor incremental changes. It’s a+or-operation. Example: “Received 5 new units,” or “Removed 1 damaged unit.” - Use
Refreshfor absolute changes. It’s asetoperation. Example: “Our master system says there are exactly 100 units. Make Kibo match this number, regardless of what it was before.”
- Use
- How to avoid it: For daily syncs from an ERP or master system, always use
Refresh. For real-time updates from a WMS based on individual events (like receiving a shipment), useAdjust.
Debugging Checklist
- Check Location Codes: Are the
locationCodestrings you’re sending an exact match for the codes set up in Kibo Admin? - Check Product Identifiers: Do the
partNumberorupcvalues exist in the Master Catalog? - Monitor Jobs: For file-based imports/exports, are you checking the
JobApifor the status? Look forFAILEDjobs and inspect their details. - Verify Payloads:
console.logyour request body before sending it. Does it exactly match the schema shown in the API documentation? - Check
availablevs.onHand: Are you looking at the correct inventory field for your use case? (Storefronts useavailable, backend reports might useonHand). - Review Cron Expressions: For scheduled jobs, double-check your cron syntax. An invalid expression will prevent the job from ever running.

