Kibo Locations API Developer Guide
Fulfillment
Understand how location groups fit into fulfillment
Location Types
Manage location groups in the Admin UI
Understanding Locations in Kibo
In Kibo, a Location is a fundamental concept representing any physical place relevant to your commerce operations. This isn’t limited to just warehouses; a location can be a retail store, a distribution center, a third-party logistics (3PL) partner, or even a temporary pop-up shop. Each location has its own inventory and fulfillment capabilities. Building on this, a Location Group is a logical collection of these individual locations. Instead of managing dozens or hundreds of stores one by one, you can group them into logical sets like “West Coast Stores,” “Outlet Locations,” or “Ship-from-Store Network.” These groups are not just for organization; they are the engine that drives sophisticated inventory sourcing, order fulfillment routing, and multi-site experiences in Kibo.How This Domain Fits Into Kibo
The Locations domain is the backbone of Kibo’s distributed order management and fulfillment capabilities. Location Groups, in particular, are the glue that connects physical locations to your digital strategy.- Inventory: Location Groups allow you to present an aggregated view of inventory to shoppers. For example, a “Texas Stores” group can show the combined stock of all locations in Texas for in-store pickup.
- Fulfillment & Orders: During order processing, Kibo’s routing engine uses Location Groups to determine the best place to fulfill an order from. You can define rules like “Fulfill online orders from the ‘Main Warehouses’ group first.”
- Multi-Site: You can use Location Groups to control which locations are active or visible on different websites (Channels). Your B2B site might only use warehouse locations, while your B2C site uses both warehouses and retail stores for fulfillment.
Prerequisites
- Kibo API credentials with appropriate administrative permissions.
- 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 Location and Location Group data (based on official API specs).
- The key patterns Kibo uses for managing location groups (verified from apidocs.kibocommerce.com).
- Common workflows like creating, viewing, and updating location groups (with accurate, tested examples).
- How to avoid the most common beginner mistakes.
- How to read and navigate the official API documentation for Location administration.
Kibo Location Group Fundamentals
How Kibo Organizes Location Data
Kibo’s Location Group data is straightforward and powerful. The core object is theLocationGroup.
LocationGroup: The central object representing your logical grouping.locationGroupCode: A unique, human-readable identifier that you define (e.g.,WEST_COAST_STORES). This is the primary key you’ll use in API calls.name: A friendly name for display in the Kibo Admin UI (e.g., “West Coast Stores”).locationCodes: This is the most important field—an array of strings, where each string is thelocationCodeof an individual Location you want to include in this group.siteIDs: An optional array of site IDs that this location group is associated with, used for multi-site configurations.
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 the LocationGroupApi client. The client automatically handles the OAuth 2.0 token exchange for every API call.
Request/Response Structure:
API responses for Location Groups are clean and predictable. When you create a location group, the API returns the full object you just created, including any server-assigned values.
VALIDATION_ERROR if one of the locationCodes you provided doesn’t actually exist in Kibo.
Pagination and Filtering:
When getting a list of location groups, the API uses standard pageSize and startIndex parameters to manage the results.
API Documentation Reference:
Throughout this guide, we’ll reference specific endpoints. Find complete specs under the “Tenant” administration section, as Location Groups are a tenant-level concept.
/api-reference/locationgroup/get-location-groups
Common Location Group Workflows
Kibo developers typically work with Location Groups in these scenarios:- Initial Setup: Programmatically creating location groups as part of an initial environment setup or migration.
- Dynamic Updates: Adding or removing a store from a group when a new store opens or an old one closes.
- Auditing and Reporting: Fetching all location group configurations to integrate with an external reporting or analytics tool.
Adding a Location Group: The Kibo Way
When You Need This
This is the foundational “create” operation. You’ll use this anytime you need to define a new logical grouping of stores for fulfillment, inventory, or site visibility. For example, you might create a new group for an upcoming holiday season to manage a specific set of pop-up shops.API Documentation Reference
- Endpoint:
POST /api/platform/admin/locationgroups - Method:
POST - SDK Method:
addLocationGroup - API Docs: Add Location Group
Understanding the Kibo Approach
Kibo treats Location Group creation as a simple, atomic operation. You provide all the necessary information in a single payload: the unique code, the name, and the list of individual location codes that will belong to the group. The API validates that all the specified locations exist before creating the group, ensuring data integrity.Code Structure Walkthrough
Step-by-Step Implementation
Step 1: Setting Up the FoundationWhat Just Happened? (Code Explanation)
- The setup phase created the
Configurationobject. Note that managing tenant-level objects likeLocationGroupmay require API credentials with broader permissions than storefront-only credentials. - The API call was made using an instance of
LocationGroupApi, which is the specific client for these operations. - The payload was a
LocationGroupobject. We defined our own uniquelocationGroupCodeand provided the list of existinglocationCodesto include. - The response handling uses a
try...catchblock. On success, Kibo returns the group object we just created. On failure, we check for a specificITEM_ALREADY_EXISTSerror to provide a more helpful message.
Common Beginner Mistakes
Mistake 1: Trying to create a group with non-existent location codes.LocationApi to list existing locations to verify codes.
Mistake 2: Using the wrong API client.
The LocationGroupApi is under the @kibocommerce/rest-sdk/clients/Tenant import, not Commerce or CatalogAdministration. Because groups are a foundational, tenant-wide setting, they are managed through the Tenant APIs.
Multiple Real-World Examples
Here are 5 complete, production-ready examples for commonLocation Group operations.
Example 1: Get a Specific Location Group
Fetch the configuration for a single, known location group. This is useful for checking details before an update.- API Docs: Get Location Group
Example 2: Update a Location Group (Add a New Store)
This covers the common scenario of opening a new store and adding it to an existing fulfillment group.- API Docs: Update Location Group
Example 3: List All Location Groups
A utility function to get a high-level overview of all location groups configured in the tenant.- API Docs: Get Location Groups
Example 4: Remove a Store from a Location Group
The inverse of Example 2, this is for when a store closes or is no longer part of a specific fulfillment strategy.Example 5: Delete a Location Group
Permanently remove a location group. This does not delete the individual locations within it.- API Docs: Delete Location Group
Troubleshooting Your Location Group Implementation
Reading Kibo Error Messages
ITEM_NOT_FOUND: You tried to get, update, or delete a location group using alocationGroupCodethat does not exist.ITEM_ALREADY_EXISTS: You tried toaddLocationGroupwith alocationGroupCodethat is already in use. Codes must be unique.VALIDATION_ERROR: The request body is invalid. The most common cause is including alocationCodein thelocationCodesarray that does not correspond to an existing Location in your Kibo tenant.REQUIRED_FIELD_MISSING: You tried to create a group without alocationGroupCodeorname.
Common Development Issues
Issue 1: MyupdateLocationGroup call is wiping out other settings.
- Why it happens: The
PUToperation for updating a location group expects the entireLocationGroupobject in the payload. If you send only the field you want to change (e.g.,{ "locationCodes": [...] }), Kibo will interpret the missing fields (likename) as null and clear them. - How to fix it: Always perform a
GETon the location group first, modify the retrieved object in your code, and thenPUTthe complete, modified object back. - How to avoid it: Follow the “Read-Modify-Write” pattern shown in Examples 2 and 4.
- Why it happens: Creating a
LocationGroupis just step one. You also need to configure Kibo’s Order Management system to use that group in its fulfillment logic. - How to fix it: In the Kibo Admin, navigate to Main > Orders > Settings. Here you can configure Order Routing and define which location groups should be used for sourcing inventory.
- API Reference: The APIs for managing fulfillment settings are separate from the
LocationGroupApi. Look under theCommerce/SettingsandCommerce/OrdersAPI groups for more advanced configuration.
Debugging Checklist
- Check the
locationGroupCode: Is it an exact string match, including case? - Validate
locationCodes: Before creating or updating a group, are you sure every singlelocationCodein your array exists in the Kibo tenant? - Verify API Client: Are you using
LocationGroupApifrom the@kibocommerce/rest-sdk/clients/Tenantpackage? - Check Permissions: Do your API credentials have the necessary administrative permissions to manage tenant-level settings?
- Use the Read-Modify-Write Pattern: For updates, are you fetching the object first to avoid accidental data loss?

