Inventory
Inventory Overview
Inventory APIs are currently in public preview. This means that the API can change in backwards incompatible ways before general availability.
The inventory APIs make it easy to work with items, manifests, and fulfillments in the PackageX ecosystem. Please get familiar with the definitions of our inventory terms:
- Item: Is what you typically associate with inventory. These are things you want to track in quantities, like shirts or candles. You'll most likely have a SKU assigned to these items.
- Manifest: Is a list of items and/or assets that you are expecting to receive. You'll be able to systematically scan these items from a manifest to ensure that all items have been received.
- Fulfillment: This is a list of items that you need to ship out. A fulfillment will be able to help you box all of the items and then ship the goods.
Example Flow
The code will highlight what occurs with the inventory item quantities during the flow.
Create Manifest
Our coffee shop, Dispatch Roasters, orders 50 bags of our Dispatch Ethiopian Blend from our supplier warehouse. A manifest is created by the warehouse which we will use to track that item into our warehouse. If my supplier did not have the ability to create a manifest into PackageX from their system, someone on my team could create one on their behalf.
Process Manifest
When the manifest arrives, the items are checked in by our staff. We realize that the shipment contained only 45 Dispatch Ethiopian Blend bags, and additionally, 5 were damaged in transit. We will contact the supplier about the 10 bags we had issues with (5 missing and 5 damaged). We'll nevertheless mark the manifest as completed.
Fulfillment Created
A customer orders 10 bags of our coffee via our eCommerce store. A fulfillment is automatically generated. 10 items are moved from "verified" to "reserved" to make sure no other customer can order them.
Fulfillment Completed
After the fulfillment has been completed, the reserved amount will be decremented by the amount of items I have shipped.
Object IDs
Updating Counts
Whenever you want to increment or decrement an inventory value, just pass a positive or negative number, respectively.
If you want to force reset a value (not recommended), you can do so by passing the value in as the single value in an array. For example, if you wanted to reset the reserved_qty
to five, you would pass in as [5]
.