Inventory Setup
This section describes the rules and procedures to set up inventory as per your business needs.
This section describes the rules and procedures to set up inventory as per your business needs.
- Create Location
- Update Product Information (Optional)
- Create a Network
- Create or Update Inventory
- Query Inventory
- Rules for Displaying Inventory for Different Counters on Product Website
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, required fields are sku, itemId, location, channelId, and counters. Rest all are optional and you can configure those fields based on your requirements. For details, see Create Inventory section.
- If you are using only Inventory service provided by 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 is currently in stock for selling. As per the
onHand
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.
The following is a request/response example showing calculated virtualCounters based on the counter data provided in the request body.
Request Sample:
Response Sample:
Create Location
API Mapping: POST/api/v2/location
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 is not required as product data will automatically be imported into the pim-connector.
API Mapping:
- Use
POST/api-pim-external/product
for uploading details of a single product. - For more than one product update, you can mention the product details in a
.csv
file, and upload the file using thePOST/api-pim-external/product/bulk-insert
endpoint.
Request Sample:
Response Sample:
Create a Network
API Mapping: POST/api/v2/inventory/network
- 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. You can also configure safety stock (as well as low stock) quantities while creating or updating inventories for a specific network.
Request Sample:
Response Sample:
Create or Update Inventory
API Mapping:
- PUT/api/v2/inventory/adjustment: Update inventory by increasing or decreasing counter quantity, Or Create an inventory.
- POST/api/v2/inventory/aws/upload-url: Create inventory or bulk import inventory data by uploading a
.csv
file. Before uploading the file, you must mention product details in the file.
- If you want to represent an inventory in unlimited quantities, set
infiniteInventory
to ‘true’. - Use
customAttributes
to define any custom attributes 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. - You can 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 is currently in stock for selling. Based on the
onHand
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 is 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 is 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 is permitted for backorder (reserve for restock) or pre-order (inventory quantity on launch date).
Request Sample:
Response Sample:
Query Inventory
After you successfully create an inventory, you can query for inventory on the storefront or using API (GET/api/v2/inventory).
- While querying for inventory in general, you must include SKU and network code (if you have created a network) as query parameters to obtain a response body containing the numerical value in the “Available to Purchase” property.
- While querying for an inventory of type BOPIS (Buy Online Pickup In Store), you must include SKU, locationNum, and channelId to obtain a response body containing information for BOPIS.
Response Sample:
Rules for Displaying Inventory for Different Counters on Product Website
- In stock: Use the
onHand
counter from the request body to represent inventory that is 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 many more while creating the location using the
create location
API.
- 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
- Increment or decrement update to inventory records:
- Use the
onHand
counter to represent in-stock inventory. - Use the
PUT/api/v2/inventory/adjustment
endpoint to send a REST HTTP request to fabric Inventory for the change with the request body specifying SKU, locationNum, channel, and counter quantity that is either decremented or incremented.
- 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?