Documentation Home

Location Resolution

In order to check availability for a Sku and to decrement inventory for that Sku on checkout, the Advanced Inventory module provides the InventoryLocationResolver interface with 3 methods:

public interface InventoryLocationResolver {

  public List<FulfillmentLocation> resolveInventoryLocationsForAvailability(Sku sku, @Nullable Order order);
  public FulfillmentLocation resolveInventoryLocationForIncrement(Sku sku, Integer quantity, @Nullable Order order);
  public FulfillmentLocation resolveInventoryLocationForDecrement(Sku sku, Integer quantity, @Nullable Order order);

}

These methods are invoked for different use cases that are outlined in the Javadocs for InventoryLocationResolver.

The most common customization point is the resolveInventoryLocationsForAvailability method. This is used by the InventoryService.retrieveQuantityAvailable(sku) to determine which Fulfillment Locations to actually use to display inventory.

Note: if you are using the 'single location per group' or 'singe location per item' InventoryResolutionStrategy then the quantity available method obtains the maximum quantity at a single Fulfillment Location

Default Behavior

  • Displaying Inventory / Checking Availability - all of the Fulfillment Locations are used
  • Incrementing Inventory - the first Fulfillment Location that has the given Sku and matches the Sku's Fulfillment Type is used
  • Decrementing Inventory - the first location that has enough quantity to decrement for the given Sku and matches the Sku's Fulfillment Type is used