Inventory Setup
This document is intended for merchants and their SI (System Integrator) partners who want to set up inventory. It describes the rules and procedures to set up inventory as per the business need.
To set up inventory:
Refer to the following sections for additional information:
General Rules:
- If you are using a third-party product information management system other than fabric’s Product Catalog, you must provide product details to fabric in a
.csv
file. For details, see the Update Product Information section. If you are already using fabric’s Product Catalog to maintain product information, ignore this step. - To create or update inventory, you must provide
sku
,itemId
,location
,channelId
, andcounters
. You can provide other details to configure the inventory based on your requirements. For details, see the Create Inventory section.- If you are using only the Inventory service of fabric (not the entire OMS service), you must mention allocated and shipped counter quantities to update inventory. If you are using fabric’s OMS to manage inventory and order fulfillment, allocated and shipped counter quantities will be taken care of automatically.
- Use the
onHand
counter to represent the inventory quantity that’s currently in stock for selling. Per theonHand
counter value passed in the request body,availableToPurchase
(the virtual counter) quantity is calculated, based on the formulaonHand - allocated - shipped - safetyStock
.safetyStock
is also subtracted if you includesafetyStock
value while creating inventory. - Subscribe to any of the inventory webhook events to get a notification for inventory updates. For sample curl and other details, see List of Webhook Events.
Create location
API Mapping: POST/v3/locations
Using the POST/v3/locations
endpoint, you can create records for your stores, with details including postal code, hours of operation, BOPIS enabled, and other custom attributes that are applicable to your business.
Request Sample:
Response Sample:
Update Product Information (Optional)
Note: This step is required if you are using product management software other than fabric’s Product Catalog. If you are using fabric’s Product Catalog to maintain your product data, this step isn’t required as product data will automatically be imported to the Catalog Connector.
API Mapping:
- Use the
PUT/products/{id}
endpoint for updating a single product by ID. - Use the
PUT/products
endpoint for updating multiple products.
Sample request to update a single product:
Sample response for updating a single product:
Create a network
API Mapping: POST/v3/inventory-networks
- Network refers to a group of locations with a group of SKUs in each location.
- You can create a network to map inventories for the created networks. A network code is generated for the created network. You can mention the network code while creating or updating inventories for a specific network.
- You can configure safety stock quantities for a network while creating a network. Additionally, you can configure safety stock and low stock quantities while creating or updating inventories for a specific network.
Request Sample:
Response Sample:
Create or update inventory
API Mapping:
- POST/v3/inventories: Create inventory
- Post/v3/inventories/action/find-and-update: Update inventory either by replacing existing property value or by adding a new value to an existing property.
- Set the
infiniteInventory
parameter totrue
to configure unlimited quantities of inventory. - Use
customAttributes
to define any custom attribute that suit your business use case. For example, you can set BOPIS (Buy Online Pickup In Store) totrue
if you are willing to allow shoppers to buy online and pick up an item from the store (based on location number). - If you provide values for
backOrderLimit
andpreOrderLimit
while creating inventory,availableBackorder
andavailablePreorder
virtual-counters are displayed in the response object with the same values as provided in the request body. - Configure values for
safetyStock
andlowStock
fields while creating or updating inventory for better inventory management.
Rules for updating counter quantity:
- Use the
onHand
counter to represent the inventory quantity that’s currently in stock for selling. Based on theonHand
counter value as passed in the request body,availableToPurchase
quantity is calculated based on the formulaonHand - allocated - shipped
and displayed in the response object. - (Not required if you are using the Order module of fabric OMS) Use the “allocated” counter to represent inventory that’s sent to warehouses for fulfillment (only the warehouse can cancel the order at this point).
- (Not required if you are using the Order module of fabric OMS) Use the “shipped” counter to represent inventory that’s marked as shipped by the warehouse (at this stage in the life-cycle the order can only be returned).
- Use “backorderReserve” and “preOrderReserve” counters (under counter object) to represent inventory quantity that’s permitted for backorder (reserve for restock) or pre-order (inventory quantity on launch date).
Sample request to create or update inventory:
Response sample for creating or updating inventory:
Query inventory
After you successfully create an inventory, you can query for inventory information either using the Copilot user interface or using the POST/v3/inventories/actions/find
endpoint.
- While searching for inventory information, you must include SKU and network code (if you have created a network) as query parameters to get the “Available to Purchase” information.
- While searching for an inventory of type BOPIS (Buy Online Pickup In Store), you must include SKU,
locationNum
, andchannelId
to get information for BOPIS.
Sample request:
Sample response:
Rules for updating counter quantity
- In stock: Use the
onHand
counter in the request body to represent inventory that’s currently available in the location to sell. - In Stock for BOPIS (Buy Online Pickup In Store) for an SKU in a specified radius of zip code or postal code:
- Use the
onHand
counter to represent in-stock inventory. - Define BOPIS using the
customAttribute
field while creating or updating inventory. - Zip code or postal code is identified based on the location number. A location number is generated for a location for which you provide all details such as name, address, type, zip or postal code, and more information while creating the location using the
create location
endpoint.
- Use the
- In Stock for BOPIS in a specified store:
- Use the
onHand
counter to represent in-stock inventory. - Define BOPIS using the
customAttribute
field while creating or updating inventory. A specific store is identified by the location number.
- Use the
- Adjust inventory records by increasing or decreasing counter quantity:
- Use the
onHand
counter to represent in-stock inventory. - Use the
POST/v3/inventories/actions/find-and-adjust-inventory-counters
endpoint to adjust counter quantity. You can provide the SKU, location, and counter quantity in the request payload to adjust theonHand
counter quantity. Counter quantity accepts both positive and negative values. Based on the value you specify in the request payload for the counter quantity, the original counter quantity is either decreased or increased. For example, if the original counter quantity is 100, and you specify the counter quantity as “-10” in the request payload, then the updatedonHand
counter becomes 90.
- Use the
- Displaying Backorder, Preorder, Safety Stock, and Low Stock on Website:
- If the
availableToPurchase
value is greater than zero, then calculate if theavailabletoPurchase
quantity is greater than thesafetyStock
value.- If
availableToPurchase
quantity is greater than 0, then display the item as in-stock. - If
availableToPurchase
quantity is equal to 0 andavailableBackorder
is greater than 0, then display the item as in-stock-for-backorder. - If Available and Backorder are both out of stock, and
availableToPreorder
is greater than 0, then display the item as in-stock-for-preorder, else display the item as out-of-stock. - If the item is a
Backorder
orPreorder
item, then display the expected restock date (backorderDate) or expected product launch date (preOrderDate)
- If
- If the
Was this page helpful?