Pipe17 allows logistic channels to report on hand, available inventory. Typically the 3PL connection will report this inventory on a periodic basis. Pipe17 will calculate the available to promise (ATP) for each Sales channel and push it to the channel. Read more about Inventory in the Pipe17 documentation.
In this implementation we will:
- Pull inventory from ShipBob
- Push Inventory to Pipe17
Inventory related code is in the inventoryService.js file.
Step 1: Pull Inventory from ShipBob
Depending on the 3PL channel's API there can be multiple ways of fetching Inventory. Connections in Pipe17 usually follow either a snapshot approach (i.e. a snapshot of the entire Inventory at a specific timestamp) or an incremental update approach (i.e. inventory updates fetched at a regular frequency like once every hour). The approach can depend on factors such as API support, API rate limits, typical size of inventory, processing time etc.
ShipBob for example provides Inventory via List Inventory Items endpoint, List Inventory by Product endpoint, or even the List Products endpoint response includes Inventory data. In our example we will use the List Inventory by Product endpoint.
We need to consider 2 things when fetching Inventory updates from a 3PL/WMS channel: the Product, and the Location. As discussed in the Products section we may want to manage a subset of the entire Product Catalog in the 3PL channel, so we will fetch Inventory only for the Products that have been pushed to ShipBob from Pipe17. Now since Order routing depends on specific Locations we want to fetch Inventory only for the Locations that we have created in Pipe17.
The pullInventoryFromShipBob function first finds all the Products that have been pushed to ShipBob, then finds all the Locations that have been pulled from ShipBob and then uses this information to fetch Inventory per Product. You may apply more filters here such as status of the Product based on your business rules.
Note: it will be more efficient to fetch this data from the List Products endpoint, but for illustration purposes we are using Inventory endpoints to fetch Inventory. It is not typical to find Inventory data when fetching Products.
Step 2: Push Inventory to Pipe17
Pipe17 has 2 options to either create Inventory Log Items or update existing Inventory values. In both cases Inventory is linked to a specific SKU and Location.
The Inventory Log Items are created when Inventory data is pushed from a 3PL/WMS source channel into Pipe17. The event type for this can be either "ingest" or "adjust".
The Inventory update on the other hand can happen on inbounds receiving, shipment cancellation, and such other reasons, please look at the available values for "event" in the API.
In this implementation we will be creating new Inventory Log items every time we push Inventory data from ShipBob to Pipe17. The pushInventoryToPipe17 function creates Inventory Log Items in Pipe17 by mapping the appropriate fields, note the "event" is set to "ingest" and "ptype" (partner type) is set to "wms" meaning we are ingesting Inventory data from WMS into Pipe17.
Next Chapter: Reference Resources
Comments
0 comments