Multi-Location Inventory
Published by Miranda Danielson on January 4, 2022
Last updated on March 1, 2024
New feature to allow tracking of product inventory across multiple locations. Updated in April 2023 to include the option to limit shopper access to inventory at specific locations by using granular assignments.
New Resource: InventoryRecord
1"InventoryRecord" : {2 "ID": "",3 "OwnerID": "",4 "AddressID": "",5 "Address": {...}, //read-only Address object6 "OrderCanExceed": false,7 "QuantityAvailable": 0,8 "LastUpdated": "2022-01-04T00:00:00.00+00:00",9 "AllowAllBuyers": true,10 "xp": {}11}
Optionally used in conjunction with InventoryRecordAssignment
1"InventoryRecordAssignment": {2 "InventoryRecordID": "",3 "BuyerID": "",4 "UserGroupID": ""5}
The InventoryRecord resource exists only in the context of a given Product, and can be extended to Product Variants.
The ID property is writable and follows the same convention as all other writable IDs in OrderCloud.
The
OwnerIDproperty is writable only by the Marketplace Owner. Otherwise this ID reflects the Supplier that created the Inventory Record.The
Product.Inventoryobject will remain on the Product resource, even if Inventory Records are associated with the given Product.If any InventoryRecords exist for a product,
Product.Inventory.QuantityAvailablewill be the derived sum of allInventoryRecord.QuantityAvailable. If you write to it, the value will never be returned unless all InventoryRecords are deleted.
Addressis a read-only object derived from theAddressIDgiven.Multiple InventoryRecords for the same Product/Address combination are allowed. This can be useful if you need to track different inventory levels for different fulfillment methods.
The
AddressIDused to create anInventoryRecordmust be owned by theOwnerID.AllowAllBuyersdefaults totrue. If you want to control Inventory Records more granularly, set this value tofalseand use assignments.
New Endpoints
Products
GET v1/products/{productID}/inventoryrecordsGET v1/products/{productID}/inventoryrecords/{inventoryRecordID}POST v1/products/{productID}/inventoryrecordsPUT v1/products/{productID}/inventoryrecords/{inventoryRecordID}PATCH v1/products/{productID}/inventoryrecords/{inventoryRecordID}DELETE v1/products/{productID}/inventoryrecords/{inventoryRecordID}GET v1/products/{productID}/inventoryrecords/assignmentsPOST v1/products/{productID}/inventoryrecords/assignmentsDELETE v1/products/{productID}/inventoryrecords/{inventoryRecordID}/assignments
Variants
GET v1/products/{productID}/variants/{variantID}/inventoryrecordsGET v1/products/{productID}/variants/{variantID}/inventoryrecords/{inventoryRecordID}POST v1/products/{productID}/variants/{variantID}/inventoryrecordsPUT v1/products/{productID}/variants/{variantID}/inventoryrecords/{inventoryRecordID}PATCH v1/products/{productID}/variants/{variantID}/inventoryrecords/{inventoryRecordID}DELETE v1/products/{productID}/variants/{variantID}/inventoryrecords/{inventoryRecordID}GET v1/products/{productID}/variants/{variantID}/inventoryrecords/assignmentsPOST v1/products/{productID}/variants/{variantID}/inventoryrecords/assignmentsDELETE v1/products/{productID}/variants/{variantID}/inventoryrecords/{inventoryRecordID}/assignments
Me
GET v1/me/products/{productID}/inventoryrecordsGET v1/me/products/{productID}/variants/{variantID}/inventoryrecords
New Properties
LineItem.InventoryRecordID
Only writable prior to submitting an order
References the
InventoryRecordthat will be decremented on submit.If using Inventory Records for a given Product, you must provide an
InventoryRecordIDon theLineItemin order to track inventory. If any Inventory Records exist for a Product on aLineItemwhereInventoryRecordIDis null, no inventory will be decremented on order submit.
OrderCalculateResponse.LineItemOverrides.InventoryRecordID
Allows an override of InventoryRecordID on a given
LineItemNot validated for
AllowAllBuyersor explicit assignments
Configuring your Inventory Records
Use Case
There are three physical locations customers can choose from to pick up their order after buying online.
Administrative Workflow
Create three
InventoryRecordsfor each of your products usingPOST v1/products/{productID}/inventoryrecordsEach should be associated with a unique address associated with the physical locations.
Assignments aren't needed unless you want to limit certain shoppers to certain locations
Set the
QuantityAvailableat each location
Shopper Workflow
Navigate to a product detail page after browsing products
Call
GET v1/me/products/{productID}/inventoryrecords?QuantityAvailable=>1to view which locations that have the product in stockAdd the product to my cart using
POST v1/cart/lineitemsmaking sure to includeLineItem.InventoryRecordIDin the request bodyAdding the reference to the
InventoryRecordtells OrderCloud where to decrement the correct quantity from on submitYou can optionally enforce that
InventoryRecordIDis present on every LineItem by using pre-webhooks if needed
Still have questions?
Ask in our Community Channel