Kibo Shipment Packages API Developer Guide
Fulfillment
Understand fulfillment architecture and concepts
Multi Piece Shipments
Configure multi-piece shipments in the Admin UI
Understanding Shipment Packages in Kibo
In Kibo, it’s essential to distinguish between a Shipment and a Package. A Shipment is an abstract concept representing a group of items from an order that are being fulfilled together. A Package, the focus of this guide, is the tangible, physical box that you put those items into. You can have a single shipment that is split across multiple packages, each with its own dimensions, weight, and tracking number. What makes Kibo’s approach different is that creating a Package is a distinct, explicit step in the fulfillment workflow. It’s the point where the abstract “shipment” becomes a real-world object ready for a shipping label. This explicit step allows for granular control over the packing process and precise communication with shipping carriers.How This Domain Fits Into Kibo
The Shipment Packages domain is a key part of the Fulfillment process and is tightly coupled with the Order domain. It represents the final stage of preparing an order for dispatch.- Fulfillment & Shipments: A
Packageis always a child of aShipment. You cannot create a package without first having a shipment to associate it with. The shipment dictates what items need to be packed, and the package records how they are packed. - Orders: Creating packages and generating shipping labels are key steps that trigger order status updates. Once a package has a shipping label, the associated shipment is typically marked as “Fulfilled,” and the customer is notified with the tracking information.
- Carrier Integration: The details you provide when creating a package (like weight and dimensions) are sent directly to integrated shipping carriers (like FedEx or UPS) to generate accurate shipping labels and rates.
Prerequisites
- Kibo API credentials and basic setup
- Node.js 16+ with TypeScript
- Familiarity with REST APIs
What You’ll Learn
After completing this guide, you’ll understand:- How Kibo models physical packages as distinct objects within a shipment (based on official API specs).
- The key patterns for creating, updating, and deleting packages as part of the fulfillment process (verified from apidocs.kibocommerce.com).
- The common workflow for packing items and preparing a shipment for label generation.
- How to avoid the most common beginner mistakes, like trying to create a package for a shipment that isn’t ready.
- How to read and navigate the official Shipments API documentation effectively.
Kibo Shipment Packages Fundamentals
How Kibo Organizes Package Data
The data model is hierarchical and straightforward:Order: Contains one or moreShipments.Shipment: A group of items to be fulfilled. It is identified by ashipmentNumber. A shipment must be in the “Ready” state before you can create packages for it.Package: The core object of this guide. It is a child of aShipmentand is identified by a system-generatedpackageId. Its key properties include:packagingType: A string indicating the type of box (e.g., “Custom” or a carrier-specific type like “FedEx_Box”).measurements: An object containing theweightandlength,width,height.items: An array specifying which items from the parent shipment (and in what quantity) are in this specific box.
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 (Client ID, Shared Secret, etc.). This object is then passed to the constructor of specific API clients (e.g., new ShipmentApi(configuration)).
Request/Response Structure:
When you create a new package, the API returns the complete Package object, including its newly assigned packageId.
VALIDATION_ERROR if you try to create a package for a shipment that is not yet in a “Ready” state.
/developer-guides/shipments
Common Shipment Package Workflows
- Standard Fulfillment: A warehouse worker scans the items for a shipment, puts them in a box, weighs it, and a system calls the API to create the package record before generating a shipping label.
- Multi-Package Shipment: An order for one large item and one small item is fulfilled in two separate boxes. Two
Packageobjects are created under the sameShipment, each containing the appropriate item and its own dimensions. - Correcting Mistakes: A worker realizes they used the wrong box size. A system calls the API to update the package with the correct dimensions before the shipping label is created.
New Shipment Package: The Kibo Way
When You Need This
This is the core operation in the packing process. You need this after you have physically placed items into a box and are ready to record its contents, weight, and dimensions in Kibo. This is the prerequisite for generating a shipping label.API Documentation Reference
Endpoint:POST /commerce/shipments/{shipmentNumber}/packages
Method: POST
API Docs: /developer-guides/shipments#new-shipment-package
Understanding the Kibo Approach
Kibo requires you to be explicit about what is in each box. The API call to create a package requires you to specify which items from the parent shipment are included. This creates a detailed digital packing slip for each physical package, which is useful for accurate tracking, customer service, and managing claims with carriers if a package is lost or damaged.Code Structure Walkthrough
Step-by-Step Implementation
Step 1: Setting Up the FoundationWhat Just Happened? (Code Explanation)
- The setup phase created the standard
Configurationobject. - We used an instance of
ShipmentApi, as all package operations are nested under shipments. - The payload we prepared was a
ModelPackageobject that precisely described the physical box: its dimensions, weight, and the exact contents from the parent shipment. - The
newShipmentPackagecall sent this data to Kibo. Kibo validated that the items were part of the shipment and that the shipment was in a “Ready” state, then created the package record and returned it with its newpackageId.
Update & Delete Shipment Packages
Update Shipment Package
When You Need This: If you need to correct the weight, dimensions, or contents of a package before a shipping label has been generated. For example, a packer uses a different box than originally planned, or a scale gives a more accurate weight. API Documentation Reference:- Endpoint:
PUT /commerce/shipments/{shipmentNumber}/packages/{packageId} - Method:
PUT - API Docs: /developer-guides/shipments#update-shipment-package
Delete Shipment Package
When You Need This: If you need to completely re-pack a shipment. For example, you decide to split a single-box shipment into two smaller boxes. You would delete the original package and create two new ones. You can only delete a package before a shipping label has been created for it. API Documentation Reference:- Endpoint:
DELETE /commerce/shipments/{shipmentNumber}/packages/{packageId} - Method:
DELETE - API Docs: /developer-guides/shipments#delete-shipment-package
Multiple Real-World Examples
Example 1: Split a Shipment into Two Packages This advanced workflow shows how to pack a single shipment into two boxes.createNewPackage, updatePackageDetails, and deletePackage functions above serve as complete, runnable examples for each core CRUD operation. The combination in Example 1 also showcases an advanced, multi-step pattern.
Integrating Shipment Packages with Other Kibo Domains
Packages + Fulfillment Workflow
The creation of a package is a key state transition in the fulfillment process. Once all items in a shipment are assigned to one or more packages, the shipment is typically considered “Packed” and is ready for the next step: generating shipping labels. ThepackageId is a required parameter for the API call that creates a shipping label.
Packages + Customer Experience
ThepackageId and its associated trackingNumber (which is added to the package object after label generation) are important for the customer experience. This information is used to populate the “Your order has shipped!” email and to provide detailed tracking information on the order status page. Having separate packages allows you to show a customer that their single order is arriving in multiple boxes, each with its own tracking link.
Troubleshooting Your Package Implementation
Reading Kibo Error Messages
VALIDATION_ERROR: The most common error. This can happen for many reasons: the shipment is not in a “Ready” state, you try to put an item in a package that isn’t in the parent shipment, or the quantities don’t match. Themessagefield is essential for debugging.SHIPMENT_NOT_FOUND: TheshipmentNumberyou provided does not exist.PACKAGE_NOT_FOUND: ThepackageIdyou provided for an update or delete operation does not exist.
Common Development Issues
Issue 1: My call tonewShipmentPackage is failing with a VALIDATION_ERROR about the shipment’s state.
- Why it happens: You can only create packages for shipments that are in the
Readystate. If the shipment is stillPendingor has already beenFulfilled, the API will reject the request. - How to fix it: Before attempting to create a package, your application should first
GETthe shipment and verify that itsstatusisReady. If it’s not, you cannot proceed with packing.
- Why it happens: The most likely reason is that a shipping label has already been generated for that package. Once a package is associated with a carrier label and tracking number, it becomes part of a financial transaction with the carrier and is effectively “locked” to prevent data integrity issues.
- How to fix it: The fulfillment workflow must be reversed in the correct order. You would first need to void the shipping label through the carrier integration, which would then allow the package to be deleted. In practice, it’s often easier to work with the shipment as-is unless there is a significant error.

